From 9632698c2c0eae52eb1873c097af5bb296e69b50 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Mon, 19 Aug 2024 12:00:28 +0200 Subject: [PATCH] [Vulkan] Hack the buffer hack even more --- .../Sources/kinc/backend/graphics5/constantbuffer.c.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/constantbuffer.c.h b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/constantbuffer.c.h index cfa98ab78..86cd674f1 100644 --- a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/constantbuffer.c.h +++ b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/constantbuffer.c.h @@ -48,6 +48,13 @@ void kinc_g5_constant_buffer_init(kinc_g5_constant_buffer_t *buffer, int size) { createUniformBuffer(&buffer->impl.buf, &buffer->impl.mem_alloc, &buffer->impl.mem, &buffer->impl.buffer_info, size); // buffer hack + if (vk_ctx.vertex_uniform_buffer != NULL && vk_ctx.fragment_uniform_buffer != NULL && vk_ctx.compute_uniform_buffer != NULL) { + // allow writing the buffers again after G4onG5 wrote them + vk_ctx.vertex_uniform_buffer = NULL; + vk_ctx.fragment_uniform_buffer = NULL; + vk_ctx.compute_uniform_buffer = NULL; + } + if (vk_ctx.vertex_uniform_buffer == NULL) { vk_ctx.vertex_uniform_buffer = &buffer->impl.buf; }