diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-11-10 13:38:38 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 13:38:38 -0300 |
commit | a6a67a2b7add9a9dc8c4f0bab730957b8ebaf6e8 (patch) | |
tree | 55bf091161239e653d7c5b0eea03d4201835911d /Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs | |
parent | c6d05301aae7509ea6a1ec29d39a72bac94d80b0 (diff) |
Minor improvement to Vulkan pipeline state and bindings management (#3829)1.1.340
* Minor improvement to Vulkan pipeline state and bindings management
* Clean up buffer textures too
* Use glBindTextureUnit
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs b/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs index 9e372311..e0d5d286 100644 --- a/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs +++ b/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs @@ -138,11 +138,6 @@ namespace Ryujinx.Graphics.Vulkan public void SetImage(int binding, ITexture image, GAL.Format imageFormat) { - if (image == null) - { - return; - } - if (image is TextureBuffer imageBuffer) { _bufferImageRefs[binding] = imageBuffer; @@ -152,6 +147,12 @@ namespace Ryujinx.Graphics.Vulkan { _imageRefs[binding] = view.GetView(imageFormat).GetIdentityImageView(); } + else + { + _imageRefs[binding] = null; + _bufferImageRefs[binding] = null; + _bufferImageFormats[binding] = default; + } SignalDirty(DirtyFlags.Image); } @@ -215,24 +216,23 @@ namespace Ryujinx.Graphics.Vulkan public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler) { - if (texture == null) - { - return; - } - if (texture is TextureBuffer textureBuffer) { _bufferTextureRefs[binding] = textureBuffer; } - else + else if (texture is TextureView view) { - TextureView view = (TextureView)texture; - view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags()); _textureRefs[binding] = view.GetImageView(); _samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler(); } + else + { + _textureRefs[binding] = null; + _samplerRefs[binding] = null; + _bufferTextureRefs[binding] = null; + } SignalDirty(DirtyFlags.Texture); } |