mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-02 01:12:25 -07:00
Rewrite shader decoding stage (#2698)
* Rewrite shader decoding stage * Fix P2R constant buffer encoding * Fix PSET/PSETP * PR feedback * Log unimplemented shader instructions * Implement NOP * Remove using * PR feedback
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Ryujinx.Graphics.Shader.Decoders;
|
||||
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using static Ryujinx.Graphics.Shader.IntermediateRepresentation.OperandHelper;
|
||||
|
||||
@@ -9,7 +11,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
class EmitterContext
|
||||
{
|
||||
public Block CurrBlock { get; set; }
|
||||
public OpCode CurrOp { get; set; }
|
||||
public InstOp CurrOp { get; set; }
|
||||
|
||||
public ShaderConfig Config { get; }
|
||||
|
||||
@@ -30,6 +32,13 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
_labels = new Dictionary<ulong, Operand>();
|
||||
}
|
||||
|
||||
public T GetOp<T>() where T : unmanaged
|
||||
{
|
||||
Debug.Assert(Unsafe.SizeOf<T>() == sizeof(ulong));
|
||||
ulong op = CurrOp.RawOpCode;
|
||||
return Unsafe.As<ulong, T>(ref op);
|
||||
}
|
||||
|
||||
public Operand Add(Instruction inst, Operand dest = null, params Operand[] sources)
|
||||
{
|
||||
Operation operation = new Operation(inst, dest, sources);
|
||||
|
Reference in New Issue
Block a user