Sign in to follow this  
radioactiveman19

Failed to lock driver mip-map surface

Recommended Posts

Hi forum,

[font="Verdana, Arial, Helvetica, sans-serif"][size="2"]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?[/size][/font]
[font="Verdana, Arial, Helvetica, sans-serif"] [/font]
[font="Verdana, Arial, Helvetica, sans-serif"][size="2"]Thanks![/size][/font]

Share this post


Link to post
Share on other sites
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:


[code]D3DXCreateTexture(_d3ddev9, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_L8, D3DPOOL_DEFAULT , &_yTex);[/code]

Here's how I am locking this texture:

[code]_yTex->LockRect(0,&_yLockedRect,NULL,D3DLOCK_DISCARD);[/code]

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:[quote]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:


[code]
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;
}
[/code]


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's possible this is a driver related issue. A quick check on [url="http://support.amd.com/us/gpudownload/fire/Legacy/Pages/fire_xp.aspx?type=2.4.3&product=2.4.3.3.2.3.14&lang=English"]ATI's Web Site[/url] suggests it's not fully supported any more with the latest drivers having been released in 2009.

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