AOFFI => AOffI

This commit is contained in:
Thog 2018-12-05 13:15:19 +01:00
commit 8a3a128ecb
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
4 changed files with 17 additions and 18 deletions

View file

@ -1253,7 +1253,7 @@ namespace Ryujinx.Graphics.Gal.Shader
Lod = GetOperExpr(Op, Meta.LevelOfDetail); Lod = GetOperExpr(Op, Meta.LevelOfDetail);
} }
if ((Suffix & TextureInstructionSuffix.AOFFI) != 0) if ((Suffix & TextureInstructionSuffix.AOffI) != 0)
{ {
return "texelFetchOffset(" + Sampler + ", " + Coords + ", " + Lod + ", " + GetOperExpr(Op, Meta.Offset) + ")." + Ch; return "texelFetchOffset(" + Sampler + ", " + Coords + ", " + Lod + ", " + GetOperExpr(Op, Meta.Offset) + ")." + Ch;
} }
@ -1436,7 +1436,7 @@ namespace Ryujinx.Graphics.Gal.Shader
} }
// TODO: Support AOFFI // TODO: Support AOFFI
if ((Suffix & TextureInstructionSuffix.AOFFI) != 0) if ((Suffix & TextureInstructionSuffix.AOffI) != 0)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
@ -1460,7 +1460,7 @@ namespace Ryujinx.Graphics.Gal.Shader
// TODO: Support LBA and LLA // TODO: Support LBA and LLA
if ((Suffix & TextureInstructionSuffix.LZ) != 0) if ((Suffix & TextureInstructionSuffix.LZ) != 0)
{ {
if ((Suffix & TextureInstructionSuffix.AOFFI) != 0) if ((Suffix & TextureInstructionSuffix.AOffI) != 0)
{ {
string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))"); string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))");
@ -1471,7 +1471,7 @@ namespace Ryujinx.Graphics.Gal.Shader
} }
else if ((Suffix & TextureInstructionSuffix.LB) != 0) else if ((Suffix & TextureInstructionSuffix.LB) != 0)
{ {
if ((Suffix & TextureInstructionSuffix.AOFFI) != 0) if ((Suffix & TextureInstructionSuffix.AOffI) != 0)
{ {
string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))"); string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))");
@ -1482,7 +1482,7 @@ namespace Ryujinx.Graphics.Gal.Shader
} }
else if ((Suffix & TextureInstructionSuffix.LL) != 0) else if ((Suffix & TextureInstructionSuffix.LL) != 0)
{ {
if ((Suffix & TextureInstructionSuffix.AOFFI) != 0) if ((Suffix & TextureInstructionSuffix.AOffI) != 0)
{ {
string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))"); string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))");
@ -1491,7 +1491,7 @@ namespace Ryujinx.Graphics.Gal.Shader
return "textureLod(" + Sampler + ", " + Coords + ", " + GetOperExpr(Op, Meta.LevelOfDetail) + ")" + ChString; return "textureLod(" + Sampler + ", " + Coords + ", " + GetOperExpr(Op, Meta.LevelOfDetail) + ")" + ChString;
} }
else if (Suffix == TextureInstructionSuffix.AOFFI) else if (Suffix == TextureInstructionSuffix.AOffI)
{ {
string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))"); string Offset = GetTextureOffset(Meta, "floatBitsToInt((" + GetOperExpr(Op, Meta.Offset) + "))");

View file

@ -232,7 +232,7 @@ namespace Ryujinx.Graphics.Gal.Shader
bool IsOffset = OpCode.Read(0x36); bool IsOffset = OpCode.Read(0x36);
if (IsOffset) if (IsOffset)
Suffix |= TextureInstructionSuffix.AOFFI; Suffix |= TextureInstructionSuffix.AOffI;
EmitTex(Block, OpCode, Suffix, GprHandle: false); EmitTex(Block, OpCode, Suffix, GprHandle: false);
} }
@ -270,7 +270,7 @@ namespace Ryujinx.Graphics.Gal.Shader
bool IsOffset = OpCode.Read(0x23); bool IsOffset = OpCode.Read(0x23);
if (IsOffset) if (IsOffset)
Suffix |= TextureInstructionSuffix.AOFFI; Suffix |= TextureInstructionSuffix.AOffI;
EmitTex(Block, OpCode, Suffix, GprHandle: true); EmitTex(Block, OpCode, Suffix, GprHandle: true);
} }
@ -338,7 +338,7 @@ namespace Ryujinx.Graphics.Gal.Shader
OperBIndex++; OperBIndex++;
} }
if ((TextureInstructionSuffix & TextureInstructionSuffix.AOFFI) != 0) if ((TextureInstructionSuffix & TextureInstructionSuffix.AOffI) != 0)
{ {
Offset = OpCode.Gpr20(); Offset = OpCode.Gpr20();
Offset.Index += OperBIndex; Offset.Index += OperBIndex;
@ -446,7 +446,7 @@ namespace Ryujinx.Graphics.Gal.Shader
case 0: case 0:
case 0x4: case 0x4:
case 0x8: case 0x8:
Suffix = TextureInstructionSuffix.LZ | TextureInstructionSuffix.AOFFI; Suffix = TextureInstructionSuffix.LZ | TextureInstructionSuffix.AOffI;
break; break;
case 0xc: case 0xc:
Suffix = TextureInstructionSuffix.LZ | TextureInstructionSuffix.MZ; Suffix = TextureInstructionSuffix.LZ | TextureInstructionSuffix.MZ;
@ -460,7 +460,7 @@ namespace Ryujinx.Graphics.Gal.Shader
Suffix = TextureInstructionSuffix.LL; Suffix = TextureInstructionSuffix.LL;
break; break;
case 0x18: case 0x18:
Suffix = TextureInstructionSuffix.LL | TextureInstructionSuffix.AOFFI; Suffix = TextureInstructionSuffix.LL | TextureInstructionSuffix.AOffI;
break; break;
default: default:
throw new InvalidOperationException($"Invalid Suffix for TLDS instruction {RawSuffix}"); throw new InvalidOperationException($"Invalid Suffix for TLDS instruction {RawSuffix}");
@ -483,7 +483,7 @@ namespace Ryujinx.Graphics.Gal.Shader
Suffix = TextureInstructionSuffix.None; Suffix = TextureInstructionSuffix.None;
break; break;
case 0x4: case 0x4:
Suffix = TextureInstructionSuffix.AOFFI; Suffix = TextureInstructionSuffix.AOffI;
break; break;
case 0x8: case 0x8:
Suffix = TextureInstructionSuffix.PTP; Suffix = TextureInstructionSuffix.PTP;
@ -516,7 +516,7 @@ namespace Ryujinx.Graphics.Gal.Shader
if (IsOffset) if (IsOffset)
{ {
Suffix |= TextureInstructionSuffix.AOFFI; Suffix |= TextureInstructionSuffix.AOffI;
} }
if (IsShadow) if (IsShadow)
@ -612,7 +612,7 @@ namespace Ryujinx.Graphics.Gal.Shader
OperBIndex++; OperBIndex++;
} }
if ((TextureInstructionSuffix & TextureInstructionSuffix.AOFFI) != 0) if ((TextureInstructionSuffix & TextureInstructionSuffix.AOffI) != 0)
{ {
Offset = OpCode.Gpr20(); Offset = OpCode.Gpr20();
Offset.Index += OperBIndex; Offset.Index += OperBIndex;
@ -806,7 +806,7 @@ namespace Ryujinx.Graphics.Gal.Shader
} }
} }
if ((TextureInstructionSuffix & TextureInstructionSuffix.AOFFI) != 0) if ((TextureInstructionSuffix & TextureInstructionSuffix.AOffI) != 0)
{ {
Offset = OpCode.Gpr20(); Offset = OpCode.Gpr20();
Offset.Index += OperBIndex; Offset.Index += OperBIndex;

View file

@ -1,10 +1,9 @@
using ChocolArm64.Memory; using ChocolArm64.Memory;
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Memory; using Ryujinx.Graphics.Memory;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using OpenTK.Graphics.OpenGL;
using System.Diagnostics;
namespace Ryujinx.Graphics.Texture namespace Ryujinx.Graphics.Texture
{ {

View file

@ -12,7 +12,7 @@ namespace Ryujinx.Graphics.Texture
LBA = 0x20, // Load Bias with OperA? Auto? LBA = 0x20, // Load Bias with OperA? Auto?
LLA = 0x40, // Load LOD with OperA? Auto? LLA = 0x40, // Load LOD with OperA? Auto?
DC = 0x80, // Depth Compare DC = 0x80, // Depth Compare
AOFFI = 0x100, // Offset AOffI = 0x100, // Offset
MZ = 0x200, // Multisample Zero? MZ = 0x200, // Multisample Zero?
PTP = 0x400 // ??? PTP = 0x400 // ???
} }