Re: A beginner in DirectX - A question about DrawIndexedPrimitive

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Richard [Microsoft Direct3D MVP] <legalize+jeeves@xxxxxxxxxxxxxxxxx> schreef
in berichtnieuws #tZH$FYwHHA.4736@xxxxxxxxxxxxxxxxxxxxxxx

Hello Richard,

If you don't want to calculate it, then you could always pass the full
range of indices on your buffer, but that would slow things down.

Actually, as I can't seem to find any information about what is needed (the
actual calculation or even a description to it) and I do not know what
happens if I provide it with a too-low number (again, no info to be found),
that looks to be my *only* option.

And yes, I can understand that that would slow-down the whole considerably,
but what am I to do ?

The entity that knows this relationship is the entity that loads
the primitives into the vertex/index buffers. That is your
application. When you construct the primitives, make note
of the range of indices in some data structure and be done
with it.

I've allready done pretty-much that (defining a structure that holds all the
info for a simple model : the vertexbuffer and indexbuffer and
texture-object handles, the size of those buffers, as well as translation
and rotation for the model). But even if I would want to store those
numbers into such a structure how can I as I do not even know how to
calculate them ? :-\


I did find a 170MByte copy of the v8.1 SDK (a struggle in itself), and found
a nice help-file in there. Imagine my disappointment and frustration when
it did not have any specific info about that calculation either.

It *looks* like it is saying that it wants to know how many primitives will
actually be drawn (like I can, for a cube, draw 12 triangle primitives with
only 8 vertices), but with all this conflicting information (like the one
which seemed to suggest that it needed to buffer a range of vertices and
thus a simple "ceil((HighestUsedVertex-LowestUsedVertex) div
VerticesPerShape)" should be used) I cannot be sure.

Regards,
Rudy Wieser



.



Relevant Pages

  • Re: A beginner in DirectX - A question about DrawIndexedPrimitive
    ... made the DirectX API know best about what the actual value should become. ... It however does leave the question what the calculation should exactly be: ... An indication so the function can buffer as many triangles as the indices ... why does the function talk about primitives instead of vertices ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Chipscope Error
    ... i've made net connections for my Data Trigger with "sender_BUS' of ...
    (comp.arch.fpga)
  • Re: Chipscope Error
    ... You can not connect directly to the PADs but instead you should connect to ... the signals on the fabric side of the IBUFs and OBUFs. ...
    (comp.arch.fpga)
  • Re: saa7134 broken in 2.6.15-rc2
    ... I've found the cause of this oops: ... that the length of the buffer is calculated wrongly. ... But "instructions" is calculated wrong. ... The other mistake in the buffer size calculation, and the one that hits me, is ...
    (Linux-Kernel)
  • Re: Pointer arithmetic question
    ... > end of the object that ptr1 points into. ... I was wondering if the mere calculation would ... since I will never actually dereference the bad pointer. ... >>What if n is greater than the size of the buffer to which ptr1 points? ...
    (comp.lang.c)