Sign in to follow this  

DX9 Vertex Caching problem?

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm adding an abstraction layer to my graphics calls, to allow for easy of portability later on. I'm having a problem however with my primitivies being rendered. If i define a static array of verticies, then my primitive draws every time. But for some reason, if I use the dynamic way (that is, passing the vert locations into a function, and appending them onto the array) the data will render as expected, however 5 mintues later, i can re-run the app, and the data will no longer be visible. I'm wondering if this has to do with some wierd DX vert caching? Has anyone else ran into this?

Share this post


Link to post
Share on other sites
I fear that I don't understand the problem. Anyway, regarding caching:
- DX doesn't cache vertices across processes
- Modern hardware caches somewhere around 16 vertices (12-24, I think, depending on the hardware) when using indexed primitives in rendering. The caching doesn't persist across DIP calls, AFAIK.

Share this post


Link to post
Share on other sites
When filling the dynamic vb, try using *only* the NOOVERWRITE flag and then *only* the DISCARD flag. If the problem is still there when using only DISCAR/NOOVERWRITE then I'm stumped. If using one or the other exclusively makes the problem go away, then I'm guessing you might have some vertex buffer filling up logic problems. Cause this happened to me once. I was using the NOVERWRITE and DISCARD flags together depending on if the buffer was full/had space, and this was happening to me, the object would just not render sometimes.

Then I changed my lock flags to (most probably) DISCARD and only used that, and the problem went away. So I messed around with my filling logic a bit and got it right after that.

There's no point sprites sample in the 9c sdk, that had a really nice example of flags usage. Anyway, you can check in the docs:

DirectX Graphics -> Programming Guide -> Programming Tips -> Performace Optimizations

and scroll down a bit to see the dynamic buffers section

Share this post


Link to post
Share on other sites

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this