diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 9189eaf7..211c3854 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -4682,6 +4682,7 @@ namespace dxvk { D3D9DeviceLock lock = LockDevice(); m_initializer->Flush(); + m_converter->Flush(); if (m_csIsBusy || !m_csChunk->empty()) { // Add commands to flush the threaded diff --git a/src/d3d9/d3d9_format_helpers.cpp b/src/d3d9/d3d9_format_helpers.cpp index 50e43e6e..460b3c26 100644 --- a/src/d3d9/d3d9_format_helpers.cpp +++ b/src/d3d9/d3d9_format_helpers.cpp @@ -14,6 +14,12 @@ namespace dxvk { } + void D3D9FormatHelper::Flush() { + if (m_transferCommands != 0) + FlushInternal(); + } + + void D3D9FormatHelper::ConvertFormat( D3D9_CONVERSION_FORMAT_INFO conversionFormat, const Rc& dstImage, @@ -67,7 +73,7 @@ namespace dxvk { (imageExtent.height / 8) + (imageExtent.height % 8), 1); - m_context->flushCommandList(); + m_transferCommands += 1; } @@ -112,7 +118,7 @@ namespace dxvk { // Reset the spec constants used... m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_COMPUTE, 0, 0); - m_context->flushCommandList(); + m_transferCommands += 1; } @@ -135,4 +141,11 @@ namespace dxvk { { 0u, 0u, 0u, sizeof(VkExtent2D) }, code); } + + void D3D9FormatHelper::FlushInternal() { + m_context->flushCommandList(); + + m_transferCommands = 0; + } + } \ No newline at end of file diff --git a/src/d3d9/d3d9_format_helpers.h b/src/d3d9/d3d9_format_helpers.h index 5c100c86..99327666 100644 --- a/src/d3d9/d3d9_format_helpers.h +++ b/src/d3d9/d3d9_format_helpers.h @@ -13,6 +13,8 @@ namespace dxvk { D3D9FormatHelper(const Rc& device); + void Flush(); + void ConvertFormat( D3D9_CONVERSION_FORMAT_INFO conversionFormat, const Rc& dstImage, @@ -43,9 +45,13 @@ namespace dxvk { Rc InitShader(SpirvCodeBuffer code); + void FlushInternal(); + Rc m_device; Rc m_context; + size_t m_transferCommands = 0; + std::array, D3D9ConversionFormat_Count> m_shaders; };