DirectX performance problems

Started by
14 comments, last by DaJudge 19 years, 7 months ago
How many times do you call Draw[Indexed]Primitive? Are you sorting by material?

Nvidia has an excellent set of slides on finding the bottleneck(s) in your app here:

http://developer.nvidia.com/docs/IO/8230/GDC2003_PipelinePerformance.pdf

It gives you a nice step-by-step flowchart. I highly recommended just going through it.
Donavon KeithleyNo, Inky Death Vole!
Advertisement
Cool slides. Really helped a lot. I narrowed it down to a vertex transformation bottleneck (Dawn is a HUGE mesh) since it gets faster when I cut instructions there. But the shader (Cg) I am using is only doing transformation and per-vertex diffuse lighting so I can't see how to optimize that.
I am very confused since the Dawn demo itself runs nicely on my machine, so how can a simple diffuse rendering of the mesh be SO slow? Any ideas?

Cheers,
Alex
Alexander Stockinger
Programmer
Found a solution... They use multiple triangle strips for one object. Reducing DrawPrimitive() calls by connecting them with degenerate triangles boosts the performance to over 16fps (which is a start at least compared to 0.3fps)...

Next thing I'll try (once I get rid of those degenerate strips that currently come out of my code) is 32-byte aligning of the vertex data.

Cheers,
Alex
Alexander Stockinger
Programmer
You've probably got a bug in your rendering code so it does more work than it needs to. You should get well over 100fps without bones/textures.
Quote:Original post by DaJudge

Next thing I'll try (once I get rid of those degenerate strips that currently come out of my code) is 32-byte aligning of the vertex data.

Cheers,
Alex


That's probably half your problem. Put those vertices in video memory, not system memory.
You can safely do a DrawIndexedPrimitive for the triangle list, and one call per strip in each object. Just don't change state between them (at least until you texture it).
Tried to analyze it with the PIX tool but that can't seem to gather data from Dx8 applications. I can setup the experiment without problems and it also starts the application, but doesn't end on the specified condition (both frame-count or time dependant)...

Gonna try your ideas, thanks.
Alexander Stockinger
Programmer

This topic is closed to new replies.

Advertisement