aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs')
-rw-r--r--src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
index ab3befd8..a47ea5ff 100644
--- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
+++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
@@ -228,7 +228,12 @@ namespace Ryujinx.Graphics.Vulkan
SignalDirty(DirtyFlags.Storage);
}
- public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler)
+ public void SetTextureAndSampler(
+ CommandBufferScoped cbs,
+ ShaderStage stage,
+ int binding,
+ ITexture texture,
+ ISampler sampler)
{
if (texture is TextureBuffer textureBuffer)
{
@@ -251,6 +256,28 @@ namespace Ryujinx.Graphics.Vulkan
SignalDirty(DirtyFlags.Texture);
}
+ public void SetTextureAndSamplerIdentitySwizzle(
+ CommandBufferScoped cbs,
+ ShaderStage stage,
+ int binding,
+ ITexture texture,
+ ISampler sampler)
+ {
+ if (texture is TextureView view)
+ {
+ view.Storage.InsertWriteToReadBarrier(cbs, AccessFlags.ShaderReadBit, stage.ConvertToPipelineStageFlags());
+
+ _textureRefs[binding] = view.GetIdentityImageView();
+ _samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
+
+ SignalDirty(DirtyFlags.Texture);
+ }
+ else
+ {
+ SetTextureAndSampler(cbs, stage, binding, texture, sampler);
+ }
+ }
+
public void SetUniformBuffers(CommandBuffer commandBuffer, ReadOnlySpan<BufferAssignment> buffers)
{
for (int i = 0; i < buffers.Length; i++)