From bc84d6345b6e7cc2c76322f8af36f0a53de2a66c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 9 Oct 2022 00:57:10 -0700 Subject: [PATCH] Vulkan: Disable geometry shaders for Mali <= 18. These drivers apparently have some weird behavior. --- Common/GPU/Vulkan/thin3d_vulkan.cpp | 5 +++-- Common/GPU/thin3d.h | 2 +- GPU/Vulkan/GPU_Vulkan.cpp | 2 +- UI/GameSettingsScreen.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index cf2a28ea53..6c342f8e9e 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -848,8 +848,9 @@ VKContext::VKContext(VulkanContext *vulkan) } // Older ARM devices have very slow geometry shaders, not worth using. At least before 15. - if (majorVersion <= 15) { - bugs_.Infest(Bugs::GEOMETRY_SHADERS_SLOW); + // Also seen to cause weird issues on 18, so let's lump it in. + if (majorVersion <= 18) { + bugs_.Infest(Bugs::GEOMETRY_SHADERS_SLOW_OR_BROKEN); } } diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index c04b7119cd..3e482687a3 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -333,7 +333,7 @@ public: RASPBERRY_SHADER_COMP_HANG = 8, MALI_CONSTANT_LOAD_BUG = 9, SUBPASS_FEEDBACK_BROKEN = 10, - GEOMETRY_SHADERS_SLOW = 11, + GEOMETRY_SHADERS_SLOW_OR_BROKEN = 11, MAX_BUG, }; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index f285af82d0..64f69a861b 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -234,7 +234,7 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { // Fall back to geometry shader culling if we can't do vertex range culling. if (enabledFeatures.geometryShader) { - const bool useGeometry = g_Config.bUseGeometryShader && !draw_->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW); + const bool useGeometry = g_Config.bUseGeometryShader && !draw_->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW_OR_BROKEN); const bool vertexSupported = draw_->GetDeviceCaps().clipDistanceSupported && draw_->GetDeviceCaps().cullDistanceSupported; if (useGeometry && (!vertexSupported || (features & GPU_SUPPORTS_VS_RANGE_CULLING) == 0)) { // Switch to culling via the geometry shader if not fully supported in vertex. diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 4d1d6c6798..153f03d69c 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -474,7 +474,7 @@ void GameSettingsScreen::CreateViews() { } if (GetGPUBackend() == GPUBackend::VULKAN) { - const bool usable = !draw->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW); + const bool usable = !draw->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW_OR_BROKEN); const bool vertexSupported = draw->GetDeviceCaps().clipDistanceSupported && draw->GetDeviceCaps().cullDistanceSupported; if (usable && !vertexSupported) { CheckBox *geometryCulling = graphicsSettings->Add(new CheckBox(&g_Config.bUseGeometryShader, gr->T("Geometry shader culling")));