Sign in to follow this  
Andiadm

BSOD Infinite Loop on ATI Mobility Radeon with huge Geometry

Recommended Posts

This is my first post here, so forgive me if I doing something wrong: I am trying to render a Scene with Stencil Shadowing on D3D9 and an ATI Mobility Radeon 3450 (not the best card, but programmers should have old cards so that their code runs well ..) The Scene has 8 Lights that trow shadows, and so there are 17 total rendering passes (once ambient lighing, then Shadows to Stencil and Geometry for each Light). That results in a total of 5.7 Million Faces to be rendered, 1.5 Million for the Geometry and 4.2 Million for the Shadows to the Stencil Buffer. The Shadow Faces are precalculated and stores in Meshes created with the D3DXMESH_MANAGED flag. When I now render the scene the 2nd or 4rd time (as the camera moves), I get a blue screen of death stating that the ATI driver (newest Catalyst 9.4) went into an infinite loop. My guessing was - and this is the first question - that the CPU is way ahead the GPU and fires and fires Faces as well as State changes and somewhere the sync between GPU and CPU is lost. Can that be? Is that me or a buggy driver? I then instered the following code right after rendering the Shadow Faces to the stencil buffer:
 if (d3ddev->CreateQuery(D3DQUERYTYPE_EVENT,&pQuery)==D3D_OK) 
 {
  pQuery->Issue(D3DISSUE_END); 
  while (S_FALSE == pQuery->GetData( NULL, 0, D3DGETDATA_FLUSH )) 
   Sleep(1); 
  pQuery->Release(); 
 } 
 ..
 ..
 d3ddev->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE,FALSE);
 

Basically, instructing the CPU to wait with the change of the Rendering states and the rendering of the Geometry until the GPU is done. That removed the BSODs. Is that normal or is there a more clever way to handle this situation, this being the second question. Despite of checking all HRESULTS of the D3D calls, I didnot find a way to intercept something, not even using the debug DLLs. Yes, of course, reducing the geometry would help as well but we are talking about an interactice simulation software where the User can create the Scenes themselves, not a Game ... Thanks a lot! Andreas

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