From 63e66e81c56b9e3bf59437b75cd1867f415645c6 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 4 Dec 2023 23:19:13 +0900 Subject: [PATCH] [vulkan] Increase ring buffer size to 32 packets I'm still not happy with it being a compile time constant, but this takes care of the interlock between frames in flight... for now: it's fragile and really needs the excessive small-packet use in draw and lighting to be cleaned up. After discussion with Darian, I've decided to go with one big staging buffer (with lots of packets) shared between FiF as the large size will, in the end, be more flexible. --- include/QF/Vulkan/staging.h | 2 +- libs/video/renderer/vulkan/staging.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/QF/Vulkan/staging.h b/include/QF/Vulkan/staging.h index 8ed8c5cec..819fcd59e 100644 --- a/include/QF/Vulkan/staging.h +++ b/include/QF/Vulkan/staging.h @@ -17,7 +17,7 @@ typedef struct qfv_stagebuf_s { VkCommandPool cmdPool; VkBuffer buffer; VkDeviceMemory memory; - RING_BUFFER(qfv_packet_t, 4) packets; ///< packets for controlling access + RING_BUFFER(qfv_packet_t, 32) packets; ///< packets for controlling access size_t atom_mask; ///< for flush size rounding size_t size; ///< actual size of the buffer size_t end; ///< effective end of the buffer due to early wrap diff --git a/libs/video/renderer/vulkan/staging.c b/libs/video/renderer/vulkan/staging.c index fe24127a4..e08a663a6 100644 --- a/libs/video/renderer/vulkan/staging.c +++ b/libs/video/renderer/vulkan/staging.c @@ -273,6 +273,7 @@ QFV_PacketAcquire (qfv_stagebuf_t *stage) void * QFV_PacketExtend (qfv_packet_t *packet, size_t size) { + qfZoneNamed (zone, true); void *data = acquire_space (packet, size); if (data) { packet->length += size; @@ -283,6 +284,7 @@ QFV_PacketExtend (qfv_packet_t *packet, size_t size) void QFV_PacketSubmit (qfv_packet_t *packet) { + qfZoneNamed (zone, true); qfv_stagebuf_t *stage = packet->stage; qfv_device_t *device = stage->device; qfv_devfuncs_t *dfunc = device->funcs;