mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Set correct number of depth bits and stencil bits for frame buffer format info.
This commit is contained in:
parent
c2afbcaac9
commit
cc0853e021
@ -767,12 +767,51 @@ create_screen_buffers_and_device(DXScreenData &display, bool force_16bpp_zbuffer
|
|||||||
PRINT_REFCNT(wdxdisplay9, _wcontext._d3d_device);
|
PRINT_REFCNT(wdxdisplay9, _wcontext._d3d_device);
|
||||||
|
|
||||||
if (presentation_params->EnableAutoDepthStencil) {
|
if (presentation_params->EnableAutoDepthStencil) {
|
||||||
_fb_properties.set_depth_bits(1);
|
int depth_bits;
|
||||||
if (IS_STENCIL_FORMAT(presentation_params->AutoDepthStencilFormat)) {
|
int stencil_bits;
|
||||||
_fb_properties.set_stencil_bits(1);
|
|
||||||
} else {
|
depth_bits = 1;
|
||||||
_fb_properties.set_stencil_bits(0);
|
stencil_bits = 0;
|
||||||
|
switch (presentation_params->AutoDepthStencilFormat)
|
||||||
|
{
|
||||||
|
case D3DFMT_D16_LOCKABLE:
|
||||||
|
depth_bits = 16;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D32:
|
||||||
|
depth_bits = 32;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D15S1:
|
||||||
|
depth_bits = 15;
|
||||||
|
stencil_bits = 1;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D24S8:
|
||||||
|
depth_bits = 24;
|
||||||
|
stencil_bits = 8;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D24X8:
|
||||||
|
depth_bits = 24;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D24X4S4:
|
||||||
|
depth_bits = 24;
|
||||||
|
stencil_bits = 4;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D32F_LOCKABLE:
|
||||||
|
depth_bits = 32;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D24FS8:
|
||||||
|
depth_bits = 24;
|
||||||
|
stencil_bits = 8;
|
||||||
|
break;
|
||||||
|
case D3DFMT_D16:
|
||||||
|
depth_bits = 16;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wdxdisplay9_cat.error() << "unknown depth stencil format " << presentation_params->AutoDepthStencilFormat;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_fb_properties.set_stencil_bits(stencil_bits);
|
||||||
|
_fb_properties.set_depth_bits(depth_bits);
|
||||||
} else {
|
} else {
|
||||||
_fb_properties.set_depth_bits(0);
|
_fb_properties.set_depth_bits(0);
|
||||||
_fb_properties.set_stencil_bits(0);
|
_fb_properties.set_stencil_bits(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user