mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[d3d9] Mark presenter for recreation on device reset with deferSurfaceCreation
This commit is contained in:
parent
f0ff0007dc
commit
4d974685c9
@ -482,6 +482,9 @@ namespace dxvk {
|
||||
Flush();
|
||||
SynchronizeCsThread(DxvkCsThread::SynchronizeAll);
|
||||
|
||||
if (m_d3d9Options.deferSurfaceCreation)
|
||||
m_deviceHasBeenReset = true;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
@ -1033,6 +1033,12 @@ namespace dxvk {
|
||||
bool CanSWVP() const {
|
||||
return m_behaviorFlags & (D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_SOFTWARE_VERTEXPROCESSING);
|
||||
}
|
||||
|
||||
// Device Reset detection for D3D9SwapChainEx::Present
|
||||
bool IsDeviceReset() {
|
||||
return std::exchange(m_deviceHasBeenReset, false);
|
||||
}
|
||||
|
||||
void DetermineConstantLayouts(bool canSWVP);
|
||||
|
||||
D3D9BufferSlice AllocUPBuffer(VkDeviceSize size);
|
||||
@ -1337,6 +1343,7 @@ namespace dxvk {
|
||||
VkImageLayout m_hazardLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
bool m_usingGraphicsPipelines = false;
|
||||
bool m_deviceHasBeenReset = false;
|
||||
|
||||
DxvkDepthBiasRepresentation m_depthBiasRepresentation = { VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORMAT_EXT, false };
|
||||
float m_depthBiasScale = 0.0f;
|
||||
|
@ -147,6 +147,8 @@ namespace dxvk {
|
||||
bool recreate = false;
|
||||
recreate |= m_wctx->presenter == nullptr;
|
||||
recreate |= m_dialog != m_lastDialog;
|
||||
if (options->deferSurfaceCreation)
|
||||
recreate |= m_parent->IsDeviceReset();
|
||||
|
||||
if (m_wctx->presenter != nullptr) {
|
||||
m_dirty |= m_wctx->presenter->setSyncInterval(presentInterval) != VK_SUCCESS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user