dxgsg9: fix problems with window without depth buffer

This commit is contained in:
rdb 2018-10-08 22:11:55 +02:00
parent 93a3e7e699
commit 96860b88e0
2 changed files with 6 additions and 3 deletions

View File

@ -799,9 +799,9 @@ clear(DrawableRegion *clearable) {
main_flags |= D3DCLEAR_TARGET;
}
if (clearable->get_clear_depth_active()) {
if (clearable->get_clear_depth_active() &&
_screen->_presentation_params.EnableAutoDepthStencil) {
aux_flags |= D3DCLEAR_ZBUFFER;
nassertv(_screen->_presentation_params.EnableAutoDepthStencil);
}
if (clearable->get_clear_stencil_active()) {

View File

@ -1229,7 +1229,10 @@ init_resized_window() {
DWORD flags;
D3DCOLOR clear_color;
flags = D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER;
flags = D3DCLEAR_TARGET;
if (_fb_properties.get_depth_bits() > 0) {
flags |= D3DCLEAR_ZBUFFER;
}
clear_color = 0x00000000;
hr = _wcontext._d3d_device-> Clear (0, nullptr, flags, clear_color, 0.0f, 0);
if (FAILED(hr)) {