0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics.Shader/Decoders/OpCodeImage.cs
Mary 48f6570557
Salieri: shader cache (#1701)
Here come Salieri, my implementation of a disk shader cache!

"I'm sure you know why I named it that."
"It doesn't really mean anything."

This implementation collects shaders at runtime and cache them to be later compiled when starting a game.
2020-11-13 00:15:34 +01:00

47 lines
No EOL
1.4 KiB
C#

using Ryujinx.Graphics.Shader.Instructions;
namespace Ryujinx.Graphics.Shader.Decoders
{
class OpCodeImage : OpCodeTextureBase
{
public Register Ra { get; }
public Register Rb { get; }
public Register Rc { get; }
public ImageComponents Components { get; }
public IntegerSize Size { get; }
public bool ByteAddress { get; }
public ImageDimensions Dimensions { get; }
public bool UseComponents { get; }
public bool IsBindless { get; }
public new static OpCode Create(InstEmitter emitter, ulong address, long opCode) => new OpCodeImage(emitter, address, opCode);
public OpCodeImage(InstEmitter emitter, ulong address, long opCode) : base(emitter, address, opCode)
{
Ra = new Register(opCode.Extract(8, 8), RegisterType.Gpr);
Rb = new Register(opCode.Extract(0, 8), RegisterType.Gpr);
Rc = new Register(opCode.Extract(39, 8), RegisterType.Gpr);
UseComponents = !opCode.Extract(52);
if (UseComponents)
{
Components = (ImageComponents)opCode.Extract(20, 4);
}
else
{
Size = (IntegerSize)opCode.Extract(20, 4);
}
ByteAddress = opCode.Extract(23);
Dimensions = (ImageDimensions)opCode.Extract(33, 3);
IsBindless = !opCode.Extract(51);
}
}
}