From e72dfa1006e853c260e4ab8246e7525e77e405a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 11 Nov 2026 23:58:33 +0100 Subject: [PATCH] Vulkan: Don't use the light ubershader on Adreno 5xx On an Adreno 506 (Vulkan 1.0.20 driver, Redmi Note 4), the ubershader's loop over the lights gives wrong lighting: LittleBigPlanet's Sackboy and lit scenery came out pale. The per-light shaders render it right. Uses the existing UNIFORM_INDEXING_BROKEN flag, set so far for old Mali. Co-Authored-By: Claude Opus 5.5 --- Common/GPU/Vulkan/thin3d_vulkan.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 5e93a3082f..8a1fc3d9ca 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -1087,6 +1087,11 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) if (!turnip && (deviceProps.driverVersion < 0x801EA000 || deviceProps.deviceID < 0x06000000)) bugs_.Infest(Bugs::COLORWRITEMASK_BROKEN_WITH_DEPTHTEST); + // The light ubershader's loop over the lights gives wrong lighting (LittleBigPlanet's Sackboy and scenery came + // out pale). Seen on Adreno 506 with a Vulkan 1.0.20 driver; the per-light shaders are fine. + if (!turnip && deviceProps.deviceID >= 0x05000000 && deviceProps.deviceID < 0x06000000) + bugs_.Infest(Bugs::UNIFORM_INDEXING_BROKEN); + // Trying to follow all the rules in https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#synchronization-pipeline-barriers-subpass-self-dependencies // and https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#renderpass-feedbackloop, but still it doesn't // quite work - artifacts on triangle boundaries on Adreno.