diff --git a/src/intel/dev/intel_debug.c b/src/intel/dev/intel_debug.c index 7650a62956d..0c46c55d05c 100644 --- a/src/intel/dev/intel_debug.c +++ b/src/intel/dev/intel_debug.c @@ -37,6 +37,7 @@ #include "git_sha1.h" #include "util/macros.h" #include "util/u_debug.h" +#include "util/u_math.h" #include "c11/threads.h" uint64_t intel_debug = 0; @@ -286,6 +287,16 @@ intel_debug_write_identifiers(void *_output, assert(output < output_end); + /* Add at least a full aligned uint64_t of zero padding at the end + * to make the identifiers easier to spot. + */ + const unsigned unpadded_len = output - _output; + const unsigned padding = ALIGN(unpadded_len + 8, 8) - unpadded_len; + memset(output, 0, padding); + output += padding; + + assert(output < output_end); + /* Return the how many bytes where written, so that the rest of the buffer * can be used for other things. */