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:
parent
e009e63aa7
commit
69dd05b269
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user