some code clean up

This commit is contained in:
Thog 2018-11-29 11:41:43 +01:00
commit be47d4d16c
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
2 changed files with 0 additions and 21 deletions

View file

@ -271,9 +271,6 @@ namespace Ryujinx.Graphics.Gal.Shader
bool IsArray = OpCode.HasArray(); bool IsArray = OpCode.HasArray();
TextureType TextureType = TexToTextureType(OpCode.Read(28, 6), IsArray); TextureType TextureType = TexToTextureType(OpCode.Read(28, 6), IsArray);
Block.AddNode(new ShaderIrCmnt($"TextureType: {TextureType}"));
Block.AddNode(new ShaderIrCmnt($"TextureInstructionSuffix: {TextureInstructionSuffix}"));
Block.AddNode(new ShaderIrCmnt($"Array: {IsArray}"));
bool HasDepthCompare = OpCode.Read(0x32); bool HasDepthCompare = OpCode.Read(0x32);
@ -458,26 +455,15 @@ namespace Ryujinx.Graphics.Gal.Shader
private static void EmitTexs(ShaderIrBlock Block, long OpCode, ShaderIrInst Inst, TextureType TextureType, TextureInstructionSuffix TextureInstructionSuffix) private static void EmitTexs(ShaderIrBlock Block, long OpCode, ShaderIrInst Inst, TextureType TextureType, TextureInstructionSuffix TextureInstructionSuffix)
{ {
Block.AddNode(new ShaderIrCmnt($"TextureType: {TextureType}"));
Block.AddNode(new ShaderIrCmnt($"TextureInstructionSuffix: {TextureInstructionSuffix}"));
if (Inst == ShaderIrInst.Txlf && TextureType == TextureType.CubeArray) if (Inst == ShaderIrInst.Txlf && TextureType == TextureType.CubeArray)
{ {
throw new InvalidOperationException("TLDS instructions cannot use CUBE modifier!"); throw new InvalidOperationException("TLDS instructions cannot use CUBE modifier!");
} }
// This is the only array type that is known to be usable with TEXS
bool IsArray = ImageUtils.IsArray(TextureType); bool IsArray = ImageUtils.IsArray(TextureType);
ShaderIrOperGpr[] Coords = new ShaderIrOperGpr[ImageUtils.GetCoordsCountTextureType(TextureType)]; ShaderIrOperGpr[] Coords = new ShaderIrOperGpr[ImageUtils.GetCoordsCountTextureType(TextureType)];
if ((TextureInstructionSuffix & TextureInstructionSuffix.DC) != 0)
{
// TODO
//throw new NotImplementedException($"TEXS.DC isn't implemented yet");
}
ShaderIrOperGpr OperA = OpCode.Gpr8(); ShaderIrOperGpr OperA = OpCode.Gpr8();
ShaderIrOperGpr OperB = OpCode.Gpr20(); ShaderIrOperGpr OperB = OpCode.Gpr20();

View file

@ -229,7 +229,6 @@ namespace Ryujinx.Graphics.Texture
throw new NotImplementedException(Format.ToString()); throw new NotImplementedException(Format.ToString());
} }
// TODO: non 2d
public static byte[] ReadTexture(IMemory Memory, GalImage Image, long Position) public static byte[] ReadTexture(IMemory Memory, GalImage Image, long Position)
{ {
MemoryManager CpuMemory; MemoryManager CpuMemory;
@ -243,8 +242,6 @@ namespace Ryujinx.Graphics.Texture
CpuMemory = (MemoryManager)Memory; CpuMemory = (MemoryManager)Memory;
} }
//Debug.Assert(Image.TextureType == TextureType.TwoD, "non 2d texture read");
ISwizzle Swizzle = TextureHelper.GetSwizzle(Image); ISwizzle Swizzle = TextureHelper.GetSwizzle(Image);
ImageDescriptor Desc = GetImageDescriptor(Image.Format); ImageDescriptor Desc = GetImageDescriptor(Image.Format);
@ -278,7 +275,6 @@ namespace Ryujinx.Graphics.Texture
return Data; return Data;
} }
// TODO: non 2d
public static void WriteTexture(NvGpuVmm Vmm, GalImage Image, long Position, byte[] Data) public static void WriteTexture(NvGpuVmm Vmm, GalImage Image, long Position, byte[] Data)
{ {
ISwizzle Swizzle = TextureHelper.GetSwizzle(Image); ISwizzle Swizzle = TextureHelper.GetSwizzle(Image);
@ -291,8 +287,6 @@ namespace Ryujinx.Graphics.Texture
int InOffs = 0; int InOffs = 0;
//Debug.Assert(Image.TextureType == TextureType.TwoD, "non 2d texture write");
for (int Z = 0; Z < Depth; Z++) for (int Z = 0; Z < Depth; Z++)
for (int Y = 0; Y < Height; Y++) for (int Y = 0; Y < Height; Y++)
for (int X = 0; X < Width; X++) for (int X = 0; X < Width; X++)
@ -416,7 +410,6 @@ namespace Ryujinx.Graphics.Texture
return (Image.Width + AlignMask) & ~AlignMask; return (Image.Width + AlignMask) & ~AlignMask;
} }
// TODO: non 2d
public static (int Width, int Height, int Depth) GetImageSizeInBlocks(GalImage Image) public static (int Width, int Height, int Depth) GetImageSizeInBlocks(GalImage Image)
{ {
ImageDescriptor Desc = GetImageDescriptor(Image.Format); ImageDescriptor Desc = GetImageDescriptor(Image.Format);