Simple Index buffer question..

Started by
2 comments, last by DumpAlien 16 years, 4 months ago
Hello there again! I have a simple question... Lets say I have some vertex buffers with object geometry... Is it better to call IASetIndexBuffer() before any draw call or should I use offsets in one big index buffer? so i will set the index buffer once? /me is using D3D10 thanks for your time!
Advertisement
Reducing state switching is a good thing, but distorting your software design to minimize state changes is a bit too far. At least with Direct3D 10 where the overhead of such calls is a lot better than with Direct3D 9.

Get it right, then get it tight - ideally optimization won't affect the correctness of your code [smile]

Jack

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

If you find yourself already designing a new system and needing to group buffers together for related objects, then it would make sense. Otherwise, it's like giving everyone on the same street one vehicle. It's better for the environment, but it's awkward and inconvenient to everyone who needs to use it.

Okay, bad analogy. Nature is a little more precious than rendering optimizations. The point is that graphics cards and CPUs will keep improving, but your engine's awkward design to take advantage of something trivial will remain constant.
thanks for your replies guys :D I will do it first with setting index buffer before every call.. and maybe in the future change it for optimization!
thanks again!

This topic is closed to new replies.

Advertisement