Add FaceAttr (0x3fc) input attribute in GLSL
This commit is contained in:
parent
e913d56fdc
commit
88aa78be76
2 changed files with 13 additions and 2 deletions
|
@ -9,6 +9,7 @@ namespace Ryujinx.Graphics.Gal.Shader
|
|||
public const int TessCoordAttrZ = 0x2f8;
|
||||
public const int InstanceIdAttr = 0x2f8;
|
||||
public const int VertexIdAttr = 0x2fc;
|
||||
public const int FaceAttr = 0x3fc;
|
||||
public const int GlPositionWAttr = 0x7c;
|
||||
|
||||
public const int MaxUboSize = 1024;
|
||||
|
@ -208,7 +209,8 @@ namespace Ryujinx.Graphics.Gal.Shader
|
|||
{
|
||||
//This is a built-in input variable.
|
||||
if (Abuf.Offs == VertexIdAttr ||
|
||||
Abuf.Offs == InstanceIdAttr)
|
||||
Abuf.Offs == InstanceIdAttr ||
|
||||
Abuf.Offs == FaceAttr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -658,6 +658,14 @@ namespace Ryujinx.Graphics.Gal.Shader
|
|||
case GlslDecl.TessCoordAttrZ: return "gl_TessCoord.z";
|
||||
}
|
||||
}
|
||||
else if (Decl.ShaderType == GalShaderType.Fragment)
|
||||
{
|
||||
switch (Abuf.Offs)
|
||||
{
|
||||
//Note: It's a guess that Maxwell's face is 1 when gl_FrontFacing == true
|
||||
case GlslDecl.FaceAttr: return "(gl_FrontFacing ? 1 : 0)";
|
||||
}
|
||||
}
|
||||
|
||||
return GetAttrTempName(Abuf);
|
||||
}
|
||||
|
@ -1084,7 +1092,8 @@ namespace Ryujinx.Graphics.Gal.Shader
|
|||
{
|
||||
case ShaderIrOperAbuf Abuf:
|
||||
return Abuf.Offs == GlslDecl.VertexIdAttr ||
|
||||
Abuf.Offs == GlslDecl.InstanceIdAttr
|
||||
Abuf.Offs == GlslDecl.InstanceIdAttr ||
|
||||
Abuf.Offs == GlslDecl.FaceAttr
|
||||
? OperType.I32
|
||||
: OperType.F32;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue