Revert "radv: fix finding shaders by PC"
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 23 Oct 2023 13:43:17 +0000 (15:43 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 24 Oct 2023 14:19:13 +0000 (14:19 +0000)
Shaders are no longer allocated contiguously in memory and the next
pointer is now the shader.

This fixes using the trap handler on GFX8.

This reverts commit 2dcd12f38be629086148dfc9ff0da90aa1fc9698.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25852>

src/amd/vulkan/radv_shader.c

index f1a9806..2903ad2 100644 (file)
@@ -2728,16 +2728,7 @@ radv_find_shader(struct radv_device *device, uint64_t pc)
          uint64_t start = radv_buffer_get_va(block->arena->bo) + block->offset;
          if (!block->freelist.prev && pc >= start && pc < start + block->size) {
             mtx_unlock(&device->shader_arena_mutex);
-
-            struct radv_pipeline *pipeline = (struct radv_pipeline *)block->freelist.next;
-            for (uint32_t i = 0; i < MESA_VULKAN_SHADER_STAGES; i++) {
-               struct radv_shader *shader = pipeline->shaders[i];
-               if (!shader)
-                  continue;
-
-               if (pc >= shader->va && pc < shader->va + align(shader->code_size, RADV_SHADER_ALLOC_ALIGNMENT))
-                  return shader;
-            }
+            return (struct radv_shader *)block->freelist.next;
          }
       }
    }