Lack Of Performance: What might i by doing wrong?

Started by
24 comments, last by dave 18 years, 6 months ago
Any more ideas? The only reason i am nagging is because i don't have the internet at home and i only have a small window at uni.

thanks,

ace
Advertisement
Do you have a specific point at which the frame rate drops significantly? You said less quads run faster. Maybe it's something specific you do after 572 quads or something like that. I'd try looking for something more specific regarding the quads amount; maybe run 100 frames for every value of quads and collect some statistics.
Dubito, Cogito ergo sum.
Ok i will do, i'll plot it and see if the FPS curve looks right

ace
Maybe you are using the debug version of directx.
Or maybe you are using REF and not HAL.
Some other application like an anti-virus software could slow down your application or use so much memory that your program have to use virtual memory.
I can only benchmark with FRAPS when DirectX is running in Release and it is in HAL.

ace
Ace, you should really explain in more detail how you're doing things. Because I don't really understand it ^^ You say 1 vertex and 1 index buffer, but you don't rebuild it each frame ? If you don't rebuild it each frame, what's the use of the vector of structs ? (and what do you store in those structs ?) ?

Maybe with more details we will be able to point out something ^^
Well i have a primitivebase class, that has primtivequad inherit from it. The base class has a vector for the vertices and indices for the derrived primtives. The vertices and indices from these primitives (which incidentally will be different, for panels, cubes and other primitives) will be filled by the derrived primitive. So when the actual vertex buffers and index buffers are built, the vertices and indices are being taken from each primitive.

The vertex buffer and index buffer are only built once.

Understand? [smile]

ace
so, the only thing you do in the main loop (every frame) is
- setting the VB and IB as sources
- doing one DIP call for about 4000 tris
and get only 60 fps?
What hardware are you running this on?
A bit of a long-shot, but try running your application against the debug runtimes (maximum output) and see if it's complaining about something. Maybe it's emitting a warning saying that a particular part of your code isn't optimal usage...?

Typical examples of this (even though you indicate you're not changing buffers) is when the debug runtimes churn out 1000's of lines about resources being locked in the "wrong" pool and the "performance penalty could be severe"...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Not sure ^^ But that's probably due to my english skills (not so good ^^)
Well, let's forget about how it works in the detail. The last thing I can suggest is to check the parameters you used to create your buffers : using the wrong parameters can really influence performances. If you're creating the buffers only once (at loading time for instance) then create static buffers (usage : 0 and pool : managed if I remember well)

Then, you can also set the DirectX runtime to debug, and check the output in Visual. For example, it will tell you if your FVF is wrong for a given vertex buffer, or when you create a buffer with certain flags, it will warn you about performances issues. So set the debug runtime, run your app a few seconds, and check the debug output of Visual for any stuff like "Direct3D9: (WARN) : ...." or "Direct3D9: (ERROR) : ...."

I don't see anything else ... if you really have 1 buffer built once, no lock at runtime, I don't see why it runs so slow :/

Oh, and the thing I said about std::vector ... be carefull though. It can easilly become the bottleneck in an engine. I don't remember where I read something about that, but since then, I completely stopped using them ^^

This topic is closed to new replies.

Advertisement