SlimDX LockRectangle crashes sometimes

Started by
3 comments, last by juergen1969 15 years, 9 months ago
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
Advertisement
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?

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 ...
Are you using multiple threads and if so, do you have the appropriate locks in place?
@Steve
I changed to the actual driver and use the newest SlimDx. The one in my project was not the actual one.
I checked it several times and it seems that it's working.

@GoodFun
Yes, I have some Threads.
The first one to measure the data from a CCD-camera and another one for displaying the data

This topic is closed to new replies.

Advertisement