From 54337ce6a4a794fb54639a192cd429fb0b810601 Mon Sep 17 00:00:00 2001 From: DizzyMan1337 Date: Sun, 1 Nov 2026 00:16:47 +0800 Subject: [PATCH] Let DLAA copy the camera block out of the uniform snapshot buffer mv_pass copies the scene's camera block from the snapshot arena with vkCmdCopyBuffer, which needs VK_BUFFER_USAGE_TRANSFER_SRC_BIT on the source (VUID-vkCmdCopyBuffer-srcBuffer-00118). Reported by Lucas-blip-png in #228 and SchulzCode in #253. Co-Authored-By: Claude Opus 5.5 --- runtime/vk_usnap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/vk_usnap.c b/runtime/vk_usnap.c index 056fdf80..8d384afa 100644 --- a/runtime/vk_usnap.c +++ b/runtime/vk_usnap.c @@ -81,7 +81,8 @@ static Arena *arena_get(uint64_t need) { if (!a) rt_fatal("vk_usnap: out of memory"); a->size = need < ARENA_MIN ? ARENA_MIN : (need + (1u << 20) - 1) & ~(uint64_t)((1u << 20) - 1); VkBufferCreateInfo bi = {.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .size = a->size, - .usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT}; + // transfer source: DLAA copies the camera block out (vk_dlaa.c mv_pass) + .usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT}; // Device-local through the BAR when the device has it (the GPU reads constants on every draw), else host memory. VmaAllocationCreateInfo ai = {.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, .flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |