Address feedback

This commit is contained in:
ReinUsesLisp 2018-07-18 17:46:27 -03:00
parent 1c73f2b7ad
commit 07829010f1
3 changed files with 43 additions and 26 deletions

View file

@ -4,14 +4,13 @@ namespace Ryujinx.Graphics.Gal.Shader
{
class GlslDecl
{
public const int LayerAttr = 0x064;
public const int TessCoordAttrX = 0x2f0;
public const int TessCoordAttrY = 0x2f4;
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 LayerAttr = 0x64;
public const int MaxUboSize = 1024;

View file

@ -1223,10 +1223,10 @@ namespace Ryujinx.Graphics.Gal.Shader
switch (Node)
{
case ShaderIrOperAbuf Abuf:
return Abuf.Offs == GlslDecl.VertexIdAttr ||
return Abuf.Offs == GlslDecl.LayerAttr ||
Abuf.Offs == GlslDecl.InstanceIdAttr ||
Abuf.Offs == GlslDecl.FaceAttr ||
Abuf.Offs == GlslDecl.LayerAttr
Abuf.Offs == GlslDecl.VertexIdAttr ||
Abuf.Offs == GlslDecl.FaceAttr
? OperType.I32
: OperType.F32;

View file

@ -6,11 +6,29 @@
public const int LineStrip = 6;
public const int TriangleStrip = 7;
public int ShaderType { get; private set; }
public int SphType { get; private set; }
public int Version { 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 OutputTopology { 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 MaxOutputVertexCount { get; private set; }
public int StoreReqStart { get; private set; }
public int StoreReqEnd { get; private set; }
public ShaderHeader(IGalMemory Memory, long Position)
{
@ -20,29 +38,29 @@
uint CommonWord3 = (uint)Memory.ReadInt32(Position + 12);
uint CommonWord4 = (uint)Memory.ReadInt32(Position + 16);
int SphType = ReadBits(CommonWord0, 0, 5);
int Version = ReadBits(CommonWord0, 5, 5);
ShaderType = ReadBits(CommonWord0, 10, 4);
bool MrtEnable = ReadBits(CommonWord0, 14, 1) != 0;
bool KillsPixels = ReadBits(CommonWord0, 15, 1) != 0;
bool DoesGlobalStore = ReadBits(CommonWord0, 16, 1) != 0;
int SassVersion = ReadBits(CommonWord0, 17, 4);
bool DoesLoadOrStore = ReadBits(CommonWord0, 26, 1) != 0;
bool DoesFp64 = ReadBits(CommonWord0, 27, 1) != 0;
int StreamOutMask = ReadBits(CommonWord0, 28, 4);
SphType = ReadBits(CommonWord0, 0, 5);
Version = ReadBits(CommonWord0, 5, 5);
ShaderType = ReadBits(CommonWord0, 10, 4);
MrtEnable = ReadBits(CommonWord0, 14, 1) != 0;
KillsPixels = ReadBits(CommonWord0, 15, 1) != 0;
DoesGlobalStore = ReadBits(CommonWord0, 16, 1) != 0;
SassVersion = ReadBits(CommonWord0, 17, 4);
DoesLoadOrStore = ReadBits(CommonWord0, 26, 1) != 0;
DoesFp64 = ReadBits(CommonWord0, 27, 1) != 0;
StreamOutMask = ReadBits(CommonWord0, 28, 4);
int ShaderLocalMemoryLowSize = ReadBits(CommonWord1, 0, 24);
int PerPatchAttributeCount = ReadBits(CommonWord1, 24, 8);
ShaderLocalMemoryLowSize = ReadBits(CommonWord1, 0, 24);
PerPatchAttributeCount = ReadBits(CommonWord1, 24, 8);
int ShaderLocalMemoryHighSize = ReadBits(CommonWord2, 0, 24);
int ThreadsPerInputPrimitive = ReadBits(CommonWord2, 24, 8);
ShaderLocalMemoryHighSize = ReadBits(CommonWord2, 0, 24);
ThreadsPerInputPrimitive = ReadBits(CommonWord2, 24, 8);
int ShaderLocalMemoryCrsSize = ReadBits(CommonWord3, 0, 24);
OutputTopology = ReadBits(CommonWord3, 24, 4);
ShaderLocalMemoryCrsSize = ReadBits(CommonWord3, 0, 24);
OutputTopology = ReadBits(CommonWord3, 24, 4);
MaxOutputVertexCount = ReadBits(CommonWord4, 0, 12);
int StoreReqStart = ReadBits(CommonWord4, 12, 8);
int StoreReqEnd = ReadBits(CommonWord4, 24, 8);
MaxOutputVertexCount = ReadBits(CommonWord4, 0, 12);
StoreReqStart = ReadBits(CommonWord4, 12, 8);
StoreReqEnd = ReadBits(CommonWord4, 24, 8);
}
private static int ReadBits(uint Word, int Offset, int BitWidth)