More synchronization attempts

main
noah metz 2024-10-28 23:24:00 -06:00
parent 2ec837442f
commit 2c5c2dcb22
5 changed files with 5 additions and 14 deletions

@ -60,10 +60,10 @@ debug: roleplay $(EXTRA_DEBUG_REQUIREMENTS) $(SPV_FILES)
$(GDB) roleplay $(GDB) roleplay
%.vert.spv: %.vert %.vert.spv: %.vert
glslc --target-env=vulkan1.2 -o $@ $< glslc -o $@ $<
%.frag.spv: %.frag %.frag.spv: %.frag
glslc --target-env=vulkan1.2 -o $@ $< glslc -o $@ $<
%.comp.spv: %.comp %.comp.spv: %.comp
glslc --target-env=vulkan1.2 -o $@ $< glslc -o $@ $<

@ -28,8 +28,6 @@
#define WINDOW_MIN_WIDTH 800 #define WINDOW_MIN_WIDTH 800
#define WINDOW_MIN_HEIGHT 600 #define WINDOW_MIN_HEIGHT 600
extern PFN_vkCmdPipelineBarrier2KHR pVkCmdPipelineBarrier2KHR;
typedef struct GPUBufferStruct { typedef struct GPUBufferStruct {
VkBuffer buffers[MAX_FRAMES_IN_FLIGHT]; VkBuffer buffers[MAX_FRAMES_IN_FLIGHT];
VmaAllocation memory[MAX_FRAMES_IN_FLIGHT]; VmaAllocation memory[MAX_FRAMES_IN_FLIGHT];

@ -1,6 +1,5 @@
#version 450 #version 450
#extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference : require
#extension GL_EXT_debug_printf : enable
#include "ui_common.glsl" #include "ui_common.glsl"
@ -14,8 +13,6 @@ void main() {
uint buffer_pos = atomicAdd(pc.layer.draw.instance_count, string.len); uint buffer_pos = atomicAdd(pc.layer.draw.instance_count, string.len);
vec2 pen = vec2(0.0, 0.0); vec2 pen = vec2(0.0, 0.0);
debugPrintfEXT("Frame [%d] String[%d] length: %d\n", pc.frame, gID, string.len);
for(uint i = 0; i < string.len; i++) { for(uint i = 0; i < string.len; i++) {
uint code = pc.layer.codes.c[string.offset + i]; uint code = pc.layer.codes.c[string.offset + i];
Symbol symbol = font.symbols.s[code]; Symbol symbol = font.symbols.s[code];

@ -83,7 +83,7 @@ VkResult draw_frame(
} }
VK_RESULT(vkEndCommandBuffer(transfer_commands)); VK_RESULT(vkEndCommandBuffer(transfer_commands));
VkPipelineStageFlags wait_stages[] = {VK_PIPELINE_STAGE_ALL_COMMANDS_BIT}; VkPipelineStageFlags wait_stages[] = {VK_PIPELINE_STAGE_TRANSFER_BIT};
VkSemaphore transfer_signals[] = {context->frame[context->current_frame].transfer}; VkSemaphore transfer_signals[] = {context->frame[context->current_frame].transfer};
VkSemaphore transfer_waits[] = {context->frame[context->current_frame].frame}; VkSemaphore transfer_waits[] = {context->frame[context->current_frame].frame};
uint64_t transfer_wait_values[] = {context->frame[context->current_frame].frame_index}; uint64_t transfer_wait_values[] = {context->frame[context->current_frame].frame_index};
@ -113,7 +113,7 @@ VkResult draw_frame(
VK_RESULT(vkBeginCommandBuffer(compute_commands, &begin_info)); VK_RESULT(vkBeginCommandBuffer(compute_commands, &begin_info));
record_ui_compute(compute_commands, ui, context->current_frame); record_ui_compute(compute_commands, ui, context->current_frame);
VK_RESULT(vkEndCommandBuffer(compute_commands)); VK_RESULT(vkEndCommandBuffer(compute_commands));
VkPipelineStageFlags compute_wait_stages[] = {VK_PIPELINE_STAGE_ALL_COMMANDS_BIT}; VkPipelineStageFlags compute_wait_stages[] = {VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT};
context->frame[context->current_frame].compute_index += 1; context->frame[context->current_frame].compute_index += 1;
VkSemaphore compute_signals[] = {context->frame[context->current_frame].compute}; VkSemaphore compute_signals[] = {context->frame[context->current_frame].compute};
uint64_t compute_signal_values[] = {context->frame[context->current_frame].compute_index}; uint64_t compute_signal_values[] = {context->frame[context->current_frame].compute_index};

@ -5,8 +5,6 @@
#include "vk_mem_alloc.h" #include "vk_mem_alloc.h"
#include "vulkan/vulkan_core.h" #include "vulkan/vulkan_core.h"
PFN_vkCmdPipelineBarrier2KHR pVkCmdPipelineBarrier2KHR;
const char * validation_layers[] = { const char * validation_layers[] = {
"VK_LAYER_KHRONOS_validation", "VK_LAYER_KHRONOS_validation",
//"VK_LAYER_LUNARG_api_dump", //"VK_LAYER_LUNARG_api_dump",
@ -885,8 +883,6 @@ VkResult init_vulkan(GLFWwindow* window, RenderContext* context) {
VK_RESULT(create_logical_device(context->physical_device, context->surface, &context->graphics_queue, &context->present_queue, &context->transfer_queue, &context->device)); VK_RESULT(create_logical_device(context->physical_device, context->surface, &context->graphics_queue, &context->present_queue, &context->transfer_queue, &context->device));
pVkCmdPipelineBarrier2KHR = (PFN_vkCmdPipelineBarrier2KHR)vkGetDeviceProcAddr(context->device, "vkCmdPipelineBarrier2KHR");
VK_RESULT(create_memory_allocator(context->instance, context->physical_device, context->device, &context->allocator)); VK_RESULT(create_memory_allocator(context->instance, context->physical_device, context->device, &context->allocator));
VkCommandPoolCreateInfo extra_pool_info = { VkCommandPoolCreateInfo extra_pool_info = {