diff --git a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs index 47c180696..eaebf3581 100644 --- a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs +++ b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs @@ -53,27 +53,27 @@ namespace Ryujinx.Graphics.Vulkan public void SetImages(int index, ITexture[] images) { - for (int i = 0; i < images.Length; i++) + if (_isBuffer) { - ITexture image = images[i]; - - if (image is TextureBuffer textureBuffer) + for (int i = 0; i < images.Length; i++) { - _bufferTextureRefs[index + i] = textureBuffer; + _bufferTextureRefs[index + i] = images[i] as TextureBuffer; } - else if (image is TextureView view) + } + else + { + for (int i = 0; i < images.Length; i++) { - _textureRefs[index + i].Storage = view.Storage; - _textureRefs[index + i].View = view; - } - else if (!_isBuffer) - { - _textureRefs[index + i].Storage = null; - _textureRefs[index + i].View = default; - } - else - { - _bufferTextureRefs[index + i] = null; + if (images[i] is TextureView view) + { + _textureRefs[index + i].Storage = view.Storage; + _textureRefs[index + i].View = view; + } + else + { + _textureRefs[index + i].Storage = null; + _textureRefs[index + i].View = default; + } } } @@ -89,6 +89,11 @@ namespace Ryujinx.Graphics.Vulkan public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags) { + if (_isBuffer) + { + return; + } + HashSet storages = _storages; if (storages == null) diff --git a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs index 2511f5711..444a74fa1 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs @@ -54,6 +54,11 @@ namespace Ryujinx.Graphics.Vulkan public void SetSamplers(int index, ISampler[] samplers) { + if (_isBuffer) + { + return; + } + for (int i = 0; i < samplers.Length; i++) { ISampler sampler = samplers[i]; @@ -73,27 +78,27 @@ namespace Ryujinx.Graphics.Vulkan public void SetTextures(int index, ITexture[] textures) { - for (int i = 0; i < textures.Length; i++) + if (_isBuffer) { - ITexture texture = textures[i]; - - if (texture is TextureBuffer textureBuffer) + for (int i = 0; i < textures.Length; i++) { - _bufferTextureRefs[index + i] = textureBuffer; + _bufferTextureRefs[index + i] = textures[i] as TextureBuffer; } - else if (texture is TextureView view) + } + else + { + for (int i = 0; i < textures.Length; i++) { - _textureRefs[index + i].Storage = view.Storage; - _textureRefs[index + i].View = view.GetImageView(); - } - else if (!_isBuffer) - { - _textureRefs[index + i].Storage = null; - _textureRefs[index + i].View = default; - } - else - { - _bufferTextureRefs[index + i] = null; + if (textures[i] is TextureView view) + { + _textureRefs[index + i].Storage = view.Storage; + _textureRefs[index + i].View = view.GetImageView(); + } + else + { + _textureRefs[index + i].Storage = null; + _textureRefs[index + i].View = default; + } } } @@ -109,6 +114,11 @@ namespace Ryujinx.Graphics.Vulkan public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags) { + if (_isBuffer) + { + return; + } + HashSet storages = _storages; if (storages == null)