Skip to main content
GameDev.net gamedev.net
🔒 Locked

DX persistent states?

Started by madiyaan Apr 10, 2007 at 5:23 PM 2 replies 800+ views
Original Post
madiyaan
madiyaan
Hello, I am seeing an issue in a DX tool I'm using which only appears after I run another application (which is also a DX application). I can use application A just fine 10 times. However, when I run application B and re-run application A, the issue appears. All further runs of application A also exhibit the same issue. My question is this: does DirectX keep some state or something that might be affecting subsequent runs of application A? I will post a screenshot of the issue I'm seeing as soon as I upload it. For now a text description is this: There appears to be a few cracks in the screen (diagonal cracks). A few cracks are wide (as in 50 pixels or so) this issue only appears when a certain shader is running. When it runs, the screen looks like a broken mirror. :-S Thanks, [EDIT1] I just want to know if DirectX keeps some states persistent across applications even after the application terminates.
a h31p1355 n00b
jollyjeffers
jollyjeffers
Quote:
Original post by Namethatnobodyelsetook
It shouldn't. It's probably a driver bug.
I concur - have you tried running your applications using the reference rasterizer? If you suspect the hardware/driver of being wrong you can usually verify it if the RefRast works as expected...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
S1CA
S1CA
Render states should be reset to default for each D3D device. If you're using a PURE device, do it yourself - drivers sometimes do the wrong thing...


The other (and possibly more likely) alternative explanation is one or both of the applications is using a surface, texture or other resource without having cleared it or set its content to some known state.

Video memory doesn't get cleared when you create a resource, so you get whatever was there previously (random crap, the last frame of the previously running app, etc)


For example:

- app A renders a 3D scene and uses Z buffering, it clears and writes to the Z buffer and colour buffer every frame. When app A is terminated, the memory used by the Z buffer still contains the final frame Z buffer.

- app B renders a 3D scene and uses Z buffering, it clears and writes to the colour buffer every frame but the programmer forgot to clear the Z buffer so the Z seen in app B also contains stuff from app A.

- if app B has different allocation sizes or orders than app A, then what's in app B's Z buffer could be anything - app A's frame buffer, one of app A's textures, one of app A's index buffers, or even just random uninitialised memory....


Using the debug runtime will help you eliminate some of these possibilities.
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.