DrawPrimitive() failed

haho

New member
Hi.
Any idea why when primitive count > D3DCAPS8.MaxPrimitiveCount, and have to do many DrawPrimitive() calls, first call draw tris but subsequent no

if(_plCurDG->ulNumTriangles > _plEngine->xcDevCaps.MaxPrimitiveCount)
{
ULONG stari;
ULONG NumTris = 1000;


for(starti = 0; starti < _plCurDG->ulNumVertices ; starti += 3*NumTris)
{
ULONG RenderTris = 0;

if((_plCurDG->ulNumTriangles-(starti/3)) < NumTris)
RenderTris = _plCurDG->ulNumTriangles-(starti/3);
else
RenderTris = NumTris;

if(FAILED(_hr = IDirect3DDevice8_DrawPrimitive(_xDev,D3DPT_TRIANGLELIST,starti,RenderTris)))
{
assert(0);
return FALSE;
}
}
}
 
Debug runtime?

Debug runtime?

Are you running with the debug runtime? If not, you should run with it and look at the debug output (aka debug spew). This is generally the quickest way to debug this kind of problem.

-Jason
 
Re: Debug runtime?

Re: Debug runtime?

JasonM [ATI] said:
Are you running with the debug runtime? If not, you should run with it and look at the debug output (aka debug spew). This is generally the quickest way to debug this kind of problem.

-Jason


Yes app running with the debug runtime. The mesh is sphere with 40000 tris < D3DCAPS8.MaxPrimitiveCount but when call
DrawPrimitive() debug output tell: too many primitive count!.
Then I do many calls with VertBuff shift. dbgout is OK, but sphere is not whole. This work correct with D3DDEVTYPE_REF.
How can I avoid this because I really need hi-res meshes.

system: Radeon 8500 (Gigabyte) catalyst 02.2 winxp

thank You !
 
Last edited:
Well if your code is still what you copy+pasted, the 1st thing I notice wrong is that you have your > in the wrong direction in the 1st if. The ulNumTriangles should be < the max num.
 
Back
Top