29 #include "TextureD3D11.h" 30 #include "RenderDeviceD3D11.h" 31 #include "TextureBase.h" 32 #include "TextureViewD3D11Impl.h" 37 class FixedBlockMemoryAllocator;
39 enum class D3D11TextureState
45 UnorderedAccess = 0x8,
46 Output = RenderTarget | DepthStencil | UnorderedAccess
62 virtual void QueryInterface(
const Diligent::INTERFACE_ID &IID, IObject **ppInterface )
override final;
67 virtual void Map(
IDeviceContext *pContext, Uint32 Subresource,
MAP_TYPE MapType, Uint32 MapFlags, MappedTextureSubresource &MappedData )
override final;
85 void ResetState(D3D11TextureState State){m_State =
static_cast<Uint32
>(State);}
86 void AddState(D3D11TextureState State){m_State |=
static_cast<Uint32
>(State);}
87 void ClearState(D3D11TextureState State){m_State &= ~static_cast<Uint32>(State);}
88 bool CheckState(D3D11TextureState State){
return (m_State & static_cast<Uint32>(State)) ? true :
false;}
91 void CreateViewInternal(
const struct TextureViewDesc &ViewDesc, ITextureView **ppView,
bool bIsDefaultView )
override final;
92 void PrepareD3D11InitData(
const TextureData &InitData, Uint32 NumSubresources,
93 std::vector<D3D11_SUBRESOURCE_DATA, STDAllocatorRawMem<D3D11_SUBRESOURCE_DATA> > &D3D11InitData);
95 virtual void CreateSRV( TextureViewDesc &SRVDesc, ID3D11ShaderResourceView **ppD3D11SRV ) = 0;
96 virtual void CreateRTV( TextureViewDesc &RTVDesc, ID3D11RenderTargetView **ppD3D11RTV ) = 0;
97 virtual void CreateDSV( TextureViewDesc &DSVDesc, ID3D11DepthStencilView **ppD3D11DSV ) = 0;
98 virtual void CreateUAV( TextureViewDesc &UAVDesc, ID3D11UnorderedAccessView **ppD3D11UAV ) = 0;
100 friend class RenderDeviceD3D11Impl;
104 Uint32 m_State =
static_cast<Uint32
>(D3D11TextureState::Undefined);
virtual void QueryInterface(const Diligent::INTERFACE_ID &IID, IObject **ppInterface) override final
Queries the specific interface, see IObject::QueryInterface() for details.
Texture description.
Definition: Texture.h:82
Base implementation of the Diligent::ITextureD3D11 interface.
Definition: TextureBaseD3D11.h:50
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Describes data for one subresource.
Definition: Texture.h:193
void CopyData(IDeviceContext *pContext, ITexture *pSrcTexture, Uint32 SrcMipLevel, Uint32 SrcSlice, const Box *pSrcBox, Uint32 DstMipLevel, Uint32 DstSlice, Uint32 DstX, Uint32 DstY, Uint32 DstZ)
Base implementaiton of ITexture::CopyData(); validates input parameters.
Definition: TextureBaseD3D11.cpp:169
virtual void Map(IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags, MappedTextureSubresource &MappedData) override final
Base implementaiton of ITexture::Map()
Definition: TextureBaseD3D11.cpp:202
void CreateViewInternal(const struct TextureViewDesc &ViewDesc, ITextureView **ppView, bool bIsDefaultView) override final
Pure virtual function that creates texture view for the specific engine implementation.
Definition: TextureBaseD3D11.cpp:44
CComPtr< ID3D11Resource > m_pd3d11Texture
D3D11 texture.
Definition: TextureBaseD3D11.h:102
Describes the initial data to store in the texture.
Definition: Texture.h:243
Device context interface.
Definition: DeviceContext.h:443
virtual void * GetNativeHandle() override final
Returns native texture handle specific to the underlying graphics API.
Definition: TextureBaseD3D11.h:72
Box.
Definition: GraphicsTypes.h:1005
Memory allocator that allocates memory in a fixed-size chunks.
Definition: FixedBlockMemoryAllocator.h:50
virtual void Unmap(IDeviceContext *pContext, Uint32 Subresource, MAP_TYPE MapType, Uint32 MapFlags) override final
Base implementaiton of ITexture::Unmap()
Definition: TextureBaseD3D11.cpp:226
Implementation of the Diligent::IRenderDeviceD3D11 interface.
Definition: RenderDeviceD3D11Impl.h:38
virtual void UpdateData(IDeviceContext *pContext, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData) override final
Base implementaiton of ITexture::UpdateData(); validates input parameters.
Definition: TextureBaseD3D11.cpp:145
Base implementation of the ITexture interface.
Definition: TextureBase.h:52
MAP_TYPE
Resource mapping type.
Definition: GraphicsTypes.h:125
virtual ID3D11Resource * GetD3D11Texture() override final
Returns a pointer to the ID3D11Resource interface of the internal Direct3D11 object.
Definition: TextureBaseD3D11.h:70
Texture inteface.
Definition: Texture.h:276