aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-06-28 22:01:58 -0300
committergdkchan <gab.dark.100@gmail.com>2018-06-28 22:01:58 -0300
commitedfd4bc860e05698946605c740fdb5857d64e917 (patch)
tree362beecf61e18abe8df40c3bc1b37dbb2cb81d47
parent4c7c21634eeab768971777f62dab8224f7ed2eb0 (diff)
Explicit GLSL "position" attribute location (#199)
-rw-r--r--Ryujinx.Graphics/Gal/Shader/GlslDecl.cs2
-rw-r--r--Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs4
2 files changed, 4 insertions, 2 deletions
diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
index 5c7dd794..867f9016 100644
--- a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
+++ b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
@@ -15,6 +15,8 @@ namespace Ryujinx.Graphics.Gal.Shader
public const int GlPositionVec4Index = 7;
+ public const int PositionOutAttrLocation = 15;
+
private const int AttrStartIndex = 8;
private const int TexStartIndex = 8;
diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
index 2bc350da..87d44868 100644
--- a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
+++ b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
@@ -208,7 +208,7 @@ namespace Ryujinx.Graphics.Gal.Shader
{
if (Decl.ShaderType == GalShaderType.Fragment)
{
- SB.AppendLine("in vec4 " + GlslDecl.PositionOutAttrName + ";");
+ SB.AppendLine("layout (location = " + GlslDecl.PositionOutAttrLocation + ") in vec4 " + GlslDecl.PositionOutAttrName + ";");
}
PrintDeclAttributes(Decl.InAttributes.Values, "in");
@@ -218,7 +218,7 @@ namespace Ryujinx.Graphics.Gal.Shader
{
if (Decl.ShaderType == GalShaderType.Vertex)
{
- SB.AppendLine("out vec4 " + GlslDecl.PositionOutAttrName + ";");
+ SB.AppendLine("layout (location = " + GlslDecl.PositionOutAttrLocation + ") out vec4 " + GlslDecl.PositionOutAttrName + ";");
}
PrintDeclAttributes(Decl.OutAttributes.Values, "out");