mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Always reset the device.
This commit is contained in:
parent
56724b87ff
commit
35155eae5c
@ -3534,7 +3534,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params,
|
|||||||
// we have to reset the device before creating new swapchain.
|
// we have to reset the device before creating new swapchain.
|
||||||
// inorder to reset properly, we need to release all swapchains
|
// inorder to reset properly, we need to release all swapchains
|
||||||
|
|
||||||
if (!(_screen->_swap_chain)
|
if (true || !(_screen->_swap_chain)
|
||||||
|| (_presentation_reset.BackBufferWidth < presentation_params->BackBufferWidth)
|
|| (_presentation_reset.BackBufferWidth < presentation_params->BackBufferWidth)
|
||||||
|| (_presentation_reset.BackBufferHeight < presentation_params->BackBufferHeight)) {
|
|| (_presentation_reset.BackBufferHeight < presentation_params->BackBufferHeight)) {
|
||||||
if (wdxdisplay8_cat.is_debug()) {
|
if (wdxdisplay8_cat.is_debug()) {
|
||||||
@ -3592,6 +3592,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this -> mark_new();
|
||||||
hr = _d3d_device->Reset(&_presentation_reset);
|
hr = _d3d_device->Reset(&_presentation_reset);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
@ -3670,6 +3671,9 @@ check_cooperative_level() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case D3DERR_DEVICELOST:
|
case D3DERR_DEVICELOST:
|
||||||
|
// sleep while the device is lost to free up the CPU
|
||||||
|
Sleep (10);
|
||||||
|
|
||||||
if (SUCCEEDED(_last_testcooplevel_result)) {
|
if (SUCCEEDED(_last_testcooplevel_result)) {
|
||||||
if (_dx_is_ready) {
|
if (_dx_is_ready) {
|
||||||
_dx_is_ready = false;
|
_dx_is_ready = false;
|
||||||
|
@ -4812,7 +4812,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params,
|
|||||||
// we have to reset the device before creating new swapchain.
|
// we have to reset the device before creating new swapchain.
|
||||||
// inorder to reset properly, we need to release all swapchains
|
// inorder to reset properly, we need to release all swapchains
|
||||||
|
|
||||||
if (!(_screen->_swap_chain)
|
if (true || !(_screen->_swap_chain)
|
||||||
|| (_presentation_reset.BackBufferWidth < presentation_params->BackBufferWidth)
|
|| (_presentation_reset.BackBufferWidth < presentation_params->BackBufferWidth)
|
||||||
|| (_presentation_reset.BackBufferHeight < presentation_params->BackBufferHeight)) {
|
|| (_presentation_reset.BackBufferHeight < presentation_params->BackBufferHeight)) {
|
||||||
if (wdxdisplay9_cat.is_debug()) {
|
if (wdxdisplay9_cat.is_debug()) {
|
||||||
@ -4869,6 +4869,7 @@ reset_d3d_device(D3DPRESENT_PARAMETERS *presentation_params,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this -> mark_new();
|
||||||
hr = _d3d_device->Reset(&_presentation_reset);
|
hr = _d3d_device->Reset(&_presentation_reset);
|
||||||
if (FAILED(hr) && hr != D3DERR_DEVICELOST) {
|
if (FAILED(hr) && hr != D3DERR_DEVICELOST) {
|
||||||
return hr;
|
return hr;
|
||||||
@ -4951,6 +4952,9 @@ check_cooperative_level() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case D3DERR_DEVICELOST:
|
case D3DERR_DEVICELOST:
|
||||||
|
// sleep while the device is lost to free up the CPU
|
||||||
|
Sleep (10);
|
||||||
|
|
||||||
if (SUCCEEDED(_last_testcooplevel_result)) {
|
if (SUCCEEDED(_last_testcooplevel_result)) {
|
||||||
if (_dx_is_ready) {
|
if (_dx_is_ready) {
|
||||||
_dx_is_ready = false;
|
_dx_is_ready = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user