debugPrintfEXT doesn't support 64-bit signed integer with %ld
Environment:
- OS: Ubuntu 24.04.1 LTS
- GPU and driver version: Intel UHD Graphics 620 (WHL GT2)
- SDK or header version if building from repo: Vulkan Instance Version: 1.3.290
- Options enabled (synchronization, best practices, etc.): Validation with Debug Printf preset
apiVersion = 1.3.274 (4206866)
driverVersion = 24.0.9 (100663305)
Describe the Issue debugPrintfEXT garbles values after a 64-bit value
The following compute shader code
uint64_t idx_64 = 42;
uint32_t idx_32 = 42;
if (gl_LocalInvocationIndex == 0) {
debugPrintfEXT(" BAD: %8ld %8x %8x %8x %8x\n", idx_64, rc.exclusion_left, rc.exclusion_right, rc.exclusion_top, rc.exclusion_bottom); // This line is broken
debugPrintfEXT("OKAY: %8x %8x %8x %8x %8ld\n", rc.exclusion_left, rc.exclusion_right, rc.exclusion_top, rc.exclusion_bottom, idx_64); // This line works
debugPrintfEXT("GOOD: %8d %8x %8x %8x %8x\n", idx_32, rc.exclusion_left, rc.exclusion_right, rc.exclusion_top, rc.exclusion_bottom); // This line works
debugPrintfEXT("GOOD: %8x %8x %8x %8x %8d\n", rc.exclusion_left, rc.exclusion_right, rc.exclusion_top, rc.exclusion_bottom, idx_32); // This line works
}
Produces the following output:
BAD: 42 0 10000 10001 10002
OKAY: 10000 10001 10002 10003 42
GOOD: 42 10000 10001 10002 10003
GOOD: 10000 10001 10002 10003 42
Expected behavior The BAD/OKAY lines should match the GOOD/GOOD lines.
Thanks.
So this "should" be fixed in the next SDK coming out this week, while making the fixes for float 64-bit I realized we had issues with how we handled no-32bit values and have tests
... if the SDK doesn't fix it, can look more
hmm... ok, seems this might still be broken, will get tests and try to get a fix ASAP (unfortunately any fix will have to wait until the NEXT SDK :cry: )
For you example, is rc.exclusion_left just a uint32_t?
ok, so I just figured out the issue, we don't currently support %ld
we have support for %ul, %lu and %lx but didn't support 64 signed Ints with %ld ... so yes, let me update this title and just actually add support for 64-bit signed floats :+1:
(if you are using uint64_t then you can just get away with %lu though!)
For you example, is rc.exclusion_left just a uint32_t?
Yes, everything except idx_64 are all uint32_t.
Thanks for the fixes.