diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen')
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs | 11 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs index fb58f84a..b1291906 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs @@ -365,11 +365,16 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl foreach (int attr in info.IAttributes.OrderBy(x => x)) { - string iq = info.InterpolationQualifiers[attr].ToGlslQualifier(); + string iq = string.Empty; - if (iq != string.Empty) + if (context.Config.Stage == ShaderStage.Fragment) { - iq += " "; + iq = context.Config.ImapTypes[attr].GetFirstUsedType() switch + { + PixelImap.Constant => "flat ", + PixelImap.ScreenLinear => "noperspective ", + _ => string.Empty + }; } context.AppendLine($"layout (location = {attr}) {iq}in vec4 {DefaultNames.IAttributePrefix}{attr}{suffix};"); diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs index 2de55b2d..8d092d4e 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs @@ -188,7 +188,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl case AttributeConsts.PositionX: return "gl_FragCoord.x"; case AttributeConsts.PositionY: return "gl_FragCoord.y"; case AttributeConsts.PositionZ: return "gl_FragCoord.z"; - case AttributeConsts.PositionW: return "1.0"; + case AttributeConsts.PositionW: return "gl_FragCoord.w"; } } |
