From 7bfe63f679e2fcf181a9a4367436ee483fecf028 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 25 Mar 2023 22:50:50 +0000 Subject: [PATCH] Enable adreno/mali LLVM misopt workaround Fixes animal crossing character issues, see shader compiler commit for details. --- app/libraries/shader-compiler | 2 +- app/src/main/cpp/skyline/gpu/shader_manager.cpp | 3 ++- app/src/main/cpp/skyline/gpu/trait_manager.cpp | 3 +++ app/src/main/cpp/skyline/gpu/trait_manager.h | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/libraries/shader-compiler b/app/libraries/shader-compiler index 23a83bfd..312e14b2 160000 --- a/app/libraries/shader-compiler +++ b/app/libraries/shader-compiler @@ -1 +1 @@ -Subproject commit 23a83bfdb4cff9c16694b7803a66063f41f306c5 +Subproject commit 312e14b2c334502e7453ab200042ae688a66e3b1 diff --git a/app/src/main/cpp/skyline/gpu/shader_manager.cpp b/app/src/main/cpp/skyline/gpu/shader_manager.cpp index 03e391ef..3e1b08fb 100644 --- a/app/src/main/cpp/skyline/gpu/shader_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/shader_manager.cpp @@ -126,7 +126,8 @@ namespace skyline::gpu { .has_broken_spirv_subgroup_mask_vector_extract_dynamic = traits.quirks.brokenSubgroupMaskExtractDynamic, .has_broken_spirv_subgroup_shuffle = traits.quirks.brokenSubgroupShuffle, .max_subgroup_size = traits.subgroupSize, - .disable_subgroup_shuffle = *state.settings->disableSubgroupShuffle + .has_broken_spirv_vector_access_chain = traits.quirks.brokenSpirvVectorAccessChain, + .disable_subgroup_shuffle = *state.settings->disableSubgroupShuffle, }; Shader::Settings::values = { diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.cpp b/app/src/main/cpp/skyline/gpu/trait_manager.cpp index 504c717f..e5e5e2e1 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/trait_manager.cpp @@ -237,6 +237,7 @@ namespace skyline::gpu { relaxedRenderPassCompatibility = true; // Adreno drivers support relaxed render pass compatibility rules brokenPushDescriptors = true; brokenSpirvPositionInput = true; + brokenSpirvAccessChainOpt = true; if (deviceProperties.driverVersion < VK_MAKE_VERSION(512, 600, 0)) maxSubpassCount = 64; // Driver will segfault while destroying the renderpass and associated objects if this is exceeded on all 5xx and below drivers @@ -248,6 +249,7 @@ namespace skyline::gpu { brokenSubgroupMaskExtractDynamic = true; brokenSubgroupShuffle = true; + brokenSpirvVectorAccessChain = true; maxGlobalPriority = vk::QueueGlobalPriorityEXT::eHigh; break; } @@ -262,6 +264,7 @@ namespace skyline::gpu { if (deviceProperties.driverVersion < VK_MAKE_VERSION(42, 0, 0)) brokenDynamicStateVertexBindings = true; + brokenSpirvAccessChainOpt = true; vkImageMutableFormatCostly = true; // Disables AFBC in some cases maxGlobalPriority = vk::QueueGlobalPriorityEXT::eHigh; break; diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.h b/app/src/main/cpp/skyline/gpu/trait_manager.h index c80eacee..f119569c 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.h +++ b/app/src/main/cpp/skyline/gpu/trait_manager.h @@ -73,10 +73,12 @@ namespace skyline::gpu { bool relaxedRenderPassCompatibility{}; //!< [Adreno Proprietary/Freedreno] A relaxed version of Vulkan specification's render pass compatibility clause which allows for caching pipeline objects for multi-subpass renderpasses, this is intentionally disabled by default as it requires testing prior to enabling bool brokenPushDescriptors{}; //!< [Adreno Proprietary] A bug that causes push descriptor updates to ignored by the driver in certain situations bool brokenSpirvPositionInput{}; //!< [Adreno Proprietary] A bug that causes the shader compiler to fail on shaders with vertex position inputs not contained within a struct + bool brokenSpirvAccessChainOpt{}; //!< [Adreno Proprietary] A broken optimisation pass causes dynamic access chain offsets to break bool brokenComputeShaders{}; //!< [ARM Proprietary] A bug that causes compute shaders in some games to crash the GPU bool brokenMultithreadedPipelineCompilation{}; //!< [Qualcomm Proprietary] A bug that causes the shader compiler to crash when compiling pipelines on multiple threads simultaneously bool brokenSubgroupMaskExtractDynamic{}; //!< [Qualcomm Proprietary] A bug that causes shaders using OpVectorExtractDynamic on the subgroup mask builtins to fail to compile bool brokenSubgroupShuffle{}; //!< [Qualcomm Proprietary] A bug that causes shaders using OpSubgroupShuffle to do all sorts of weird things + bool brokenSpirvVectorAccessChain{}; //!< [Qualcomm Proprietary] A bug that causes SPIR-V OpAccessChains to work incorrectly when used to index vector arrays bool brokenDynamicStateVertexBindings{}; //!< [ARM Proprietary] A bug that causes VK_EXT_dynamic_state vertex bindings not to work correctly u32 maxSubpassCount{std::numeric_limits::max()}; //!< The maximum amount of subpasses within a renderpass, this is limited to 64 on older Adreno proprietary drivers