Quote:Original post by jollyjeffers
Yeah, you seem to have got the right idea - D3D is finding conflicting information about the data and getting all upset over it [smile]
Quote:[EDIT 1] What I don't get is why is the error saying that DX is comparing declaration when I'm not even using it. I'm using FVF, not DECL. Can someone please clarify?
Internally D3D is likely to be using declarations - they're a superset and successor to FVF's. Therefore it might not ever 'see' the FVF as some code in the runtime immediately converts it to a declaration internally, or something along those lines...
Just as a matter of coding style - the use of an arbitrary constant 12 in that parameter is just nasty! Having it abstracted out as a constant matching the vertex declaration, or using a sizeof(my_vertex_type) or even D3DXGetFVFVertexSize()...
Bottom line - get everything matching up and you should be sorted.
hth
Jack
Thank you for the reply, Jack.
First, let me try to explain what I'm trying to do in the app (background). I'm trying to emulate the functionality of DrawPrimitivesUP without using DrawPrimitivesUP and want to get the output of the vertex shader myself after doing it in Software.
I'm doing the following:
1. Creating an input vertex buffer. I set the FVF flag to
0. This is because I only know the user-defined stride and the user-defined input data (because I'm trying to emulate DrawPrimitivesUP() function). I just have a vertex shader, a user provided buffer and the stride in this buffer. I want to store the result in an output buffer.
I don't want to use FVF or any other declaration. I want to use ONLY the user-defined stride (and that I do in SetStreamSource).
Notice that I can't really extract the FVF from the user-provided data, therefore I set the FVF to 0, which I assume is invalid FVF.
2. I then call SetStreamSource with the newly-created vertex-buffer and user-provided stride.
3. I then create an output vertex buffer.
4. I call ProcessVertices(). Unfortunately, it still gives me the same error, i.e. Vertex stride in stream 0 is less than in the declaration.
How can this be? I'm not even using FVF now. The FVF I use to create the the input vertex buffer is 0.
Can anyone tell me how to do this properly? I'm not given anything but the vertex shader, the user-provided data, the user-provided stride and want to get the output vertices. What is DirectX comparing the vertex stride in stream 0 to when it produces that error? Is there a way for it to not compare that (that's what I tried to do when I set the FVF to 0.. so it will compare the stride to nothing).
Maybe I need to generate an FVF code based on the user-provided stride to make sure it's less than that, but invalid FVF (value of 0) is the smallest I can provide... which still errors.
Help would be appreciated.
[Edited by - madiyaan on April 16, 2007 4:27:09 PM]