23 D3D11_BUFFER_DESC desc;
25 desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
27 desc.StructureByteStride = 0;
32 desc.Usage = D3D11_USAGE_IMMUTABLE;
37 desc.Usage = D3D11_USAGE_DYNAMIC;
38 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
42 desc.Usage = D3D11_USAGE_DEFAULT;
47 ID3D11Buffer*
buffer =
nullptr;
51 D3D11_SUBRESOURCE_DATA
data;
52 data.pSysMem = tbuffer->
GetData();
54 data.SysMemSlicePitch = 0;
55 hr = device->CreateBuffer(&desc, &data, &buffer);
59 hr = device->CreateBuffer(&desc,
nullptr, &buffer);
78 return std::make_shared<DX11TextureBuffer>(
79 reinterpret_cast<ID3D11Device*
>(device),
80 static_cast<TextureBuffer const*>(
object));
99 D3D11_SHADER_RESOURCE_VIEW_DESC desc;
100 desc.Format =
static_cast<DXGI_FORMAT
>(tbuffer->
GetFormat());
101 desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
102 desc.Buffer.FirstElement = 0;
104 HRESULT hr = device->CreateShaderResourceView(dxBuffer, &desc, &
mSRView);
unsigned int GetNumElements() const
DX11TextureBuffer(ID3D11Device *device, TextureBuffer const *tbuffer)
#define D3D11_RESOURCE_MISC_NONE
ID3D11ShaderResourceView * mSRView
#define CHECK_HR_RETURN_NONE(msg)
ID3D11Buffer * GetDXBuffer() const
HRESULT SetPrivateName(ID3D11DeviceChild *object, std::string const &name)
GraphicsObjectType GetType() const
GLuint const GLchar * name
ULONG FinalRelease(T *&object)
void CreateSRView(ID3D11Device *device)
virtual void SetName(std::string const &name)
GLsizei const GLchar *const * string
#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
virtual ~DX11TextureBuffer()
CopyType GetCopyType() const
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
TextureBuffer * GetTextureBuffer() const
virtual void SetName(std::string const &name) override