25#ifndef OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
26#define OPENSUBDIV3_OSD_D3D11_VERTEX_BUFFER_H
28#include "../version.h"
32struct ID3D11DeviceContext;
33struct ID3D11UnorderedAccessView;
36namespace OPENSUBDIV_VERSION {
50 ID3D11DeviceContext *deviceContext);
57 void UpdateData(
const float *src,
int startVertex,
int numVertices,
58 ID3D11DeviceContext *deviceContext);
70 ID3D11Buffer *
BindVBO(ID3D11DeviceContext *deviceContext) {
75 ID3D11UnorderedAccessView *
BindD3D11UAV(ID3D11DeviceContext *deviceContext);
87 ID3D11Buffer *_buffer;
88 ID3D11Buffer *_uploadBuffer;
89 ID3D11UnorderedAccessView *_uav;
95using namespace OPENSUBDIV_VERSION;
Concrete vertex buffer class for DirectX subdivision and DirectX drawing.
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
void UpdateData(const float *src, int startVertex, int numVertices, ID3D11DeviceContext *deviceContext)
static D3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
D3D11VertexBuffer(int numElements, int numVertices)
Constructor.
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
virtual ~D3D11VertexBuffer()
Destructor.
ID3D11UnorderedAccessView * BindD3D11UAV(ID3D11DeviceContext *deviceContext)
Returns the D3D11 UAV.
bool allocate(ID3D11Device *device)
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)