Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Wicked Ewok

90 calls drawprimitive@3 verts each, == 33 fps on GF3! 49 on GF4ti 4200

This topic is 5329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

90 calls drawprimitive@3 verts each, == 33 fps on GF3! 49 on GF4ti 4200 here's what I'm doing: >Fill a static VB with 3 verts >loop through . >setstreamsource for that VB . >settexture . >set fixed function pipeline( fvf ) . >loop through 90 times . . >call drawprimitive on that ONE static VB >repeat the stats I got are above. It doesn't seem right to me. The texture is dxt3 64x64 mode, changing it to 512x512 doesn't matter either. How is the drawprimitive overhead THAT expensive! You're supposed to be able to call it less 90 times on huge VBs with around what I'm getting with 3 vertices for this VB. Does it have to do with me recalling drawprimitive to the same portion of the VB 90 times? The pseudo-code above is precise to what I'm doing in the code. Any thoughts? thanks -Marv [edited by - Wicked Ewok on February 22, 2004 10:41:15 PM] [edited by - Wicked Ewok on February 22, 2004 10:42:27 PM]

Share this post


Link to post
Share on other sites
Advertisement
Profile your code. It's very likely not the the DrawPrimitive() call that's slowing things down. Find out what is.

EDIT: Also make sure you're not using the reference device.

[edited by - glassJAw on February 22, 2004 10:47:03 PM]

Share this post


Link to post
Share on other sites
But I'm sure it is...It runs at 450 fps if I render one VB. Here's a snippet...I still don't know how to paste snippets correctly, such shame:

for( k = 0; k < k_size; k++ )
{
TextureBatch * texbatch = CurShaderBatch->_tBatch.GetPrev();
//set the base texture:
_pD3DDevice->SetTexture(0, _TextureManager->GetTexture( texbatch->_tex ) );
//loop through stack:
while( texbatch->_sVB.empty() == false )
{
CasperVertexBuffer * vb = texbatch->_sVB.top();
vb->SetOtherTextures( _pD3DDevice, _TextureManager );
vb->ApplyRenderState();
_pD3DDevice->DrawPrimitive( vb->GetPrimitiveType(), vb->GetOffset(),
vb->GetNumTriangles() );
texbatch->_sVB.pop();

}

}



now all I do is edit the while( stack.empty() == false ) to while(stack.empty() == false && somenumber++ < 90 ) and it chugs..I further loop everything in that while loop( the renderstate setting and the texture setting) to 90 without looping the drawprimitive again, and it comes out the same. Only the 90 affecting the drawprimitive the one that affects it so drastically.

[edited by - Wicked Ewok on February 22, 2004 10:54:02 PM]

Share this post


Link to post
Share on other sites
Does that repeat include filling the buffer...? Are you using software or hardware transformations? Are you looking at the debug output to see if there''s anything weird going on?

Share this post


Link to post
Share on other sites
Just profiled it..it''s definately a display driver overhead. I''m getting around 85% processing in the display driver:

3202 Samples of a ''salc'' instruction( what does that mean? )
and 1661 samples of some pointer moving:
movsb es:[edi],ds:[esi]

does that mean anything to anyone?

Share this post


Link to post
Share on other sites
here''s a synopsis of what I''ve discovered about vb rendering:

- don''t render the same batch of information using the same VB twice, don''t call drawprimitive twice on the same set of data! even if it''s only 3 vertices, there''s a lot of overhead from the renderer using that data and then reseting it up again..damn odd reason.
- draw each vertex in a vb only once

So here''s what I did before:
created a static VB of 126 vertices size, set to TriangleList
and repeatedly called DrawPrimitive on it 90 times, results:

~1 FPS

here''s what I did after:
created 90 static VBs of 126 vertices in size
called all of them once

~30 FPS

to humor myself, I used the same code in the latter experiment and instead of calling 90 drawprimitives, each associated with its own VB, I called the 90 using just the first VB[0]:
~1 FPS

I would like to know exactly what goes on here. Is it really that the renderer has a hard time re-reading a part of a VB?

Share this post


Link to post
Share on other sites
Sort of solved the issue already if you read the last post. But to make it a little more clear, I was rendering the same VB 90 times, that was what was wrong with it. The solution was to make 90 VBs and call each of them once.

Share this post


Link to post
Share on other sites
Better yet, have one vb and one index buffer. Render the vb and index buffer once, but in the index buffer repeat your triangles.

------------
- outRider -

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!