mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
intel: Add extra zeros at the end of debug identifiers
Add at least a full aligned uint64_t of zero padding at the end to make the identifiers easier to spot. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
This commit is contained in:
parent
387d131f96
commit
ea0ec8c562
1 changed files with 11 additions and 0 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue