[vulkan] Update labeled struct inits

I had used some legacy gcc extensions rather than standard C (clang
wasn't too happy about that).
This commit is contained in:
Bill Currie 2022-03-31 01:26:57 +09:00
parent 73c65749fc
commit 7305406f46
3 changed files with 23 additions and 23 deletions

View file

@ -137,7 +137,7 @@ QFV_CreateScrap (qfv_device_t *device, const char *name, int size,
0, 0, 0, 0, 0,
1, &ib.barrier);
VkClearColorValue color = {
float32:{0xde/255.0, 0xad/255.0, 0xbe/255.0, 0xef/255.0},
.float32 = {0xde/255.0, 0xad/255.0, 0xbe/255.0, 0xef/255.0},
};
VkImageSubresourceRange range = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 };
dfunc->vkCmdClearColorImage (packet->cmd, scrap->image,

View file

@ -139,31 +139,31 @@ vkQueueSubmit (VkQueue queue, uint32_t count, const VkSubmitInfo *submits,
}
qfv_devfuncs_t dfuncs = {
vkCreateBuffer:vkCreateBuffer,
vkGetBufferMemoryRequirements:vkGetBufferMemoryRequirements,
vkMapMemory:vkMapMemory,
vkBindBufferMemory:vkBindBufferMemory,
vkAllocateCommandBuffers:vkAllocateCommandBuffers,
vkCreateFence:vkCreateFence,
vkWaitForFences:vkWaitForFences,
vkResetFences:vkResetFences,
vkGetFenceStatus:vkGetFenceStatus,
vkResetCommandBuffer:vkResetCommandBuffer,
vkBeginCommandBuffer:vkBeginCommandBuffer,
vkEndCommandBuffer:vkEndCommandBuffer,
vkFlushMappedMemoryRanges:vkFlushMappedMemoryRanges,
vkQueueSubmit:vkQueueSubmit,
.vkCreateBuffer = vkCreateBuffer,
.vkGetBufferMemoryRequirements = vkGetBufferMemoryRequirements,
.vkMapMemory = vkMapMemory,
.vkBindBufferMemory = vkBindBufferMemory,
.vkAllocateCommandBuffers = vkAllocateCommandBuffers,
.vkCreateFence = vkCreateFence,
.vkWaitForFences = vkWaitForFences,
.vkResetFences = vkResetFences,
.vkGetFenceStatus = vkGetFenceStatus,
.vkResetCommandBuffer = vkResetCommandBuffer,
.vkBeginCommandBuffer = vkBeginCommandBuffer,
.vkEndCommandBuffer = vkEndCommandBuffer,
.vkFlushMappedMemoryRanges = vkFlushMappedMemoryRanges,
.vkQueueSubmit = vkQueueSubmit,
};
qfv_physdev_t physDev = {
properties:{
limits:{
nonCoherentAtomSize:256,
.properties = {
.limits = {
.nonCoherentAtomSize = 256,
},
},
};
qfv_device_t device = {
physDev:&physDev,
funcs:&dfuncs,
.physDev = &physDev,
.funcs = &dfuncs,
};
static void __attribute__ ((format (PRINTF, 2, 3), noreturn))

View file

@ -1052,7 +1052,7 @@ Vulkan_DrawWorld (qfv_renderframe_t *rFrame)
bframe->cmdSet.a[QFV_bspDepth]);
push_transform (identity, bctx->layout, device,
bframe->cmdSet.a[QFV_bspGBuffer]);
bsp_push_constants_t frag_constants = { time: vr_data.realtime };
bsp_push_constants_t frag_constants = { .time = vr_data.realtime };
push_fragconst (&frag_constants, bctx->layout, device,
bframe->cmdSet.a[QFV_bspGBuffer]);
for (size_t i = 0; i < bctx->texture_chains.size; i++) {
@ -1120,7 +1120,7 @@ Vulkan_DrawWaterSurfaces (qfv_renderframe_t *rFrame)
turb_begin (rFrame);
push_transform (identity, bctx->layout, device,
bframe->cmdSet.a[QFV_bspTurb]);
bsp_push_constants_t frag_constants = { time: vr_data.realtime };
bsp_push_constants_t frag_constants = { .time = vr_data.realtime };
push_fragconst (&frag_constants, bctx->layout, device,
bframe->cmdSet.a[QFV_bspTurb]);
for (is = bctx->waterchain; is; is = is->tex_chain) {
@ -1182,7 +1182,7 @@ Vulkan_DrawSky (qfv_renderframe_t *rFrame)
bframe->cmdSet.a[QFV_bspSky]);
push_transform (identity, bctx->layout, device,
bframe->cmdSet.a[QFV_bspSky]);
bsp_push_constants_t frag_constants = { time: vr_data.realtime };
bsp_push_constants_t frag_constants = { .time = vr_data.realtime };
push_fragconst (&frag_constants, bctx->layout, device,
bframe->cmdSet.a[QFV_bspSky]);
for (is = bctx->sky_chain; is; is = is->tex_chain) {