Address feedback
This commit is contained in:
parent
1c73f2b7ad
commit
07829010f1
3 changed files with 43 additions and 26 deletions
|
@ -4,14 +4,13 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
{
|
{
|
||||||
class GlslDecl
|
class GlslDecl
|
||||||
{
|
{
|
||||||
|
public const int LayerAttr = 0x064;
|
||||||
public const int TessCoordAttrX = 0x2f0;
|
public const int TessCoordAttrX = 0x2f0;
|
||||||
public const int TessCoordAttrY = 0x2f4;
|
public const int TessCoordAttrY = 0x2f4;
|
||||||
public const int TessCoordAttrZ = 0x2f8;
|
public const int TessCoordAttrZ = 0x2f8;
|
||||||
public const int InstanceIdAttr = 0x2f8;
|
public const int InstanceIdAttr = 0x2f8;
|
||||||
public const int VertexIdAttr = 0x2fc;
|
public const int VertexIdAttr = 0x2fc;
|
||||||
public const int FaceAttr = 0x3fc;
|
public const int FaceAttr = 0x3fc;
|
||||||
public const int GlPositionWAttr = 0x7c;
|
|
||||||
public const int LayerAttr = 0x64;
|
|
||||||
|
|
||||||
public const int MaxUboSize = 1024;
|
public const int MaxUboSize = 1024;
|
||||||
|
|
||||||
|
|
|
@ -1223,10 +1223,10 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||||
switch (Node)
|
switch (Node)
|
||||||
{
|
{
|
||||||
case ShaderIrOperAbuf Abuf:
|
case ShaderIrOperAbuf Abuf:
|
||||||
return Abuf.Offs == GlslDecl.VertexIdAttr ||
|
return Abuf.Offs == GlslDecl.LayerAttr ||
|
||||||
Abuf.Offs == GlslDecl.InstanceIdAttr ||
|
Abuf.Offs == GlslDecl.InstanceIdAttr ||
|
||||||
Abuf.Offs == GlslDecl.FaceAttr ||
|
Abuf.Offs == GlslDecl.VertexIdAttr ||
|
||||||
Abuf.Offs == GlslDecl.LayerAttr
|
Abuf.Offs == GlslDecl.FaceAttr
|
||||||
? OperType.I32
|
? OperType.I32
|
||||||
: OperType.F32;
|
: OperType.F32;
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,29 @@
|
||||||
public const int LineStrip = 6;
|
public const int LineStrip = 6;
|
||||||
public const int TriangleStrip = 7;
|
public const int TriangleStrip = 7;
|
||||||
|
|
||||||
|
public int SphType { get; private set; }
|
||||||
|
public int Version { get; private set; }
|
||||||
public int ShaderType { get; private set; }
|
public int ShaderType { get; private set; }
|
||||||
|
public bool MrtEnable { get; private set; }
|
||||||
|
public bool KillsPixels { get; private set; }
|
||||||
|
public bool DoesGlobalStore { get; private set; }
|
||||||
|
public int SassVersion { get; private set; }
|
||||||
|
public bool DoesLoadOrStore { get; private set; }
|
||||||
|
public bool DoesFp64 { get; private set; }
|
||||||
|
public int StreamOutMask { get; private set; }
|
||||||
|
|
||||||
|
public int ShaderLocalMemoryLowSize { get; private set; }
|
||||||
|
public int PerPatchAttributeCount { get; private set; }
|
||||||
|
|
||||||
|
public int ShaderLocalMemoryHighSize { get; private set; }
|
||||||
|
public int ThreadsPerInputPrimitive { get; private set; }
|
||||||
|
|
||||||
|
public int ShaderLocalMemoryCrsSize { get; private set; }
|
||||||
public int OutputTopology { get; private set; }
|
public int OutputTopology { get; private set; }
|
||||||
|
|
||||||
public int MaxOutputVertexCount { get; private set; }
|
public int MaxOutputVertexCount { get; private set; }
|
||||||
|
public int StoreReqStart { get; private set; }
|
||||||
|
public int StoreReqEnd { get; private set; }
|
||||||
|
|
||||||
public ShaderHeader(IGalMemory Memory, long Position)
|
public ShaderHeader(IGalMemory Memory, long Position)
|
||||||
{
|
{
|
||||||
|
@ -20,29 +38,29 @@
|
||||||
uint CommonWord3 = (uint)Memory.ReadInt32(Position + 12);
|
uint CommonWord3 = (uint)Memory.ReadInt32(Position + 12);
|
||||||
uint CommonWord4 = (uint)Memory.ReadInt32(Position + 16);
|
uint CommonWord4 = (uint)Memory.ReadInt32(Position + 16);
|
||||||
|
|
||||||
int SphType = ReadBits(CommonWord0, 0, 5);
|
SphType = ReadBits(CommonWord0, 0, 5);
|
||||||
int Version = ReadBits(CommonWord0, 5, 5);
|
Version = ReadBits(CommonWord0, 5, 5);
|
||||||
ShaderType = ReadBits(CommonWord0, 10, 4);
|
ShaderType = ReadBits(CommonWord0, 10, 4);
|
||||||
bool MrtEnable = ReadBits(CommonWord0, 14, 1) != 0;
|
MrtEnable = ReadBits(CommonWord0, 14, 1) != 0;
|
||||||
bool KillsPixels = ReadBits(CommonWord0, 15, 1) != 0;
|
KillsPixels = ReadBits(CommonWord0, 15, 1) != 0;
|
||||||
bool DoesGlobalStore = ReadBits(CommonWord0, 16, 1) != 0;
|
DoesGlobalStore = ReadBits(CommonWord0, 16, 1) != 0;
|
||||||
int SassVersion = ReadBits(CommonWord0, 17, 4);
|
SassVersion = ReadBits(CommonWord0, 17, 4);
|
||||||
bool DoesLoadOrStore = ReadBits(CommonWord0, 26, 1) != 0;
|
DoesLoadOrStore = ReadBits(CommonWord0, 26, 1) != 0;
|
||||||
bool DoesFp64 = ReadBits(CommonWord0, 27, 1) != 0;
|
DoesFp64 = ReadBits(CommonWord0, 27, 1) != 0;
|
||||||
int StreamOutMask = ReadBits(CommonWord0, 28, 4);
|
StreamOutMask = ReadBits(CommonWord0, 28, 4);
|
||||||
|
|
||||||
int ShaderLocalMemoryLowSize = ReadBits(CommonWord1, 0, 24);
|
ShaderLocalMemoryLowSize = ReadBits(CommonWord1, 0, 24);
|
||||||
int PerPatchAttributeCount = ReadBits(CommonWord1, 24, 8);
|
PerPatchAttributeCount = ReadBits(CommonWord1, 24, 8);
|
||||||
|
|
||||||
int ShaderLocalMemoryHighSize = ReadBits(CommonWord2, 0, 24);
|
ShaderLocalMemoryHighSize = ReadBits(CommonWord2, 0, 24);
|
||||||
int ThreadsPerInputPrimitive = ReadBits(CommonWord2, 24, 8);
|
ThreadsPerInputPrimitive = ReadBits(CommonWord2, 24, 8);
|
||||||
|
|
||||||
int ShaderLocalMemoryCrsSize = ReadBits(CommonWord3, 0, 24);
|
ShaderLocalMemoryCrsSize = ReadBits(CommonWord3, 0, 24);
|
||||||
OutputTopology = ReadBits(CommonWord3, 24, 4);
|
OutputTopology = ReadBits(CommonWord3, 24, 4);
|
||||||
|
|
||||||
MaxOutputVertexCount = ReadBits(CommonWord4, 0, 12);
|
MaxOutputVertexCount = ReadBits(CommonWord4, 0, 12);
|
||||||
int StoreReqStart = ReadBits(CommonWord4, 12, 8);
|
StoreReqStart = ReadBits(CommonWord4, 12, 8);
|
||||||
int StoreReqEnd = ReadBits(CommonWord4, 24, 8);
|
StoreReqEnd = ReadBits(CommonWord4, 24, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int ReadBits(uint Word, int Offset, int BitWidth)
|
private static int ReadBits(uint Word, int Offset, int BitWidth)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue