mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-18 23:37:09 +01:00
d4187aaa9d
* (Re)Implement format reinterpretation, other changes * Implement writeback to guest memory, some refactoring * More refactoring, implement reinterpretation the old way again * Clean up * Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes * nit: Formatting * Address PR feedback
57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using System;
|
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
{
|
|
static partial class ShaderDecode
|
|
{
|
|
public static void Bra(ShaderIrBlock Block, long OpCode, int Position)
|
|
{
|
|
if ((OpCode & 0x20) != 0)
|
|
{
|
|
//This reads the target offset from the constant buffer.
|
|
//Almost impossible to support with GLSL.
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
ShaderIrOperImm Imm = new ShaderIrOperImm(Position + OpCode.Branch());
|
|
|
|
Block.AddNode(OpCode.PredNode(new ShaderIrOp(ShaderIrInst.Bra, Imm)));
|
|
}
|
|
|
|
public static void Exit(ShaderIrBlock Block, long OpCode, int Position)
|
|
{
|
|
int CCode = (int)OpCode & 0x1f;
|
|
|
|
//TODO: Figure out what the other condition codes mean...
|
|
if (CCode == 0xf)
|
|
{
|
|
Block.AddNode(OpCode.PredNode(new ShaderIrOp(ShaderIrInst.Exit)));
|
|
}
|
|
}
|
|
|
|
public static void Kil(ShaderIrBlock Block, long OpCode, int Position)
|
|
{
|
|
Block.AddNode(OpCode.PredNode(new ShaderIrOp(ShaderIrInst.Kil)));
|
|
}
|
|
|
|
public static void Ssy(ShaderIrBlock Block, long OpCode, int Position)
|
|
{
|
|
if ((OpCode & 0x20) != 0)
|
|
{
|
|
//This reads the target offset from the constant buffer.
|
|
//Almost impossible to support with GLSL.
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
ShaderIrOperImm Imm = new ShaderIrOperImm(Position + OpCode.Branch());
|
|
|
|
Block.AddNode(new ShaderIrOp(ShaderIrInst.Ssy, Imm));
|
|
}
|
|
|
|
public static void Sync(ShaderIrBlock Block, long OpCode, int Position)
|
|
{
|
|
//TODO: Implement Sync condition codes
|
|
Block.AddNode(OpCode.PredNode(new ShaderIrOp(ShaderIrInst.Sync)));
|
|
}
|
|
}
|
|
} |