• Advertisement
Sign in to follow this  

Failed to lock driver mip-map surface

This topic is 2526 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

Hi forum,

[font="Verdana, Arial, Helvetica, sans-serif"]I have a Dell Precision 380 with a FireGL v3100 graphics card which is giving a "Failed to lock driver mip-map surface" error when attempting to lock a texture. This behavior is only seen on Windows XP with this particular machine (Windows Vista and Windows 7 work fine). Any clue as to why this could be happening?[/font]
[font="Verdana, Arial, Helvetica, sans-serif"] [/font]
[font="Verdana, Arial, Helvetica, sans-serif"]Thanks![/font]

Share this post


Link to post
Share on other sites
Advertisement
Your texture was created in D3DPOOL_DEFAULT without D3DUSAGE_DYNAMIC; all explained in the documentation for IDirect3DTexture9::LockRect. ;) Why does it work on Vista and 7, but not on XP? Check your code; are you creating an IDirect3DDevice9Ex on those platforms?

Share this post


Link to post
Share on other sites
Thanks for the reply!

Here's how I am creating this texture:


D3DXCreateTexture(_d3ddev9, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_L8, D3DPOOL_DEFAULT , &_yTex);

Here's how I am locking this texture:

_yTex->LockRect(0,&_yLockedRect,NULL,D3DLOCK_DISCARD);

Yes, I am using direct3d9 extended if supported. Are there other reasons why I would get that message?

Thanks for the help!

Share this post


Link to post
Share on other sites
I don't use D3DXCreateTexture myself, but I do know from the SDK description of it that:
Internally, D3DXCreateTexture uses D3DXCheckTextureRequirements to adjust the calling parameters.[/quote]
So - and I'm guessing here - my guess is that D3DXCreateTexture for some reason gave you a non-dynamic texture; perhaps because your hardware doesn't support dynamic textures (although D3DUSAGE_DYNAMIC isn't listed as a valid usage type for D3DXCheckTextureRequirements...) You can run your program in PIX, drill down into your D3DXCreateTexture call, and see what parameters it passes to the underlying IDirect3DDevice9::CreateTexture call to double-check what's going on.

Check your D3DCAPS2 for D3DCAPS2_DYNAMICTEXTURES or alternatively why not just create it in D3DPOOL_MANAGED?

Share this post


Link to post
Share on other sites
After a drill down using PIX I searched for all instances of IDirect3DDevice9::CreateTexture and all of them report that D3DXCreateTexture passed in D3DUSAGE_DYNAMIC with D3DPOOL_DEFAULT.


Here is my code for checking whether or not the hardware supports dynamic textures:



bool IsSupported(...)
{
D3DCAPS9 d3dCaps;
ZeroMemory(&d3dCaps, sizeof(d3dCaps));

if(d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&d3dCaps) != D3D_OK)
return false;

if(!(d3dCaps.Caps2 & D3DCAPS2_DYNAMICTEXTURES))
return false;

return true;
}



The above code always returns true. What else could I look for?

Thanks for your help!!

Share this post


Link to post
Share on other sites
I suppose the next step is to tighten up your capabilities checking. I always like to create a resource with the desired parameters, lock it if necessary, then unlock it, checking the HRESULTS all the way, as an additional layer of checking before reporting that something is supported. Maybe try creating a 256x256 dynamic texture using IDirect3DDevice9::CreateTexture instead of D3DXCreateTexture?

Share this post


Link to post
Share on other sites
It looks as if this was a driver issue. The box had a very old driver installed from the dell support website; using an updated driver fixed the texture locking problem.

Thanks for everyone's help!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement