Commit graph

7 commits

Author SHA1 Message Date
Jakob Linke
e2952ee6db Fix NRE in Vulkan TextureArray/ImageArray for buffer-targeted arrays
When isBuffer=true the array allocates _bufferTextureRefs and leaves
_textureRefs null. SetSamplers and QueueWriteToReadBarriers dereferenced
_textureRefs unconditionally, and the TextureView branch of SetTextures
and SetImages did the same when a non-buffer view landed in a
buffer-targeted array. Reached in practice when shaders sample from
texel-buffer-typed array bindings with mixed contents.

Branch SetTextures and SetImages on _isBuffer first, then on input type.
A TextureView in a buffer-mode array, and a TextureBuffer in a
non-buffer-mode array, are both dropped to null. The latter was a
pre-existing mirror bug, unreached by current callers.

Early-return from SetSamplers and QueueWriteToReadBarriers for
buffer-mode arrays: texel-buffer descriptors carry no sampler state and
storage barriers do not apply.
2026-05-22 15:57:04 +02:00
Evan Husted
ed2590a8ac misc: chore: Use collection expressions in Vulkan project 2025-01-26 15:32:25 -06:00
Evan Husted
2d1a4c3ce5 misc: chore: Use explicit types in Vulkan project 2025-01-25 14:12:17 -06:00
gdkchan
460f9faf4e
Fix NRE when using buffer image array (#7159) 2024-08-21 00:49:17 +01:00
gdkchan
c0f2491eae
Vulkan separate descriptor set fixes (#6895)
* Ensure descriptor sets are only re-used when all command buffers using it have completed

* Fix some SPIR-V capabilities

* Set update after bind flag if we exceed limits

* Simpler fix for Intel

* Format whitespace

* Make struct readonly

* Add barriers for extra set arrays too
2024-06-02 22:40:28 -03:00
gdkchan
53d096e392
Allow texture arrays to use separate descriptor sets on Vulkan (#6870)
* Report base and extra sets from the backend

* Pass texture set index everywhere

* Key textures using set and binding (rather than just binding)

* Start using extra sets for array textures

* Shader cache version bump

* Separate new commands, some PR feedback

* Introduce new manual descriptor set reservation method that prevents it from being used by something else while owned by an array

* Move bind extra sets logic to new method

* Should only use separate array is MaximumExtraSets is not zero

* Format whitespace
2024-05-26 13:30:19 -03:00
gdkchan
3e6e0e4afa
Add support for large sampler arrays on Vulkan (#6489)
* Add support for large sampler arrays on Vulkan

* Shader cache version bump

* Format whitespace

* Move DescriptorSetManager to PipelineLayoutCacheEntry to allow different pool sizes per layout

* Handle array textures with different types on the same buffer

* Somewhat better caching system

* Avoid useless buffer data modification checks

* Move redundant bindings update checking to the backend

* Fix an issue where texture arrays would get the same bindings across stages on Vulkan

* Backport some fixes from part 2

* Fix typo

* PR feedback

* Format whitespace

* Add some missing XML docs
2024-04-07 18:25:55 -03:00