Jump to content
  • Advertisement
Sign in to follow this  
duhroach

DX9 Vertex Caching problem?

This topic is 5171 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!