Jump to content


Why create depth stencil texture failed?


4 replies to this topic

#1 coollofty

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 February 2007 - 05:48 AM

m_pDevice->CreateTexture(1024, 1024, 1, D3DUSAGE_DEPTHSTENCIL, D3DFMT_D24S8, D3DPOOL_DEFAULT, &m_pTexture, NULL);

I use upper code to create a depth stencil texture, at that time, the back buffer size is 800*600, depth stencil format is D3DFMT_D24S8. This code works very well on any NV cards(I tested much NV cards) but works bad on my ATI card. I dont know the result on other ATI cards becase I only have one ATI card(X1300 256MB) for test.

so, my question is : Why create depth stencil texture failed on ATI card but succeeded on NV card by the same code?

#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 27 February 2007 - 12:39 PM

What does the function return, and what does the runtime output in the 'Output' pane during debugging? This might give you a hint to your problem.
"Stupid bug! You go squish now!!" - Homer Simpson

#3 coollofty

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 February 2007 - 02:45 PM

The function return is "invalid call", and the debugging message is: invalid format specialed for create texture

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5305 posts
  • LocationBellevue, WA

Posted 27 February 2007 - 03:43 PM

Have you checked the CAPS? Could be the ATI card just doesn't support the depth-stencil format.
reedbeta.com - developer blog, OpenGL demos, and other projects

#5 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 27 February 2007 - 08:45 PM

Perhaps IDirect3DDevice9::CreateDepthStencilSurface is better suited for your needs :)
"Stupid bug! You go squish now!!" - Homer Simpson





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users