Skip to content

Commit

Permalink
vk: create BOUNDED_ARRAY empty
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed May 1, 2024
1 parent 2d49b9f commit c3a41f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ref/vk/vk_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down
2 changes: 1 addition & 1 deletion ref/vk/vk_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions ref/vk/vk_framectl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c3a41f9

Please sign in to comment.