BOOL IsDepthFormatOk( D3DFORMAT DepthFormat, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat ) { // Verify that the depth format exists. HRESULT hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, AdapterFormat, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, DepthFormat); if( FAILED( hr ) ) return FALSE; // Verify that the depth format is compatible. hr = pD3D->CheckDepthStencilMatch( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, AdapterFormat, BackBufferFormat, DepthFormat); return SUCCEEDED( hr );}Log with CATALYST 4.3:gfx.Desktop width: 1024gfx.Desktop height: 768gfx.Desktop format: X8R8G8B8gfx.1 graphics adapter(s) available====gfx.Adapter: 0gfx.Driver: ati2dvag.dllgfx.Description: RADEON 8500 SERIESgfx.Version: 6.14.10.6430gfx.VendorID: 00001002gfx.DeviceID: 0000514Cgfx.SubSysID: 013A1002gfx.Revision: 00000000gfx.SubSysID: 013A1002gfx.Can render in windowed mode: Yesgfx.Allow source blending with source alpha: Yesgfx.Allow destination blending with inverse source alpha: Yesgfx.Allow alpha channel in textures: Yesgfx.Max texture size: 2048 x 2048gfx.Max texture aspect ratio: 2048gfx.Max primitive count: 65535gfx.Max vertex index: 16777215====gfx.CreateFullscreenDevice(1024, 768, 32)gfx.Back buffer pixel format: Unknown formatgfx.Couldn't find suitable format for depth bufferFailed to create a fullscreen device. Your video card may not support the requested resolution.
It seems that you don't do the CheckDeviceFormat() -test for the depth formats. Try adding that and/or make it possible for the user to be able to force the format to be whatever he wants.
Yet, this is still strange as I have used D3DFMT_D32 myself sometimes and the driver is set up to support 32-bit Z-buffer. Hmm... looks like I have somewhat obsolete drivers, though (4.2). Maybe I should try with the new drivers first.
EDIT: Installed CATALYST 4.3 drivers; doesn't work but the log changed a bit. I inserted it after the code sample above.
[edited by - nonpop on March 15, 2004 10:53:56 AM]