diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-05-19 18:15:26 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-19 23:15:26 +0200 |
| commit | 49745cfa37b247c3e49bfae126bafbe41e166bc6 (patch) | |
| tree | 1a37f2f2c23791244b22529f6e228f008f984409 /Ryujinx.Graphics.Shader/Instructions | |
| parent | b5c72b44dee2fd977d7cca5aa3c29ef1e2286aa7 (diff) | |
Move shader resource descriptor creation out of the backend (#2290)
* Move shader resource descriptor creation out of the backend
* Remove now unused code, and other nits
* Shader cache version bump
* Nits
* Set format for bindless image load/store
* Fix buffer write flag
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs | 12 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs | 30 |
2 files changed, 21 insertions, 21 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs index 352d16c0..5a351c73 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs @@ -82,7 +82,9 @@ namespace Ryujinx.Graphics.Shader.Instructions switch (context.CurrOp) { case IOpCodeCbuf op: - return context.PackDouble2x32(Cbuf(op.Slot, op.Offset), Cbuf(op.Slot, op.Offset + 1)); + return context.PackDouble2x32( + context.Config.CreateCbuf(op.Slot, op.Offset), + context.Config.CreateCbuf(op.Slot, op.Offset + 1)); case IOpCodeImmF op: return context.FP32ConvertToFP64(ConstF(op.Immediate)); @@ -99,7 +101,7 @@ namespace Ryujinx.Graphics.Shader.Instructions switch (context.CurrOp) { case IOpCodeCbuf op: - return Cbuf(op.Slot, op.Offset); + return context.Config.CreateCbuf(op.Slot, op.Offset); case IOpCodeImm op: return Const(op.Immediate); @@ -125,7 +127,9 @@ namespace Ryujinx.Graphics.Shader.Instructions switch (context.CurrOp) { case IOpCodeRegCbuf op: - return context.PackDouble2x32(Cbuf(op.Slot, op.Offset), Cbuf(op.Slot, op.Offset + 1)); + return context.PackDouble2x32( + context.Config.CreateCbuf(op.Slot, op.Offset), + context.Config.CreateCbuf(op.Slot, op.Offset + 1)); case IOpCodeRc op: return context.PackDouble2x32(Register(op.Rc.Index, op.Rc.Type), Register(op.Rc.Index | 1, op.Rc.Type)); @@ -136,7 +140,7 @@ namespace Ryujinx.Graphics.Shader.Instructions switch (context.CurrOp) { case IOpCodeRegCbuf op: - return Cbuf(op.Slot, op.Offset); + return context.Config.CreateCbuf(op.Slot, op.Offset); case IOpCodeRc op: return Register(op.Rc); diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs index a3906294..69d3ffb3 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs @@ -95,7 +95,7 @@ namespace Ryujinx.Graphics.Shader.Instructions Operand rd = Register(rdIndex++, RegisterType.Gpr); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.ImageLoad, type, flags, @@ -132,17 +132,15 @@ namespace Ryujinx.Graphics.Shader.Instructions Operand rd = Register(rdIndex++, RegisterType.Gpr); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.ImageLoad, type, + GetTextureFormat(op.Size), flags, handle, compIndex, rd, - sources) - { - Format = GetTextureFormat(op.Size) - }; + sources); context.Add(operation); @@ -266,17 +264,15 @@ namespace Ryujinx.Graphics.Shader.Instructions TextureFlags flags = op.IsBindless ? TextureFlags.Bindless : TextureFlags.None; - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.ImageStore, type, + format, flags, handle, 0, null, - sources) - { - Format = format - }; + sources); context.Add(operation); } @@ -615,7 +611,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand dest = GetDest(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.TextureSample, type, flags, @@ -764,7 +760,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand dest = GetDest(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.TextureSample, type, flags, @@ -888,7 +884,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand tempDest = Local(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.Lod, type, flags, @@ -1027,7 +1023,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand dest = GetDest(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.TextureSample, type, flags, @@ -1112,7 +1108,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand dest = GetDest(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( inst, type, flags, @@ -1277,7 +1273,7 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand dest = GetDest(); - TextureOperation operation = new TextureOperation( + TextureOperation operation = context.CreateTextureOperation( Instruction.TextureSample, type, flags, |
