In DirectX 11, I'm looking to read back some buffer data that is on the GPU. I've done a great deal of research and I feel I'm almost there. I've been able to copy the buffers from GPU memory to system memory for CPU access. What I want to do now is access certain vertices so I can do some calculations.
I have been told that too loop through the buffer, you need to know what the structure of the buffer is. So for example, in this link it describes how a vertex buffer is created:
This is the structure they used in part to initialize it.
// Define the data-type that
// describes a vertex.
struct SimpleVertexCombined
{
XMFLOAT3 Pos;
XMFLOAT3 Col;
};
I'm using to the IAGetVertexBuffers() method to return some buffers during DX runtime. Is there a way for me to me query there vertex structure (similar to above example)?
Here is a small snippet of my code.
pContext->IAGetVertexBuffers(0, 1, &buff, &Stride, &veBufferOffset);
if (buff)
buff->GetDesc(&vedesc);