radv: Fix dumping vertex descriptors with RADV_DEBUG=hang.
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Wed, 6 Sep 2023 12:51:44 +0000 (21:51 +0900)
committerMarge Bot <emma+marge@anholt.net>
Thu, 7 Sep 2023 11:50:32 +0000 (11:50 +0000)
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25081>

src/amd/vulkan/radv_debug.c

index 68a1465..8f683d9 100644 (file)
@@ -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;