Added debug print to shader

main
noah metz 2024-10-28 22:49:57 -06:00
parent 030d4f4278
commit 173b57859f
3 changed files with 8 additions and 3 deletions

@ -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 $@ $<

@ -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];

@ -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 *);