More testing, might have a clue

main
noah metz 2024-10-29 14:05:19 -06:00
parent 105f4524c8
commit 1f080606af
3 changed files with 4 additions and 9 deletions

@ -28,12 +28,6 @@
#define WINDOW_MIN_WIDTH 800 #define WINDOW_MIN_WIDTH 800
#define WINDOW_MIN_HEIGHT 600 #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 { typedef struct GPUQueueStruct {
VkQueue handle; VkQueue handle;
uint32_t family; uint32_t family;

@ -913,7 +913,7 @@ VkResult init_vulkan(GLFWwindow* window, RenderContext* context) {
}; };
VK_RESULT(vkCreateCommandPool(context->device, &transfer_pool_info, 0, &context->transfer_pool)); 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])); VK_RESULT(create_frame_context(context->device, context->allocator, context->transfer_pool, &context->frame[i]));
} }

@ -203,8 +203,9 @@ VkResult main_thread(ClientContext* context) {
glfwPollEvents(); glfwPollEvents();
double frame_time = glfwGetTime(); double frame_time = glfwGetTime();
// // Very odd, but must be a clue, adding transfers when current_frame == 0 consistently causes
if((frame_time - last_draw) > draw_interval && context->render.current_frame == 1) { // 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; test = (test + 1) % 7;
mapped_string->length = test; mapped_string->length = test;