Initial support for image stores, support texture sample on compute
This commit is contained in:
parent
717ace6f6e
commit
1b7d955195
44 changed files with 1053 additions and 497 deletions
11
Ryujinx.Graphics.Shader/Decoders/ImageComponents.cs
Normal file
11
Ryujinx.Graphics.Shader/Decoders/ImageComponents.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
enum ImageComponents
|
||||
{
|
||||
Red = 1 << 0,
|
||||
Green = 1 << 1,
|
||||
Blue = 1 << 2,
|
||||
Alpha = 1 << 3
|
||||
|
||||
}
|
||||
}
|
12
Ryujinx.Graphics.Shader/Decoders/ImageDimensions.cs
Normal file
12
Ryujinx.Graphics.Shader/Decoders/ImageDimensions.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
enum ImageDimensions
|
||||
{
|
||||
Image1D,
|
||||
ImageBuffer,
|
||||
Image1DArray,
|
||||
Image2D,
|
||||
Image2DArray,
|
||||
Image3D
|
||||
}
|
||||
}
|
48
Ryujinx.Graphics.Shader/Decoders/OpCodeImage.cs
Normal file
48
Ryujinx.Graphics.Shader/Decoders/OpCodeImage.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using Ryujinx.Graphics.Shader.Instructions;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
class OpCodeImage : OpCode
|
||||
{
|
||||
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 int Immediate { get; }
|
||||
|
||||
public bool UseComponents { get; }
|
||||
public bool IsBindless { get; }
|
||||
|
||||
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);
|
||||
|
||||
Immediate = opCode.Extract(36, 13);
|
||||
IsBindless = !opCode.Extract(51);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -143,6 +143,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
Set("111000101001xx", InstEmit.Ssy, typeof(OpCodeSsy));
|
||||
Set("1110111101010x", InstEmit.St, typeof(OpCodeMemory));
|
||||
Set("1110111011011x", InstEmit.Stg, typeof(OpCodeMemory));
|
||||
Set("11101011001xxx", InstEmit.Sust, typeof(OpCodeImage));
|
||||
Set("1111000011111x", InstEmit.Sync, typeof(OpCodeSync));
|
||||
Set("110000xxxx111x", InstEmit.Tex, typeof(OpCodeTex));
|
||||
Set("1101111010111x", InstEmit.TexB, typeof(OpCodeTexB));
|
||||
|
|
|
@ -2,14 +2,14 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
{
|
||||
enum TexelLoadTarget
|
||||
{
|
||||
Texture1DLodZero = 0x0,
|
||||
Texture1DLodLevel = 0x1,
|
||||
Texture2DLodZero = 0x2,
|
||||
Texture2DLodZeroOffset = 0x4,
|
||||
Texture2DLodLevel = 0x5,
|
||||
Texture1DLodZero = 0x0,
|
||||
Texture1DLodLevel = 0x1,
|
||||
Texture2DLodZero = 0x2,
|
||||
Texture2DLodZeroOffset = 0x4,
|
||||
Texture2DLodLevel = 0x5,
|
||||
Texture2DLodZeroMultisample = 0x6,
|
||||
Texture3DLodZero = 0x7,
|
||||
Texture2DArrayLodZero = 0x8,
|
||||
Texture2DLodLevelOffset = 0xc
|
||||
Texture3DLodZero = 0x7,
|
||||
Texture2DArrayLodZero = 0x8,
|
||||
Texture2DLodLevelOffset = 0xc
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue