   DrawIndexedPrimitive is misbehaving
  When I do the following to render a quad, everything works fine:d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,4,0,2);If I try to skip ahead to the next quad in my index buffer (6 indices per quad) with the following, nothing renders:d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,4,6,2);Is there some magic trick to using the StartIndex parameter?quote:SyntaxHRESULT DrawIndexedPrimitive(D3DPRIMITIVETYPE Type,    INT BaseVertexIndex,    UINT MinIndex,    UINT NumVertices,    UINT StartIndex,    UINT PrimitiveCount);ParametersType[in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render. D3DPT_POINTLIST is not supported with this method. See Remarks. BaseVertexIndex[in] Offset from the start of the index buffer to the first vertex index.MinIndex[in] Minimum vertex index for vertices used during this call. NumVertices[in] Number of vertices used during this call, starting from BaseVertexIndex + MinIndexStartIndex[in] Location in the index array to start reading vertices. PrimitiveCount[in] Number of primitives to render. The number of vertices used is a function of the primitive count and the primitive type. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS9 structure.
  Please post how you create your vertex and index buffers.  I can''t tell why it could be messing up just from the two calls to DIP.neneboricua ;  Hmmm... i cant quite make it out just from that...Tryd3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,4,0,4);And then tell me what happens.... ;  Ooooh.... i think me knows what it is....CHANGE:d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,4,6,2);TO:d3ddevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,4,4,6,2);Because youre probably using verts 4-8 for the second face.. unless you are coding for graphical redundancy ;  By using DIP, one of the things you tell the runtime is that you are only using vertices from MinIndex to (MinIndex+NumVertices), in your case: Vertices [0,4)Do your second quad''s indices (that start at indexBuffer[StartIndex]) use these vertices (0 to 4, excluding 4)?To better understand DIP, see Tom Forsyth''s FAQ Muhammad Haggag;  It worked for my simplified example, but in the real program it didn't. There is no reason why changing MinIndex to 4 should affect things, as that FAQ so clearly says:quote:Note that MinIndex and NumVertices are not used by hardware pipelines [edited by - Raloth on February 12, 2004 5:46:43 PM];quote:Original post by Raloth  It worked for my simplified example, but in the real program it didn''t. There is no reason why changing MinIndex to 4 should affect things, as that FAQ so clearly says:quote:Note that MinIndex and NumVertices are not used by hardware pipelines [edited by - Raloth on February 12, 2004 5:46:43 PM]- You didn''t say you were using HW T&L or not.- With HW T&L, I don''t know what''s supposed to happen. The driver will not use the values for MinIndex and NumVertices for transforming the entire range, but maybe the runtime or the driver do some validity checks.- Your codepath should be compatible with SW T&L, unless you don''t have any planned support for non-HW T&L cards.- No interesting debug output?   Muhammad Haggag;  Sigh...It''s a driver bug...just like the one I had before...Someone has said it works on their computer. I guess I have to write a simpler program and try to isolate what''s tripping the driver up... ;quote:Original post by Raloth  Sigh...It''s a driver bug...just like the one I had before...Someone has said it works on their computer. I guess I have to write a simpler program and try to isolate what''s tripping the driver up...   I''d say: Try it on the REF before assuring it''s a driver bug. Sometimes, the d3d spec says "undefined behavior" for some incompatible settings/parameters. Drivers can do anything in that case...maybe some would work.If it doesn''t work on REF, then send your repro case to the relevant IHV (by the way, what''s the card/driver you''re using?)And if the driver is WHQL certified, cc directx@microsoft.com   Muhammad Haggag;  Are you using the debug runtime?  It may be validating these arguments. 