diff --git a/client/src/draw.c b/client/src/draw.c index d147ea9..bfcfb5b 100644 --- a/client/src/draw.c +++ b/client/src/draw.c @@ -80,9 +80,17 @@ VkResult draw_frame( context->frame[context->current_frame].transfer_infos[transfer_index].offset, context->frame[context->current_frame].transfer_infos[transfer_index].size); src_offset += context->frame[context->current_frame].transfer_infos[transfer_index].size; + VkBufferMemoryBarrier barrier = { + .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, + .buffer = context->frame[context->current_frame].transfer_infos[transfer_index].buffer, + .offset = context->frame[context->current_frame].transfer_infos[transfer_index].offset, + .size = context->frame[context->current_frame].transfer_infos[transfer_index].size, + .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, + .dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + }; + vkCmdPipelineBarrier(transfer_commands, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, 0, 0, NULL, 1, &barrier, 0, NULL); } - record_ui_compute(transfer_commands, ui, context->current_frame); VK_RESULT(vkEndCommandBuffer(transfer_commands)); VkPipelineStageFlags wait_stages[] = {VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT}; diff --git a/client/src/main.c b/client/src/main.c index 338613f..efdad8e 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -189,7 +189,7 @@ VkResult main_thread(ClientContext* context) { // double last_draw = 0; - double draw_interval = 0.1; + double draw_interval = 1; double frame_count = 0; uint32_t* mapped_codes = context->ui.containers[0].layers[0].codes_buffer; GPUString* mapped_string = context->ui.containers[0].layers[0].strings_buffer;