From 173b57859f09922567440880c2a952d5ffeed7b0 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 28 Oct 2024 22:49:57 -0600 Subject: [PATCH] Added debug print to shader --- client/Makefile | 6 +++--- client/shader_src/string.comp | 4 ++++ client/src/gpu.c | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/Makefile b/client/Makefile index 77b39d4..0304f12 100644 --- a/client/Makefile +++ b/client/Makefile @@ -60,10 +60,10 @@ debug: roleplay $(EXTRA_DEBUG_REQUIREMENTS) $(SPV_FILES) $(GDB) roleplay %.vert.spv: %.vert - glslc -o $@ $< + glslc --target-env=vulkan1.2 -o $@ $< %.frag.spv: %.frag - glslc -o $@ $< + glslc --target-env=vulkan1.2 -o $@ $< %.comp.spv: %.comp - glslc -o $@ $< + glslc --target-env=vulkan1.2 -o $@ $< diff --git a/client/shader_src/string.comp b/client/shader_src/string.comp index c1a0ec5..7470560 100644 --- a/client/shader_src/string.comp +++ b/client/shader_src/string.comp @@ -1,5 +1,6 @@ #version 450 #extension GL_EXT_buffer_reference : require +#extension GL_EXT_debug_printf : enable #include "ui_common.glsl" @@ -12,6 +13,9 @@ void main() { uint buffer_pos = atomicAdd(pc.layer.draw.instance_count, string.len); vec2 pen = vec2(0.0, 0.0); + + debugPrintfEXT("String[%d] length: %d", gID, string.len); + for(uint i = 0; i < string.len; i++) { uint code = pc.layer.codes.c[string.offset + i]; Symbol symbol = font.symbols.s[code]; diff --git a/client/src/gpu.c b/client/src/gpu.c index 886df8c..1d617c9 100644 --- a/client/src/gpu.c +++ b/client/src/gpu.c @@ -33,6 +33,7 @@ const char * device_extensions[] = { VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME, VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME, }; uint32_t device_extension_count = sizeof(device_extensions) / sizeof(const char *);