From ce751682385af16053f35b9f755168cc0700244d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 21 Jun 2020 01:33:15 +1000 Subject: [PATCH] GPU/Vulkan: Don't assume support for dual-source blend --- src/core/gpu_hw_vulkan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/gpu_hw_vulkan.cpp b/src/core/gpu_hw_vulkan.cpp index 12180e4d3..7297967e6 100644 --- a/src/core/gpu_hw_vulkan.cpp +++ b/src/core/gpu_hw_vulkan.cpp @@ -198,7 +198,7 @@ void GPU_HW_Vulkan::SetCapabilities() Log_InfoPrintf("Max texture size: %ux%u", max_texture_size, max_texture_size); m_max_resolution_scale = max_texture_scale; - m_supports_dual_source_blend = true; + m_supports_dual_source_blend = g_vulkan_context->GetDeviceFeatures().dualSrcBlend; } void GPU_HW_Vulkan::DestroyResources() @@ -656,9 +656,9 @@ bool GPU_HW_Vulkan::CompilePipelines() static_cast(render_mode) != BatchRenderMode::OnlyOpaque)) || m_texture_filtering) { - // TODO: Check dual-source blend support here. gpbuilder.SetBlendAttachment( - 0, true, VK_BLEND_FACTOR_ONE, VK_BLEND_FACTOR_SRC1_ALPHA, + 0, true, VK_BLEND_FACTOR_ONE, + m_supports_dual_source_blend ? VK_BLEND_FACTOR_SRC_ALPHA : VK_BLEND_FACTOR_SRC1_ALPHA, (static_cast(transparency_mode) == TransparencyMode::BackgroundMinusForeground) ? VK_BLEND_OP_REVERSE_SUBTRACT : VK_BLEND_OP_ADD,