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!
Pixel shader debugger won't work
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.
Use the debug Direct3D runtime and look at your debuggers output window - D3D will output the reason for the error to there.
Quote:when I change to pixel shader debug modeI'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
Quote:Original post by jollyjeffersQuote:when I change to pixel shader debug modeI'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]
Quote:Original post by XmonDEBUG_PS forces the reference rasterizer which doesn't support R32F surfaces. Call fails.
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.
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 XmonI 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.
I nead to CPU-read my depth buffer.
hth
Jack
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement