MattBT12
MattBT12

Reputation: 51

DirectX11: Determining The Size of a Vertex Buffer

I'm using a geometry shader with the stream output stage to create geometry from a list of points. The data from the geometry shader is streamed into a buffer, to be used as a vertex buffer in another shader. However, the ID3D11::Draw() call requires that you know exactly how many vertices you will be drawing, and I don't know this ahead of time. Simply calling sizeof() on the buffer will only give you the size of the pointer to the buffer. Is there a method for determining the size of buffers in DirectX 11?

Upvotes: 0

Views: 466

Answers (1)

user7860670
user7860670

Reputation: 37587

You can call ID3D11DeviceContext::DrawAuto method to draw geometry of unknown size that was processed by the input assembler, vertex shader, and stream-output stages.

Upvotes: 2

Related Questions