diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-05-18 18:16:03 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 18:16:03 -0300 |
commit | f864a490142c4da608dab8d2025fc18da857f93f (patch) | |
tree | 154a1fbe783b212a5ad53c2e81c9d2eef1bf0193 /src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs | |
parent | ecbf303266d78d7b4287ce4ea97d59107a05fb2f (diff) |
Fix Vulkan blit-like operations swizzle (#5003)1.1.805
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs | 29 |
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++) |