Optimisations...

Started by
1 comment, last by GameDev.net 19 years, 3 months ago
Hello. I am trying to speed up my program slightly and I have a question... Which is faster, locking a vertex buffer, writing four vertices to it, and then unlocking it... or changing the stream source? Thanks in advance for any help. Mark Coleman
Advertisement
That depends on the vertex buffer.

If you have one big vertex buffer that's streaming, and you lock a previously un-written area with NOOVERWRITE (and DISCARD at the end), the lock-write-unlock MIGHT have a chance of being faster. Locking any other kind of buffer is likely to stall the GPU in a way that simply setting the stream source won't.
enum Bool { True, False, FileNotFound };
Changing your stream would probably be a little faster. But I don't think it's there you are losing your time in the application.

Try to use a timing tool to find where the really big losses occur. I think you will find that there are 2-3 really big time consuming functions.

This topic is closed to new replies.

Advertisement