upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/vulkan_bindless.h
diff options
context:
space:
mode:
authorIAmNotSiob <273832158+IAmNotSiob@users.noreply.github.com>2026-11-22 17:31:21 +0100
committerIAmNotSiob <273832158+IAmNotSiob@users.noreply.github.com>2026-11-22 17:31:21 +0100
commit9b99a5f030cfd6c8bf96f0af2002dc939aa13b5b (patch)
tree3d2d0bfd501a978d00a12f755c8e5bc6eee12f32 /runtime/src/vulkan_bindless.h
parentfaa42a61c5ffb24fe4046a5336102bba996872e7 (diff)
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
Merge remote-tracking branch 'origin/main' into d3d12-queues-v2
# Conflicts: # runtime/test/vk_test_device.h
Diffstat (limited to 'runtime/src/vulkan_bindless.h')
-rw-r--r--runtime/src/vulkan_bindless.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/src/vulkan_bindless.h b/runtime/src/vulkan_bindless.h
index 9111f764c..5f484bf16 100644
--- a/runtime/src/vulkan_bindless.h
+++ b/runtime/src/vulkan_bindless.h
@@ -435,19 +435,21 @@ public:
435 result == DescriptorTable::InsertResult::added_with_relocation; 435 result == DescriptorTable::InsertResult::added_with_relocation;
436 return true; 436 return true;
437 } 437 }
438 // Erasing compacts the key's probe cluster, so other keys' entries may change slots. 438 // Erasing empties only the key's own slot; no other entry moves (DescriptorTable::erase), so it needs no idle.
439 // The caller erases a key once no submitted work uses it (its texture is gone), like D3D12 requires.
439 bool erase_key(const DescriptorKey& key) { 440 bool erase_key(const DescriptorKey& key) {
440 if (!table_.erase(key)) return false; 441 if (!table_.erase(key)) return false;
441 table_dirty_ = existing_entries_changed_ = true; 442 table_dirty_ = true;
442 return true; 443 return true;
443 } 444 }
444 const DescriptorTable& table() const { return table_; } 445 const DescriptorTable& table() const { return table_; }
445 446
446 // True when the next flush() will change entries a running shader may be probing, or replace the table's 447 // True when the next flush() will change entries a running shader may be probing (a live key's index replaced
447 // buffer: the caller then flushes only once no command buffer that uses the set is still executing. Without 448 // or a live key moved by a relocating insert), or replace the table's buffer: the caller then flushes only once
448 // it the flush only adds entries, and the copy of an entry is not atomic: a shader probing a different key 449 // no command buffer that uses the set is still executing. Without it the flush only adds entries or empties the
449 // could in principle see a torn entry that matches it, which is accepted as vanishingly unlikely because the 450 // slots of erased keys, and the copy of an entry is not atomic: a shader probing a different key could in
450 // added key is new (there is no live key equal to it). 451 // principle see a torn entry that matches it, which is accepted as vanishingly unlikely because the added or
452 // erased key is not live (no running work uses it).
451 bool flush_needs_idle() const { 453 bool flush_needs_idle() const {
452 return table_dirty_ && (existing_entries_changed_ || force_full_upload_ || 454 return table_dirty_ && (existing_entries_changed_ || force_full_upload_ ||
453 table_.size_bytes() > table_buffers_.table.size); 455 table_.size_bytes() > table_buffers_.table.size);