29 #include "BufferD3D11.h" 30 #include "RenderDeviceD3D11.h" 31 #include "BufferBase.h" 32 #include "BufferViewD3D11Impl.h" 39 enum class D3D11BufferState
42 ShaderResource = 0x01,
43 ConstantBuffer = 0x02,
46 UnorderedAccess = 0x10,
47 AnyInput = ShaderResource | ConstantBuffer | VertexBuffer | IndexBuffer
64 ID3D11Buffer *pd3d11Buffer);
68 virtual void QueryInterface(
const Diligent::INTERFACE_ID &IID, IObject **ppInterface )
override final;
74 virtual ID3D11Buffer *
GetD3D11Buffer()override final{
return m_pd3d11Buffer; }
78 void ResetState(D3D11BufferState State){m_State =
static_cast<Uint32
>(State);}
79 void AddState(D3D11BufferState State){m_State |=
static_cast<Uint32
>(State);}
80 void ClearState(D3D11BufferState State){m_State &= ~static_cast<Uint32>(State);}
81 bool CheckState(D3D11BufferState State){
return (m_State & static_cast<Uint32>(State)) ? true :
false;}
84 virtual void CreateViewInternal(
const struct BufferViewDesc &ViewDesc, IBufferView **ppView,
bool bIsDefaultView )
override;
86 void CreateUAV(
struct BufferViewDesc &UAVDesc, ID3D11UnorderedAccessView **ppD3D11UAV );
87 void CreateSRV(
struct BufferViewDesc &SRVDesc, ID3D11ShaderResourceView **ppD3D11SRV );
89 friend class DeviceContextD3D11Impl;
90 CComPtr<ID3D11Buffer> m_pd3d11Buffer;
92 Uint32 m_State =
static_cast<Uint32
>(D3D11BufferState::Undefined);
Describes the buffer initial data.
Definition: Buffer.h:176
virtual void CopyData(IDeviceContext *pContext, IBuffer *pSrcBuffer, Uint32 SrcOffset, Uint32 DstOffset, Uint32 Size) override final
Base implementation of IBuffer::CopyData(); validates input parameters.
Definition: BufferD3D11Impl.cpp:175
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Template class implementing base functionality for a buffer object.
Definition: BufferBase.h:46
virtual void Unmap(IDeviceContext *pContext, MAP_TYPE MapType, Uint32 MapFlags) override final
Base implementation of IBuffer::Unmap()
Definition: BufferD3D11Impl.cpp:209
virtual void UpdateData(IDeviceContext *pContext, Uint32 Offset, Uint32 Size, const PVoid pData) override final
Base implementation of IBuffer::UpdateData(); validates input parameters.
Definition: BufferD3D11Impl.cpp:158
Buffer interface.
Definition: Buffer.h:200
Device context interface.
Definition: DeviceContext.h:443
virtual void * GetNativeHandle() override final
Returns native buffer handle specific to the underlying graphics API.
Definition: BufferD3D11Impl.h:76
Buffer description.
Definition: Buffer.h:57
Memory allocator that allocates memory in a fixed-size chunks.
Definition: FixedBlockMemoryAllocator.h:50
Implementation of the Diligent::IRenderDeviceD3D11 interface.
Definition: RenderDeviceD3D11Impl.h:38
virtual void QueryInterface(const Diligent::INTERFACE_ID &IID, IObject **ppInterface) override final
Queries the specific interface, see IObject::QueryInterface() for details.
virtual ID3D11Buffer * GetD3D11Buffer() override final
Returns a pointer to the ID3D11Buffer interface of the internal Direct3D11 object.
Definition: BufferD3D11Impl.h:74
Implementation of the Diligent::IBufferD3D11 interface.
Definition: BufferD3D11Impl.h:51
virtual void Map(IDeviceContext *pContext, MAP_TYPE MapType, Uint32 MapFlags, PVoid &pMappedData) override final
Base implementation of IBuffer::Map(); validates input parameters.
Definition: BufferD3D11Impl.cpp:192
MAP_TYPE
Resource mapping type.
Definition: GraphicsTypes.h:125