Jump to content
  • Advertisement
Sign in to follow this  

Pixel shader debugger won't work

This topic is 4337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a code that initialize a offscreen plain surface in system memory. Everything works fine in normal mode but when I change to pixel shader debug mode I get the error message "D3DERR_INVALIDCALL". Anyone who has any clue of what to do, seams to me as a bug in the software emulator? Makes it hard for me to fix my logical errors.
descNormal=*pBackBufferSurfaceDesc;
descNormal.Height *= NORMAL_MAP_FRACTION;
descNormal.Width *= NORMAL_MAP_FRACTION;
V(pd3dDevice->CreateOffscreenPlainSurface(descNormal.Width, descNormal.Height, descNormal.Format, D3DPOOL_SYSTEMMEM, &g_pNormalSurface,NULL));// Works fine
V(pd3dDevice->CreateRenderTarget(descNormal.Width, descNormal.Height, D3DFMT_R32F, descNormal.MultiSampleType, descNormal.MultiSampleQuality, FALSE, &g_pTempDepthSurface, NULL));// Works fine
V(pd3dDevice->CreateOffscreenPlainSurface(descNormal.Width, descNormal.Height, D3DFMT_R32F, D3DPOOL_SYSTEMMEM, &g_pDepthSurface, NULL));// Don't work!


Share this post


Link to post
Share on other sites
Advertisement
Use the debug Direct3D runtime and look at your debuggers output window - D3D will output the reason for the error to there.

Share this post


Link to post
Share on other sites
Quote:
when I change to pixel shader debug mode
I'm not quite sure what you mean by this? Do you mean the regular debug runtimes or the "Start with D3D debugging" menu option in VStudio?

I can understand the debug runtimes rejecting a call to CreateOffscreenPlainSurface(), but there isn't anything specific to pixel shaders (or shading) there?!

What do the debug runtimes say? They're very good at elaborating on why a particular call fails. Chances are you're passing an invalid combination of parameters; if it works in normal retail mode then its usually a sign that the driver is less strict about checking (which is convenient but a little annoying)...

One last thing, you're creating a g_pDepthSurface but you're not using CreateDepthStencilSurface() - any particular reason? Note that you'll need the RT and DS to have matching multisample properties in order to use them.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
when I change to pixel shader debug mode
I'm not quite sure what you mean by this? Do you mean the regular debug runtimes or the "Start with D3D debugging" menu option in VStudio?

I mean that I set the flag #define DEBUG_PS then the line V(pd3dDevice->CreateOffscreenPlainSurface(descNormal.Width,descNormal.Height,D3DFMT_R32F,D3DPOOL_SYSTEMMEM,
&g_pDepthSurface,NULL));
stops working.
Quote:
One last thing, you're creating a g_pDepthSurface but you're not using CreateDepthStencilSurface() - any particular reason? Note that you'll need the RT and DS to have matching multisample properties in order to use them.
I was trying whit CreateDepthStencilSurface() at first but my card did'nt support D3DFMT_D16_LOCKABLE and I nead to CPU-read my depth buffer.

[Edited by - Xmon on July 6, 2006 8:07:29 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Xmon
I mean that I set the flag #define DEBUG_PS then the line V(pd3dDevice->CreateOffscreenPlainSurface(descNormal.Width,descNormal.Height,D3DFMT_R32F,D3DPOOL_SYSTEMMEM,
&g_pDepthSurface,NULL));
stops working.
DEBUG_PS forces the reference rasterizer which doesn't support R32F surfaces. Call fails.

I had a similar problem when I was debugging some of my HDRI code a while back - it wasn't possible to pull back luminance values via GetRenderTargetData() as the RefRast cannot create FP16/FP32 surfaces.

The reference rasterizer only supports the basic 32bit/16bit integer formats for plain surfaces - check the DirectX Caps Viewer for details, or even better - implement proper enumeration/capabilities checking [wink]

Quote:
Original post by Xmon
I nead to CPU-read my depth buffer.
I dont think you'll be able to use a D3DFMT_R32F texture in a later SetDepthStencilSurface() call. Might be easier just to do the shadow-mapping method and use a render-target depth map and then pull that data back across. Although, having said that, you'll still hit the aforementioned RefRast problem.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!