17 D3D11_BUFFER_DESC desc;
19 desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
21 desc.StructureByteStride = 0;
25 desc.Usage = D3D11_USAGE_IMMUTABLE;
30 desc.Usage = D3D11_USAGE_DYNAMIC;
31 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
35 desc.Usage = D3D11_USAGE_DEFAULT;
40 ID3D11Buffer*
buffer =
nullptr;
44 D3D11_SUBRESOURCE_DATA
data;
45 data.pSysMem = cbuffer->
GetData();
47 data.SysMemSlicePitch = 0;
48 hr = device->CreateBuffer(&desc, &data, &buffer);
52 hr = device->CreateBuffer(&desc,
nullptr, &buffer);
68 return std::make_shared<DX11ConstantBuffer>(
69 reinterpret_cast<ID3D11Device*
>(device),
70 static_cast<ConstantBuffer const*>(
object));
#define D3D11_RESOURCE_MISC_NONE
#define CHECK_HR_RETURN_NONE(msg)
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
GraphicsObjectType GetType() const
#define LogError(message)
ID3D11DeviceChild * mDXObject
unsigned int GetNumBytes() const
void CreateStaging(ID3D11Device *device, D3D11_BUFFER_DESC const &bf)
char const * GetData() const
GLsizeiptr const void GLenum usage
#define D3D11_CPU_ACCESS_NONE
CopyType GetCopyType() const
DX11ConstantBuffer(ID3D11Device *device, ConstantBuffer const *cbuffer)