mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 15:57:31 +09:00
Issue #2393 - Part 2 - Add D3D11YCbCrImage type and related methods
Will allow to directly upload a YUV420 buffer into a D3D11 texture.
This commit is contained in:
parent
1fc1753d4d
commit
74a22e5c00
9 changed files with 568 additions and 69 deletions
|
|
@ -127,10 +127,9 @@ class DXGIYCbCrTextureData : public TextureData
|
|||
{
|
||||
public:
|
||||
static DXGIYCbCrTextureData*
|
||||
Create(TextureFlags aFlags,
|
||||
IUnknown* aTextureY,
|
||||
IUnknown* aTextureCb,
|
||||
IUnknown* aTextureCr,
|
||||
Create(IDirect3DTexture9* aTextureY,
|
||||
IDirect3DTexture9* aTextureCb,
|
||||
IDirect3DTexture9* aTextureCr,
|
||||
HANDLE aHandleY,
|
||||
HANDLE aHandleCb,
|
||||
HANDLE aHandleCr,
|
||||
|
|
@ -139,8 +138,7 @@ public:
|
|||
const gfx::IntSize& aSizeCbCr);
|
||||
|
||||
static DXGIYCbCrTextureData*
|
||||
Create(TextureFlags aFlags,
|
||||
ID3D11Texture2D* aTextureCb,
|
||||
Create(ID3D11Texture2D* aTextureCb,
|
||||
ID3D11Texture2D* aTextureY,
|
||||
ID3D11Texture2D* aTextureCr,
|
||||
const gfx::IntSize& aSize,
|
||||
|
|
@ -166,8 +164,11 @@ public:
|
|||
return TextureFlags::DEALLOCATE_MAIN_THREAD;
|
||||
}
|
||||
|
||||
ID3D11Texture2D* GetD3D11Texture(size_t index) { return mD3D11Textures[index]; }
|
||||
|
||||
protected:
|
||||
RefPtr<IUnknown> mHoldRefs[3];
|
||||
RefPtr<ID3D11Texture2D> mD3D11Textures[3];
|
||||
RefPtr<IDirect3DTexture9> mD3D9Textures[3];
|
||||
HANDLE mHandles[3];
|
||||
gfx::IntSize mSize;
|
||||
gfx::IntSize mSizeY;
|
||||
|
|
@ -450,6 +451,16 @@ inline uint32_t GetMaxTextureSizeForFeatureLevel(D3D_FEATURE_LEVEL aFeatureLevel
|
|||
return maxTextureSize;
|
||||
}
|
||||
|
||||
class AutoLockD3D11Texture
|
||||
{
|
||||
public:
|
||||
explicit AutoLockD3D11Texture(ID3D11Texture2D* aTexture);
|
||||
~AutoLockD3D11Texture();
|
||||
|
||||
private:
|
||||
RefPtr<IDXGIKeyedMutex> mMutex;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue