From 08f36aac331638b6f0ea0d73da8650e8d4be4b46 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 4 Aug 2022 20:33:22 +0100 Subject: [PATCH] Enable hades vertex position input workaround for Adreno Caused crashes in any games using geometry shaders as by default hades uses the position builtin directly. --- app/libraries/shader-compiler | 2 +- app/src/main/cpp/skyline/gpu/shader_manager.cpp | 1 + app/src/main/cpp/skyline/gpu/trait_manager.cpp | 1 + app/src/main/cpp/skyline/gpu/trait_manager.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/libraries/shader-compiler b/app/libraries/shader-compiler index 86f86063..a4713982 160000 --- a/app/libraries/shader-compiler +++ b/app/libraries/shader-compiler @@ -1 +1 @@ -Subproject commit 86f860634997d509653d677905540b7989987e90 +Subproject commit a4713982b9e596e8fdebe55c1601758815cd3850 diff --git a/app/src/main/cpp/skyline/gpu/shader_manager.cpp b/app/src/main/cpp/skyline/gpu/shader_manager.cpp index e2a02680..0ab130d9 100644 --- a/app/src/main/cpp/skyline/gpu/shader_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/shader_manager.cpp @@ -64,6 +64,7 @@ namespace skyline::gpu { .warp_size_potentially_larger_than_guest = TegraX1WarpSize < traits.subgroupSize, .lower_left_origin_mode = false, .need_declared_frag_colors = false, + .has_broken_spirv_position_input = traits.quirks.brokenSpirvPositionInput }; 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 470eca37..6099af71 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/trait_manager.cpp @@ -204,6 +204,7 @@ namespace skyline::gpu { brokenDescriptorAliasing = true; relaxedRenderPassCompatibility = true; // Adreno drivers support relaxed render pass compatibility rules brokenPushDescriptors = true; + brokenSpirvPositionInput = 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 diff --git a/app/src/main/cpp/skyline/gpu/trait_manager.h b/app/src/main/cpp/skyline/gpu/trait_manager.h index 514e9af0..ec888663 100644 --- a/app/src/main/cpp/skyline/gpu/trait_manager.h +++ b/app/src/main/cpp/skyline/gpu/trait_manager.h @@ -59,6 +59,7 @@ namespace skyline::gpu { bool brokenDescriptorAliasing{}; //!< [Adreno Proprietary] A bug that causes alised descriptor sets to be incorrectly interpreted by the shader compiler leading to it buggering up LLVM function argument types and crashing 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 u32 maxSubpassCount{std::numeric_limits::max()}; //!< The maximum amount of subpasses within a renderpass, this is limited to 64 on older Adreno proprietary drivers vk::QueueGlobalPriorityEXT maxGlobalPriority{vk::QueueGlobalPriorityEXT::eMedium}; //!< The highest allowed global priority of the queue, drivers will not allow higher priorities to be set on queues