Weird Dynamic VertexBuffer Problem

Started by
12 comments, last by Draigan 21 years, 6 months ago
When you call Lock() with the NOOVERWRITE flag, are you locking the whole buffer, or just the precise area you are about to write to? If you use this flag to lock an area that the GPU is trying to use, you''ll cause a stall.

You should also avoid using that 40 byte vertex format if you can. They don''t fit nicely onto the GPU''s cache lines, and can have a sizeable impact on your performance. See http://developer.nvidia.com/view.asp?IO=Vertex_Buffer_Statistics for more details.

Finally, are you filling your vertex components in the order they are stored in memory? You said that you created the vertex buffer with the WRITEONLY flag, which should ensure that it is placed in AGP memory ( assuming you didn''t also specify the SYSTEMMEMORY flag ( ick ) ). Non-sequential writes to AGP memory can be pretty slow.
- Kikuchiyo
Advertisement
Okay, I''m going to ask a stupid question, but I''m just trying to be thorough: you mentioned that you created your VB with the D3DUSAGE_WRITEONLY flag. Did you OR this flag with the D3DUSAGE_DYNAMIC flag?

--Hoozit.
----------------------Check out my game demo and resume at www.fivestory.com/projects/game.
yeah, I OR''d the WRITEONLY and DYNAMIC flags. And I use the dynamic vertex buffer headers from Nvidia to test... I don''t read from the VB and I use NOOVERWRITE and DISCARD in the correct way.

If I change it to use a static vertex buffer, I get a major speed increase. I don''t get no-where near the 70% performance that dynaVB''s are supposed to give. In fact, it seems that filling the vertex buffer is my slow point. I can''t seem to get much more than 100 megs/s bandwidth even though my card is AGP4x so it should get 1000Mgs/s

I get roughly the same speeds on a GeForce2MX and GeForce4 Ti which means it''s not fillrate or triangle rate

And it''s not processor because the GeForce2Mx is running on a Celeron 850 and the Ti is on a P4-2.4Ghz Northwood with a 533-Bus.

I''m using Win2K and SP3 on both machines. Think that causes any problems?
As I said, you are getting a warning that a Win2000-specific workaround is being used. So it is important to test on a non-Win2000 system. If it runs well, then you know your problem is Win2000-specific.

~CGameProgrammer( );
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement