Sign in to follow this  
errantkid

Problem updating vertex textures (lock/unlock)

Recommended Posts

I've got a vertex texture that I'm trying to update from the cpu. I create the texture Texture pool: D3DPOOL_MANAGED Texture format: D3DFMT_R32F No mipmaps Then for updating the texture it's a (relatively) simple case of
pD3DTexture->LockRect(uMipLevel, &LockedRect, NULL, D3DLOCK_NO_DIRTY_UPDATE);
pD3DTexture->UnlockRect(uMipLevel);
The vertex shader is a regular HLSL vs_3_0 .fx shader This all works fine until I've created the shader and started rendering at which point updating the texture no longer has any effect. Am I missing some flag? I've been looking everywhere to try and find an answer.

Share this post


Link to post
Share on other sites
You do lock at least once without the D3DLOCK_NO_DIRTY_UPDATE flag, right? Using that flag means "I don't want you to mark this texture as needing uploaded to the GPU" (More or less) - so if you lock with that flag, the texture won't be getting marked as dirty, so won't be getting uploaded to the GPU, so won't be getting changed.

Share this post


Link to post
Share on other sites
Ah! I figured out...
Thanks evil, it did indeed have to do with the dirty rect. Unfortunately the problem was between the chair and the keyboard originating from a silly misunderstanding of our engine's API. Thank you for the help!

Share this post


Link to post
Share on other sites

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