From f095f6385ef780d4ae00b8ca8a1a8ccc4f7dc8bc Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 21 Feb 2020 06:45:02 +0000 Subject: [PATCH] [d3d9] Initialize all backbuffers in swapchain creation Otherwise they are garbage and undefined layout. Fixes some validation errors in Lumino City #1462 --- src/d3d9/d3d9_swapchain.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 1f8274e41..8e6bde027 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -962,8 +962,11 @@ namespace dxvk { m_context->beginRecording( m_device->createCommandList()); - m_context->clearColorImage( - swapImage, clearColor, subresources); + for (uint32_t i = 0; i < m_backBuffers.size(); i++) { + m_context->clearColorImage( + m_backBuffers[i]->GetCommonTexture()->GetImage(), + clearColor, subresources); + } m_device->submitCommandList( m_context->endRecording(),