From 383842fab812497a04a85e87d841e2d6af098320 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Wed, 6 Sep 2023 21:51:44 +0900 Subject: [PATCH] radv: Fix dumping vertex descriptors with RADV_DEBUG=hang. Adding 3 words should be done before the uint32_t ** cast. This is in line with other places which uses pointer arithmetic on trace_id_ptr. Part-of: --- src/amd/vulkan/radv_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index 68a1465..8f683d9 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -409,9 +409,9 @@ static void radv_dump_vertex_descriptors(const struct radv_device *device, const struct radv_graphics_pipeline *pipeline, FILE *f) { struct radv_shader *vs = radv_get_shader(pipeline->base.shaders, MESA_SHADER_VERTEX); - void *ptr = (uint64_t *)device->trace_id_ptr; + uint64_t *ptr = (uint64_t *)device->trace_id_ptr; uint32_t count = util_bitcount(vs->info.vs.vb_desc_usage_mask); - uint32_t *vb_ptr = &((uint32_t *)ptr)[3]; + uint32_t *vb_ptr = *(uint32_t **)(ptr + 3); if (!count) return; -- 2.7.4