aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs26
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);
}