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/Translation/EmitterContext.cs | |
| 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/Translation/EmitterContext.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/EmitterContext.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs index 9b220177..49a89374 100644 --- a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs +++ b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs @@ -53,6 +53,36 @@ namespace Ryujinx.Graphics.Shader.Translation _operations.Add(operation); } + public TextureOperation CreateTextureOperation( + Instruction inst, + SamplerType type, + TextureFlags flags, + int handle, + int compIndex, + Operand dest, + params Operand[] sources) + { + return CreateTextureOperation(inst, type, TextureFormat.Unknown, flags, handle, compIndex, dest, sources); + } + + public TextureOperation CreateTextureOperation( + Instruction inst, + SamplerType type, + TextureFormat format, + TextureFlags flags, + int handle, + int compIndex, + Operand dest, + params Operand[] sources) + { + if (!flags.HasFlag(TextureFlags.Bindless)) + { + Config.SetUsedTexture(inst, type, format, flags, TextureOperation.DefaultCbufSlot, handle); + } + + return new TextureOperation(inst, type, format, flags, handle, compIndex, dest, sources); + } + public void FlagAttributeRead(int attribute) { if (Config.Stage == ShaderStage.Vertex && attribute == AttributeConsts.InstanceId) |
