static void demo_draw_build_cmd(struct demo *demo) {
const VkCommandBufferBeginInfo cmd_buf_info = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.pNext = NULL,
.flags = 0,
.pInheritanceInfo = NULL,
};
const VkClearValue clear_values[2] = {
[0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}},
[1] = {.depthStencil = {demo->depthStencil, 0}},
};
const VkRenderPassBeginInfo rp_begin = {
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.pNext = NULL,
.renderPass = demo->render_pass,
.framebuffer = demo->framebuffers[demo->current_buffer],
.renderArea.offset.x = 0,
.renderArea.offset.y = 0,
.renderArea.extent.width = demo->width,
.renderArea.extent.height = demo->height,
.clearValueCount = 2,
.pClearValues = clear_values,
};
VkResult U_ASSERT_ONLY err;
[nightmare@nightmare-tobefilledbyoem Рабочий стол]$ g++ triangle.c -lGL -lvulkan -I.
triangle.c: В функции «void demo_draw_build_cmd(demo*)»:
triangle.c:397:20: ошибка: expected primary-expression before «.» token
397 | [0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}},
| ^
triangle.c:405:9: ошибка: expected primary-expression before «.» token
405 | .renderArea.offset.x = 0,
| ^
triangle.c:406:9: ошибка: expected primary-expression before «.» token
406 | .renderArea.offset.y = 0,
| ^
triangle.c:407:9: ошибка: expected primary-expression before «.» token
407 | .renderArea.extent.width = demo->width,
| ^
triangle.c:408:9: ошибка: expected primary-expression before «.» token
408 | .renderArea.extent.height = demo->height,
| ^
?