aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-05-26 13:30:19 -0300
committerGitHub <noreply@github.com>2024-05-26 13:30:19 -0300
commit53d096e392d85106a41d8edad1dcda5cce7446a2 (patch)
tree38fcf4a50e666c96c5c0ea133201f0b390bd14eb /src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs
parent4cc00bb4b1b777734151cab5570d622fbfefa49f (diff)
Allow texture arrays to use separate descriptor sets on Vulkan (#6870)
* Report base and extra sets from the backend * Pass texture set index everywhere * Key textures using set and binding (rather than just binding) * Start using extra sets for array textures * Shader cache version bump * Separate new commands, some PR feedback * Introduce new manual descriptor set reservation method that prevents it from being used by something else while owned by an array * Move bind extra sets logic to new method * Should only use separate array is MaximumExtraSets is not zero * Format whitespace
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs91
1 files changed, 77 insertions, 14 deletions
diff --git a/src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs b/src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs
index 9e314c62..5bdbb002 100644
--- a/src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs
+++ b/src/Ryujinx.Graphics.Shader/Translation/EmitterContextInsts.cs
@@ -618,12 +618,21 @@ namespace Ryujinx.Graphics.Shader.Translation
SamplerType type,
TextureFormat format,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
Operand[] sources)
{
Operand dest = Local();
- context.Add(new TextureOperation(Instruction.ImageAtomic, type, format, flags, binding, 0, new[] { dest }, sources));
+ context.Add(new TextureOperation(
+ Instruction.ImageAtomic,
+ type,
+ format,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ 0,
+ new[] { dest },
+ sources));
return dest;
}
@@ -633,12 +642,21 @@ namespace Ryujinx.Graphics.Shader.Translation
SamplerType type,
TextureFormat format,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
int compMask,
Operand[] dests,
Operand[] sources)
{
- context.Add(new TextureOperation(Instruction.ImageLoad, type, format, flags, binding, compMask, dests, sources));
+ context.Add(new TextureOperation(
+ Instruction.ImageLoad,
+ type,
+ format,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ compMask,
+ dests,
+ sources));
}
public static void ImageStore(
@@ -646,10 +664,19 @@ namespace Ryujinx.Graphics.Shader.Translation
SamplerType type,
TextureFormat format,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
Operand[] sources)
{
- context.Add(new TextureOperation(Instruction.ImageStore, type, format, flags, binding, 0, null, sources));
+ context.Add(new TextureOperation(
+ Instruction.ImageStore,
+ type,
+ format,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ 0,
+ null,
+ sources));
}
public static Operand IsNan(this EmitterContext context, Operand a, Instruction fpType = Instruction.FP32)
@@ -718,13 +745,22 @@ namespace Ryujinx.Graphics.Shader.Translation
this EmitterContext context,
SamplerType type,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
int compIndex,
Operand[] sources)
{
Operand dest = Local();
- context.Add(new TextureOperation(Instruction.Lod, type, TextureFormat.Unknown, flags, binding, compIndex, new[] { dest }, sources));
+ context.Add(new TextureOperation(
+ Instruction.Lod,
+ type,
+ TextureFormat.Unknown,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ compIndex,
+ new[] { dest },
+ sources));
return dest;
}
@@ -889,24 +925,42 @@ namespace Ryujinx.Graphics.Shader.Translation
this EmitterContext context,
SamplerType type,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
int compMask,
Operand[] dests,
Operand[] sources)
{
- context.Add(new TextureOperation(Instruction.TextureSample, type, TextureFormat.Unknown, flags, binding, compMask, dests, sources));
+ context.Add(new TextureOperation(
+ Instruction.TextureSample,
+ type,
+ TextureFormat.Unknown,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ compMask,
+ dests,
+ sources));
}
public static Operand TextureQuerySamples(
this EmitterContext context,
SamplerType type,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
Operand[] sources)
{
Operand dest = Local();
- context.Add(new TextureOperation(Instruction.TextureQuerySamples, type, TextureFormat.Unknown, flags, binding, 0, new[] { dest }, sources));
+ context.Add(new TextureOperation(
+ Instruction.TextureQuerySamples,
+ type,
+ TextureFormat.Unknown,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ 0,
+ new[] { dest },
+ sources));
return dest;
}
@@ -915,13 +969,22 @@ namespace Ryujinx.Graphics.Shader.Translation
this EmitterContext context,
SamplerType type,
TextureFlags flags,
- int binding,
+ SetBindingPair setAndBinding,
int compIndex,
Operand[] sources)
{
Operand dest = Local();
- context.Add(new TextureOperation(Instruction.TextureQuerySize, type, TextureFormat.Unknown, flags, binding, compIndex, new[] { dest }, sources));
+ context.Add(new TextureOperation(
+ Instruction.TextureQuerySize,
+ type,
+ TextureFormat.Unknown,
+ flags,
+ setAndBinding.SetIndex,
+ setAndBinding.Binding,
+ compIndex,
+ new[] { dest },
+ sources));
return dest;
}