diff --git a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index fd9a1e83b..431042c9c 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -185,6 +185,16 @@ namespace Ryujinx.Graphics.Gpu.Image if (texture == null) { + // A pool index may point at an uninitialized guest heap slot. Validate the + // descriptor address before decoding format, dimensions, or layout fields. + ulong address = descriptor.UnpackAddress(); + + if (address == 0 || !_channel.MemoryManager.IsMapped(address)) + { + _invalidMap.Set(id); + return ref descriptor; + } + if (_invalidMap.IsSet(id)) { return ref descriptor; diff --git a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs index 2511f5711..8971e1eb9 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs @@ -54,6 +54,12 @@ namespace Ryujinx.Graphics.Vulkan public void SetSamplers(int index, ISampler[] samplers) { + // Buffer textures use VkBufferView descriptors and do not have samplers. + if (_isBuffer) + { + return; + } + for (int i = 0; i < samplers.Length; i++) { ISampler sampler = samplers[i]; @@ -109,6 +115,13 @@ namespace Ryujinx.Graphics.Vulkan public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags) { + // Texture-buffer arrays contain buffer views rather than image TextureStorage refs. + // Buffer synchronization is handled when BufferManager binds their storage. + if (_isBuffer) + { + return; + } + HashSet storages = _storages; if (storages == null)