Odd Present Error
Ok, some of this is MDX but I'm gonna try to translate for you non-MDX guys...
On an old Video Card (NVidia GeForce 2 MX)... I know, I develope on dinosaurs to ensure game quality for a wider range of users.
So, here's what I do...
Create a texture...
oTexture = New Texture(moDevice, 32, 32, 1, Usage.None, Format.A8R8G8B8, Pool.Managed)
That works...
I then lock the rectangle to manipulate some bytes on my own...
Dim oStream As GraphicsStream = oTexture.LockRectangle(0, System.Drawing.Rectangle.Empty, LockFlags.Discard, lPitch)
I read my data, I set my data, I then unlock the rectangle...
Then, outside of my function that does all of this, I use a sprite to draw the texture onto the screen somewhere... and then I do a Present.
The Present Blows up giving me the following:
Unhandled Exception: Error in the application.
-2005530585 (D3DERR_DRIVERINTERNALERROR)
Why? I don't get this error if I don't enter the texture generation function. And it only seems to happen After the first call.
Thanks!
Do you have the latest drivers? Have you tried the debug runtimes? Does it work if you don't lock the texture? (EDIT: Just re-read your post [smile])
Internal driver errors are a Bad Thing, and it's unlikely that your application's at fault (Well, you might be doing something wrong, but D3D or the driver should have caught it).
Internal driver errors are a Bad Thing, and it's unlikely that your application's at fault (Well, you might be doing something wrong, but D3D or the driver should have caught it).
I'll run out and grab the latest drivers here in a second (just to be sure)...
but just testing things... I decided to try something.
In the function, I created the texture but only if it wasn't already created. If it was already created, I passed the New call... Now, I went back and test if it is a valid pointer, then I dispose it and remove the pointer. Then, I do a New on it again. Now, that worked (although, I took a large performance hit for it).
I can see the first frame with the texture drawn correctly... I'm almost 100% sure that the error occurs on the next frame that I try to update the texture that has already created.
Anyway, I'll check the drivers.
EDIT: Ok, reread this and came out a little unclear....
but just testing things... I decided to try something.
In the function, I created the texture but only if it wasn't already created. If it was already created, I passed the New call... Now, I went back and test if it is a valid pointer, then I dispose it and remove the pointer. Then, I do a New on it again. Now, that worked (although, I took a large performance hit for it).
I can see the first frame with the texture drawn correctly... I'm almost 100% sure that the error occurs on the next frame that I try to update the texture that has already created.
Anyway, I'll check the drivers.
EDIT: Ok, reread this and came out a little unclear....
'Currently it is like this and it doesn't workIf oTexture is Nothing Then oTexture = New Texture(moDevice, 32, 32, 1, Usage.None, Format.A8R8G8B8, Pool.Managed)End If'Did a test using this instead and it workedIf oTexture Is Nothing = False Then oTexture.Dispose() oTexture = NothingEnd ifoTexture = New Texture(moDevice, 32, 32, 1, Usage.None, Format.A8R8G8B8, Pool.Managed)
Try using the usage flag for dynamic. The driver might only like a single initial update when it's a non-dynamic texture.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement