aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs27
-rw-r--r--src/Ryujinx.Graphics.Vulkan/ImageArray.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/ResourceArray.cs11
-rw-r--r--src/Ryujinx.Graphics.Vulkan/TextureArray.cs2
4 files changed, 29 insertions, 13 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
index 01e34c777..8b9243b1e 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
@@ -340,7 +340,7 @@ namespace Ryujinx.Graphics.Gpu.Image
340 /// <returns>True if any used entries of the pool might have been modified, false otherwise</returns> 340 /// <returns>True if any used entries of the pool might have been modified, false otherwise</returns>
341 public bool SamplerPoolModified() 341 public bool SamplerPoolModified()
342 { 342 {
343 return SamplerPool.WasModified(ref _samplerPoolSequence); 343 return SamplerPool != null && SamplerPool.WasModified(ref _samplerPoolSequence);
344 } 344 }
345 } 345 }
346 346
@@ -516,12 +516,15 @@ namespace Ryujinx.Graphics.Gpu.Image
516 } 516 }
517 517
518 // Check if any of our cached samplers changed on the pool. 518 // Check if any of our cached samplers changed on the pool.
519 foreach ((int samplerId, (Sampler sampler, SamplerDescriptor descriptor)) in SamplerIds) 519 if (SamplerPool != null)
520 { 520 {
521 if (SamplerPool.GetCachedItem(samplerId) != sampler || 521 foreach ((int samplerId, (Sampler sampler, SamplerDescriptor descriptor)) in SamplerIds)
522 (sampler == null && SamplerPool.IsValidId(samplerId) && !SamplerPool.GetDescriptorRef(samplerId).Equals(descriptor)))
523 { 522 {
524 return true; 523 if (SamplerPool.GetCachedItem(samplerId) != sampler ||
524 (sampler == null && SamplerPool.IsValidId(samplerId) && !SamplerPool.GetDescriptorRef(samplerId).Equals(descriptor)))
525 {
526 return true;
527 }
525 } 528 }
526 } 529 }
527 530
@@ -899,13 +902,19 @@ namespace Ryujinx.Graphics.Gpu.Image
899 } 902 }
900 } 903 }
901 904
902 Sampler sampler = samplerPool?.Get(samplerId);
903
904 entry.TextureIds[textureId] = (texture, descriptor); 905 entry.TextureIds[textureId] = (texture, descriptor);
905 entry.SamplerIds[samplerId] = (sampler, samplerPool?.GetDescriptorRef(samplerId) ?? default);
906 906
907 ITexture hostTexture = texture?.GetTargetTexture(bindingInfo.Target); 907 ITexture hostTexture = texture?.GetTargetTexture(bindingInfo.Target);
908 ISampler hostSampler = sampler?.GetHostSampler(texture); 908 ISampler hostSampler = null;
909
910 if (!isImage && bindingInfo.Target != Target.TextureBuffer)
911 {
912 Sampler sampler = samplerPool?.Get(samplerId);
913
914 entry.SamplerIds[samplerId] = (sampler, samplerPool?.GetDescriptorRef(samplerId) ?? default);
915
916 hostSampler = sampler?.GetHostSampler(texture);
917 }
909 918
910 Format format = bindingInfo.Format; 919 Format format = bindingInfo.Format;
911 920
diff --git a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs
index e42750d3c..467b01111 100644
--- a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs
+++ b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs
@@ -95,7 +95,7 @@ namespace Ryujinx.Graphics.Vulkan
95 { 95 {
96 _cachedCommandBufferIndex = -1; 96 _cachedCommandBufferIndex = -1;
97 _storages = null; 97 _storages = null;
98 SetDirty(_gd); 98 SetDirty(_gd, isImage: true);
99 } 99 }
100 100
101 public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags) 101 public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags)
diff --git a/src/Ryujinx.Graphics.Vulkan/ResourceArray.cs b/src/Ryujinx.Graphics.Vulkan/ResourceArray.cs
index 0880a10f0..f96b4a845 100644
--- a/src/Ryujinx.Graphics.Vulkan/ResourceArray.cs
+++ b/src/Ryujinx.Graphics.Vulkan/ResourceArray.cs
@@ -14,13 +14,20 @@ namespace Ryujinx.Graphics.Vulkan
14 14
15 private int _bindCount; 15 private int _bindCount;
16 16
17 protected void SetDirty(VulkanRenderer gd) 17 protected void SetDirty(VulkanRenderer gd, bool isImage)
18 { 18 {
19 ReleaseDescriptorSet(); 19 ReleaseDescriptorSet();
20 20
21 if (_bindCount != 0) 21 if (_bindCount != 0)
22 { 22 {
23 gd.PipelineInternal.ForceTextureDirty(); 23 if (isImage)
24 {
25 gd.PipelineInternal.ForceImageDirty();
26 }
27 else
28 {
29 gd.PipelineInternal.ForceTextureDirty();
30 }
24 } 31 }
25 } 32 }
26 33
diff --git a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs
index 31c408d64..99238b1f5 100644
--- a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs
+++ b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs
@@ -104,7 +104,7 @@ namespace Ryujinx.Graphics.Vulkan
104 { 104 {
105 _cachedCommandBufferIndex = -1; 105 _cachedCommandBufferIndex = -1;
106 _storages = null; 106 _storages = null;
107 SetDirty(_gd); 107 SetDirty(_gd, isImage: false);
108 } 108 }
109 109
110 public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags) 110 public void QueueWriteToReadBarriers(CommandBufferScoped cbs, PipelineStageFlags stageFlags)