Commit Graph

2 Commits

Author SHA1 Message Date
9f98dcc617 Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
Fall back to a dedicated buffer allocation when the shared arena fills.
Update console descriptors and resource backing, preserve pipeline cache
entries, and replay mesh records using bounded indirect arguments. Keep
scripted input available until read and cover the runtime and translator
paths with synthetic tests.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 14:30:51 -06:00
9428f57da2 runtime: share indirect clamp buffers across queue families and fix safety bugs
Pass device queue families into IndirectArgumentClamp and its ScratchBuffers so both clamped-argument scratch chunks and HostArea counter buffers are created with VK_SHARING_MODE_CONCURRENT when graphics and async-compute families differ (matching enable_copy_scratch).

Also fix four safety/correctness issues in runtime/src/vulkan_indirect_clamp.h:
- Free VkDeviceMemory before retrying the next memory type when vkBindBufferMemory fails in make_area(), and guard vector push_back against allocation failure.
- Zero released HostArea counter words after reading them so a later aborted/unsubmitted batch reusing the same slot never double-counts prior counters.
- Reject non-4-byte-aligned argument_offset and count_offset in prepare() (the compute clamp reads uint32 words via BDA).
- Read areas_[slot.area].buffer under mutex_ in prepare().

Item ID: RT-INDIRECT-CLAMP-SHARING-AND-SAFETY
Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162686562
2026-11-25 13:46:01 +01:00