Question

When i run PIX it shows me in the viewport window where my pimitives are drawed on the "screen".

PIX Window

In a d3d9 proxy dll i call the DrawIndexPrimitive regular:

DrawIndexedPrimitive(PrimitiveType,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount)

How can i access after this the "Viewport" points of my primitives?

Était-ce utile?

La solution

The simple answer to your question is It is not possible to recover vert information from a GPU once it has been sent to the GPU. The GPU loads the verts and buffers into it's super fast GDDR memory, which cannot be accessed by the CPU. There is one DX function to retrieve a render buffer back into normal memory (but that is slow), and really the GPU just wants to send a render target to the screen.

Looking at the starcraft blog... http://graphics.stanford.edu/~mdfisher/GameAIs.html

That is why the blogger, created a mirror driver that would capture the DX calls as they went to the GPU, so he knew what was sent to the GPU, and could keep it in normal memory.

Then as he describes in the section titled 'Vertex Shader Simulation' he explains how gets duplicate CPU versions of the GPU shaders (noting they will run MUCH MUCH slower on the CPU). He then runs emulates the work already done by the GPU vert programs, on the CPU, so he can have the verts in viewport space is normal memory. I presume he only runs the vert shaders, and not the tessellation or pixel shaders, because in your question you were only asking for verts.

Autres conseils

Maybe this website can help you a bit.

There he wrote a great DirectX Interception DLL.

Matt's Webcorner

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top