diff --git a/src/d3d9/d3d9_initializer.cpp b/src/d3d9/d3d9_initializer.cpp index d3076954a..64ac34971 100644 --- a/src/d3d9/d3d9_initializer.cpp +++ b/src/d3d9/d3d9_initializer.cpp @@ -91,8 +91,7 @@ namespace dxvk { // While the Microsoft docs state that resource contents are // undefined if no initial data is provided, some applications - // expect a resource to be pre-cleared. We can only do that - // for non-compressed images, but that should be fine. + // expect a resource to be pre-cleared. VkImageSubresourceRange subresources; subresources.aspectMask = formatInfo->aspectMask; subresources.baseMipLevel = 0; @@ -100,23 +99,7 @@ namespace dxvk { subresources.baseArrayLayer = 0; subresources.layerCount = image->info().numLayers; - if (formatInfo->flags.test(DxvkFormatFlag::BlockCompressed)) { - m_context->clearCompressedColorImage(image, subresources); - } else { - if (subresources.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) { - VkClearColorValue value = { }; - - m_context->clearColorImage( - image, value, subresources); - } else { - VkClearDepthStencilValue value; - value.depth = 0.0f; - value.stencil = 0; - - m_context->clearDepthStencilImage( - image, value, subresources); - } - } + m_context->initImage(image, subresources, VK_IMAGE_LAYOUT_UNDEFINED); }; InitImage(pTexture->GetImage()); diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 1c2c23b1e..ad413d282 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -1050,19 +1050,13 @@ namespace dxvk { subresources.baseArrayLayer = 0; subresources.layerCount = 1; - VkClearColorValue clearColor; - clearColor.float32[0] = 0.0f; - clearColor.float32[1] = 0.0f; - clearColor.float32[2] = 0.0f; - clearColor.float32[3] = 0.0f; - m_context->beginRecording( m_device->createCommandList()); for (uint32_t i = 0; i < m_backBuffers.size(); i++) { - m_context->clearColorImage( + m_context->initImage( m_backBuffers[i]->GetCommonTexture()->GetImage(), - clearColor, subresources); + subresources, VK_IMAGE_LAYOUT_UNDEFINED); } m_device->submitCommandList(