1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 10:54:16 +01:00

[dxgi] Fix back buffer destruction

The back buffer needs to be deleted explicitly because on
the way it is created. Fixes reference counting issues in
applications which resize the back buffer at least once.
This commit is contained in:
Philip Rebohle 2018-03-18 20:39:14 +01:00
parent e009e63aa7
commit 69dd05b269
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -269,6 +269,7 @@ namespace dxvk {
HRESULT DxgiSwapChain::CreateBackBuffer() {
// Figure out sample count based on swap chain description
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT;
if (FAILED(GetSampleCount(m_desc.SampleDesc.Count, &sampleCount))) {
@ -276,6 +277,9 @@ namespace dxvk {
return E_INVALIDARG;
}
// Destroy previous back buffer before creating a new one
m_backBuffer = nullptr;
if (FAILED(m_presentDevice->CreateSwapChainBackBuffer(&m_desc, &m_backBuffer))) {
Logger::err("DxgiSwapChain: Failed to create back buffer");
return E_FAIL;