Implement gl_ViewportIndex Vertex Attribute
This commit is contained in:
parent
d94f2ffd32
commit
407c893e0f
2 changed files with 20 additions and 4 deletions
|
@ -6,6 +6,7 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
class GlslDecl
|
class GlslDecl
|
||||||
{
|
{
|
||||||
public const int LayerAttr = 0x064;
|
public const int LayerAttr = 0x064;
|
||||||
|
public const int ViewportIdxAttr = 0x068;
|
||||||
public const int PointSizeAttr = 0x06c;
|
public const int PointSizeAttr = 0x06c;
|
||||||
public const int PointCoordAttrX = 0x2e0;
|
public const int PointCoordAttrX = 0x2e0;
|
||||||
public const int PointCoordAttrY = 0x2e4;
|
public const int PointCoordAttrY = 0x2e4;
|
||||||
|
|
|
@ -190,7 +190,13 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
|
|
||||||
private void PrintDeclHeader()
|
private void PrintDeclHeader()
|
||||||
{
|
{
|
||||||
if (Decl.ShaderType == GalShaderType.Geometry)
|
if(Decl.ShaderType == GalShaderType.Vertex)
|
||||||
|
{
|
||||||
|
SB.AppendLine("#extension GL_AMD_vertex_shader_viewport_index : require");
|
||||||
|
|
||||||
|
SB.AppendLine();
|
||||||
|
}
|
||||||
|
else if (Decl.ShaderType == GalShaderType.Geometry)
|
||||||
{
|
{
|
||||||
int MaxVertices = Header.MaxOutputVertexCount;
|
int MaxVertices = Header.MaxOutputVertexCount;
|
||||||
|
|
||||||
|
@ -872,10 +878,18 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
|
|
||||||
return Name + Swizzle;
|
return Name + Swizzle;
|
||||||
}
|
}
|
||||||
|
else if (Abuf.Offs == GlslDecl.ViewportIdxAttr)
|
||||||
|
{
|
||||||
|
return "gl_ViewportIndex";
|
||||||
|
}
|
||||||
else if (Abuf.Offs == GlslDecl.PointSizeAttr)
|
else if (Abuf.Offs == GlslDecl.PointSizeAttr)
|
||||||
{
|
{
|
||||||
return "gl_PointSize";
|
return "gl_PointSize";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotImplementedException($"Attribute with offset 0x{Abuf.Offs:x2} is not implemented.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DeclInfo.Index >= 32)
|
if (DeclInfo.Index >= 32)
|
||||||
|
@ -1347,6 +1361,7 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
{
|
{
|
||||||
case ShaderIrOperAbuf Abuf:
|
case ShaderIrOperAbuf Abuf:
|
||||||
return Abuf.Offs == GlslDecl.LayerAttr ||
|
return Abuf.Offs == GlslDecl.LayerAttr ||
|
||||||
|
Abuf.Offs == GlslDecl.ViewportIdxAttr ||
|
||||||
Abuf.Offs == GlslDecl.InstanceIdAttr ||
|
Abuf.Offs == GlslDecl.InstanceIdAttr ||
|
||||||
Abuf.Offs == GlslDecl.VertexIdAttr ||
|
Abuf.Offs == GlslDecl.VertexIdAttr ||
|
||||||
Abuf.Offs == GlslDecl.FaceAttr
|
Abuf.Offs == GlslDecl.FaceAttr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue