summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-06-04 21:18:51 +0200
committerGitHub <noreply@github.com>2020-06-04 21:18:51 +0200
commit22369df357fc4e9fdc21bd4096128b84aebc41a2 (patch)
treea3a6de5d6639fa0540b352aa95ecb38aa3fdcf02
parentMerge pull request #4044 from ogniK5377/handle-not-signalled-err (diff)
parentgl_shader_decompiler: Declare gl_Layer and gl_ViewportIndex within gl_PerVertex for vertex and tessellation shaders (diff)
downloadyuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar.gz
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar.bz2
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar.lz
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar.xz
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.tar.zst
yuzu-22369df357fc4e9fdc21bd4096128b84aebc41a2.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 502b95973..d6e30b321 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -626,7 +626,9 @@ private:
break;
}
}
- if (stage != ShaderType::Vertex || device.HasVertexViewportLayer()) {
+
+ if (stage != ShaderType::Geometry &&
+ (stage != ShaderType::Vertex || device.HasVertexViewportLayer())) {
if (ir.UsesLayer()) {
code.AddLine("int gl_Layer;");
}
@@ -655,6 +657,16 @@ private:
--code.scope;
code.AddLine("}};");
code.AddNewLine();
+
+ if (stage == ShaderType::Geometry) {
+ if (ir.UsesLayer()) {
+ code.AddLine("out int gl_Layer;");
+ }
+ if (ir.UsesViewportIndex()) {
+ code.AddLine("out int gl_ViewportIndex;");
+ }
+ }
+ code.AddNewLine();
}
void DeclareRegisters() {