summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-06-01 21:35:44 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-06-01 21:35:44 +0200
commit74f2e5f1a460e8f429cc41032bd680548d3b1f46 (patch)
tree54ea1e72aa49f22e85de18b21b56b95ff4559634 /src/video_core
parentgl_shader_decompiler: Fix geometry shader outputs for Intel drivers (diff)
downloadyuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar.gz
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar.bz2
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar.lz
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar.xz
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.tar.zst
yuzu-74f2e5f1a460e8f429cc41032bd680548d3b1f46.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index f5a592490..2c818f406 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -619,6 +619,21 @@ private:
}
}
+ if (stage != ShaderType::Geometry &&
+ (stage != ShaderType::Vertex || device.HasVertexViewportLayer())) {
+ if (ir.UsesLayer()) {
+ code.AddLine("int gl_Layer;");
+ }
+ if (ir.UsesViewportIndex()) {
+ code.AddLine("int gl_ViewportIndex;");
+ }
+ } else if ((ir.UsesLayer() || ir.UsesViewportIndex()) && stage == ShaderType::Vertex &&
+ !device.HasVertexViewportLayer()) {
+ LOG_ERROR(
+ Render_OpenGL,
+ "GL_ARB_shader_viewport_layer_array is not available and its required by a shader");
+ }
+
if (ir.UsesPointSize()) {
code.AddLine("float gl_PointSize;");
}
@@ -635,18 +650,13 @@ private:
code.AddLine("}};");
code.AddNewLine();
- if (stage != ShaderType::Vertex || device.HasVertexViewportLayer()) {
+ if (stage == ShaderType::Geometry) {
if (ir.UsesLayer()) {
code.AddLine("out int gl_Layer;");
}
if (ir.UsesViewportIndex()) {
code.AddLine("out int gl_ViewportIndex;");
}
- } else if ((ir.UsesLayer() || ir.UsesViewportIndex()) && stage == ShaderType::Vertex &&
- !device.HasVertexViewportLayer()) {
- LOG_ERROR(
- Render_OpenGL,
- "GL_ARB_shader_viewport_layer_array is not available and its required by a shader");
}
code.AddNewLine();
}