D3D8: Larger indexed vertex buffers slower??

Started by
4 comments, last by malachii 22 years, 10 months ago
I''m developing a triangle list class for my applications (it is in charge of vertex and index buffer allocation). The reason for this is that I wanted a class that would auto-draw when its memory became full. It seems to be working like a charm, but I noticed something VERY strange.... My app is currently drawing quads, (2 triangles), using triangle lists. I''m always drawing 4 vertices, and 6 indices to draw my quads (not the most efficient, but good enough for now). I figured with the flexibility of my triangle list class, I could enlarge the size of the buffer to suit the graphics card, and my app code would not change because the class auto-draws itself when the memory is full (of course, I have to force a draw-dump at the end to flush the buffers). Using SOFTARE vertex processing (I have a GeForce 2 MX), I was getting about 55 fps using 128 vertices and 128 indexes max in my class (it would auto-draw if more were requested, then start the next 128 again). When I switched to 1024 I got about 51 fps. When I switched to 4096 I got about 40 fps. What gives? This is not a huge vertex buffer, and I thought directX got faster if I had to call fewer lock/unlocks and less calls into DrawPrimitive? Any thoughts? I''m stumpted. If requested by email (greg@wadesoft.com) I will email you the class, and a quick usage example. It''s quite simple really.
Advertisement
Strange.
In my current work I used 2 set of VB/IB one for the map and one for the beziers curves.
The first take: 13978 vx/ 24279 ix
The second take: 20145 vx/ 102528 ix

If i disable the second, the framerate fall from 37 to 30 depending on the ratio of bezier in the view frustum.

There is huge vertex/index buffer ( maybe too too huge) and the framerate is quite good in my GeForce 1 (assuming the result you will probaly have for this size).

Maybe you need to have more static buffers (mines are totally static, lock/unlock only once) but this is not the current problem.

Try hardawre buffers. Maybe it will say why?

Why English rules?? C pas très malin tout ça!

Edited by - jesterlecodeur on June 24, 2001 3:25:11 PM
_______________
Jester, studient programmerThe Jester Home in French
It does seem very strange to me. I took my triangle list class (the one that manages the vertex and index buffers) out of my project, and created a simple D3D8 test application that uses is to draw 8000 random triangles per frame.

Anyhow, I've posted my source and 2 compiled versions, one with a 64 vertex buffer, and one with a 1024 vertex buffer. I should have made the large one larger. In win2k with debug version if DX, the 1024 version was a fair bit slower. However in win98 retail version of DX, they were about the same.

If you could try them out, and perhaps have a quick look at the simple source, I would appreciate it. I don't think I'm doing anything wrong at all. It's really very strange to me.

Thanks,

Greg.

http://www.wadesoft.com/files/triangletest.zip



Edited by - malachii on June 24, 2001 6:20:28 PM
I find nothing wrong.

But I see the result. The best on 256 index max.

DirectX say us that VB is good for 1000+ vertices ....
_______________
Jester, studient programmerThe Jester Home in French
Feel free to take the triangle list class for your own project. It is nice because you can set any number of vertices to draw with. Perhaps you could get a little more performance from your application by using smaller vertex buffers?

Thx. I will try w/ your class but I have many thing to improve before.
And I can''t understand why it work better w/ little buffer.


Why English rules?? C pas très malin tout ça!
_______________
Jester, studient programmerThe Jester Home in French

This topic is closed to new replies.

Advertisement