SlimDX LockRectangle crashes sometimes
Hi all,
I have a texture which I want to fill with a calculated bitmap.
To fill it is normally no problem. But I have to change the size of the texture sometimes very often.
First my code:
texture = new Texture(device, texWidth, texHeight, 0, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
SurfaceDescription descr = texture.GetLevelDescription(0);
DataRectangle dataRect = texture.LockRectangle(0, LockFlags.None);
if (dataRect != null)
{
//Generate From Bitmap
texture.UnlockRectangle(0);
}
Everything works fine, but after 3 or 4 size-changes of the texture I get an "Internal Error" and the PC reboots after a few seconds.
It fails at the LockRectangle command, that's the only thing I can check. After that I can do nothing else than wait.
I use SlimDX but I think it's not a problem of that library.
Any idea?
Best regards,
Jürgen
Anything that goes so spectacularly wrong that it crashes the PC (It'll be doing a blue screen of death but immediately rebooting probably) is almost certainly a driver bug. No user-mode code should be capable of doing anything like that.
Make sure you have the latest graphics drivers for your card.
Why you say "after 3 or 4 size-changes of the texture", do you mean after releasing and re-creating the texture with a different size?
Make sure you have the latest graphics drivers for your card.
Why you say "after 3 or 4 size-changes of the texture", do you mean after releasing and re-creating the texture with a different size?
I release the texture with
texture.Dispose();
texture = null;
I hope this is the correct way.
After that I recreate it with the new size.
I will check it with a new driver ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement