From 79ef185d6ea65f6dcc37e3e1ffe7a8880685bfea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 22 Dec 2018 18:29:56 +0100 Subject: [PATCH] Vulkan/adreno: Apply workaround for Harvest Moon issue #10421 --- GPU/Vulkan/StateMappingVulkan.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/GPU/Vulkan/StateMappingVulkan.cpp b/GPU/Vulkan/StateMappingVulkan.cpp index ff6c141af570..2cc8f0822974 100644 --- a/GPU/Vulkan/StateMappingVulkan.cpp +++ b/GPU/Vulkan/StateMappingVulkan.cpp @@ -235,6 +235,18 @@ void DrawEngineVulkan::ConvertStateToVulkanKey(FramebufferManagerVulkan &fbManag } key.colorWriteMask = (rmask ? VK_COLOR_COMPONENT_R_BIT : 0) | (gmask ? VK_COLOR_COMPONENT_G_BIT : 0) | (bmask ? VK_COLOR_COMPONENT_B_BIT : 0) | (amask ? VK_COLOR_COMPONENT_A_BIT : 0); + + // Workaround proposed in #10421 + if ((gstate.pmskc & 0x00FFFFFF) == 0x00FFFFFF && vulkan_->GetPhysicalDeviceProperties(vulkan_->GetCurrentPhysicalDevice()).vendorID == VULKAN_VENDOR_QUALCOMM) { + key.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; + key.blendEnable = true; + key.blendOpColor = VK_BLEND_OP_ADD; + key.blendOpAlpha = VK_BLEND_OP_ADD; + key.srcColor = VK_BLEND_FACTOR_ZERO; + key.srcAlpha = VK_BLEND_FACTOR_ZERO; + key.destColor = VK_BLEND_FACTOR_ONE; + key.destAlpha = VK_BLEND_FACTOR_ONE; + } } }