summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-12-19 01:45:09 -0300
committerGravatar ReinUsesLisp2019-12-19 16:24:45 -0300
commitde918ebeb0171010d15d68281f45356898ef8c78 (patch)
tree8dd26dbb801e2af6dba66fea60b1cc4a8581bc3d /src
parentvk_shader_decompiler: Normalize output fragment attachments (diff)
downloadyuzu-de918ebeb0171010d15d68281f45356898ef8c78.tar.gz
yuzu-de918ebeb0171010d15d68281f45356898ef8c78.tar.xz
yuzu-de918ebeb0171010d15d68281f45356898ef8c78.zip
vk_shader_decompiler: Skip NDC correction when it is native
Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index c84f9e4be..6c7f73d48 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -1841,7 +1841,7 @@ private:
1841 } 1841 }
1842 1842
1843 void PreExit() { 1843 void PreExit() {
1844 if (stage == ShaderType::Vertex) { 1844 if (stage == ShaderType::Vertex && specialization.ndc_minus_one_to_one) {
1845 const u32 position_index = out_indices.position.value(); 1845 const u32 position_index = out_indices.position.value();
1846 const Id z_pointer = AccessElement(t_out_float, out_vertex, position_index, 2U); 1846 const Id z_pointer = AccessElement(t_out_float, out_vertex, position_index, 2U);
1847 const Id w_pointer = AccessElement(t_out_float, out_vertex, position_index, 3U); 1847 const Id w_pointer = AccessElement(t_out_float, out_vertex, position_index, 3U);
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.h b/src/video_core/renderer_vulkan/vk_shader_decompiler.h
index 415801b6c..10794be1c 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.h
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.h
@@ -94,6 +94,7 @@ struct Specialization final {
94 Maxwell::PrimitiveTopology primitive_topology{}; 94 Maxwell::PrimitiveTopology primitive_topology{};
95 std::optional<float> point_size{}; 95 std::optional<float> point_size{};
96 std::array<Maxwell::VertexAttribute::Type, Maxwell::NumVertexAttributes> attribute_types{}; 96 std::array<Maxwell::VertexAttribute::Type, Maxwell::NumVertexAttributes> attribute_types{};
97 bool ndc_minus_one_to_one{};
97 98
98 // Tessellation specific 99 // Tessellation specific
99 struct { 100 struct {