From c3a41f909743929acc754af6c7f4e5935c95da1a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 1 May 2024 16:02:18 -0400 Subject: [PATCH] vk: create BOUNDED_ARRAY empty --- ref/vk/vk_common.h | 2 +- ref/vk/vk_core.c | 2 +- ref/vk/vk_framectl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ref/vk/vk_common.h b/ref/vk/vk_common.h index bddc10b908..7cfa5e2b51 100644 --- a/ref/vk/vk_common.h +++ b/ref/vk/vk_common.h @@ -36,7 +36,7 @@ extern ref_globals_t *gpGlobals; struct { \ TYPE items[MAX_SIZE]; \ int count; \ - } NAME + } NAME = {0} #define BOUNDED_ARRAY_APPEND(var, item) \ do { \ diff --git a/ref/vk/vk_core.c b/ref/vk/vk_core.c index dac3e1858a..e1c7fcb1fd 100644 --- a/ref/vk/vk_core.c +++ b/ref/vk/vk_core.c @@ -191,7 +191,7 @@ static qboolean createInstance( void ) .pEngineName = "xash3d-fwgs", }; - BOUNDED_ARRAY(validation_features, VkValidationFeatureEnableEXT, 8) = {0}; + BOUNDED_ARRAY(validation_features, VkValidationFeatureEnableEXT, 8); BOUNDED_ARRAY_APPEND(validation_features, VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT); BOUNDED_ARRAY_APPEND(validation_features, VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT); diff --git a/ref/vk/vk_framectl.c b/ref/vk/vk_framectl.c index 9fde44c448..e9bd9382bd 100644 --- a/ref/vk/vk_framectl.c +++ b/ref/vk/vk_framectl.c @@ -141,7 +141,7 @@ static VkRenderPass createRenderPass( VkFormat depth_format, qboolean ray_tracin .pDepthStencilAttachment = &depth_attachment, }; - BOUNDED_ARRAY(dependencies, VkSubpassDependency, 2) = {0}; + BOUNDED_ARRAY(dependencies, VkSubpassDependency, 2); if (ray_tracing) { const VkSubpassDependency color = { .srcSubpass = VK_SUBPASS_EXTERNAL, @@ -377,8 +377,8 @@ static void submit( vk_combuf_t* combuf, qboolean wait, qboolean draw ) { }; // TODO for RT renderer we only touch framebuffer at the very end of rendering/cmdbuf. // Can we postpone waitinf for framebuffer semaphore until we actually need it. - BOUNDED_ARRAY(waitophores, VkSemaphore, 2) = {0}; - BOUNDED_ARRAY(signalphores, VkSemaphore, 2) = {0}; + BOUNDED_ARRAY(waitophores, VkSemaphore, 2); + BOUNDED_ARRAY(signalphores, VkSemaphore, 2); if (draw) { BOUNDED_ARRAY_APPEND(waitophores, frame->sem_framebuffer_ready);