diff --git a/client/include/gpu.h b/client/include/gpu.h index 85f30af..9107ad3 100644 --- a/client/include/gpu.h +++ b/client/include/gpu.h @@ -28,12 +28,6 @@ #define WINDOW_MIN_WIDTH 800 #define WINDOW_MIN_HEIGHT 600 -typedef struct GPUBufferStruct { - VkBuffer buffers[MAX_FRAMES_IN_FLIGHT]; - VmaAllocation memory[MAX_FRAMES_IN_FLIGHT]; - VkDeviceSize size; -} GPUBuffer; - typedef struct GPUQueueStruct { VkQueue handle; uint32_t family; diff --git a/client/src/gpu.c b/client/src/gpu.c index 8d7bf0c..dcccbb9 100644 --- a/client/src/gpu.c +++ b/client/src/gpu.c @@ -913,7 +913,7 @@ VkResult init_vulkan(GLFWwindow* window, RenderContext* context) { }; VK_RESULT(vkCreateCommandPool(context->device, &transfer_pool_info, 0, &context->transfer_pool)); - for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) { + for(uint32_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) { VK_RESULT(create_frame_context(context->device, context->allocator, context->transfer_pool, &context->frame[i])); } diff --git a/client/src/main.c b/client/src/main.c index 82fcaed..ab48025 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -203,8 +203,9 @@ VkResult main_thread(ClientContext* context) { glfwPollEvents(); double frame_time = glfwGetTime(); - // - if((frame_time - last_draw) > draw_interval && context->render.current_frame == 1) { + // Very odd, but must be a clue, adding transfers when current_frame == 0 consistently causes + // the rendering glitch, and current_frame == 1 has no rendering glitch + if((frame_time - last_draw) > draw_interval && context->render.current_frame == 0) { test = (test + 1) % 7; mapped_string->length = test;