Mesa (staging/21.3): radeonsi/sqtt: fix shader stage values

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 9 22:03:11 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 65adf1399d8bc1073768a14804d87bc50598ef5c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65adf1399d8bc1073768a14804d87bc50598ef5c

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Fri Nov  5 22:00:33 2021 +0100

radeonsi/sqtt: fix shader stage values

shader_stages_mask and others expect MESA_SHADER_* based values,
not PIPE_SHADER_*...

Without this the fragment shader wouldn't appear in the "Pipelines"
pane of RGP.

Fixes: c276bde34ae ("radeonsi/sqtt: export shader code to RGP")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13696>
(cherry picked from commit 3de072aaecf3a99699f539d33c5f374070334078)

---

 .pick_status.json                      |  2 +-
 src/gallium/drivers/radeonsi/si_sqtt.c | 31 ++++++++++++++++---------------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 06f2ff2f9c7..49884828d6c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -760,7 +760,7 @@
         "description": "radeonsi/sqtt: fix shader stage values",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "c276bde34ae3c1ba823873d29774165664cdf129"
     },
diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c b/src/gallium/drivers/radeonsi/si_sqtt.c
index 675c4e1c182..e0386f2380c 100644
--- a/src/gallium/drivers/radeonsi/si_sqtt.c
+++ b/src/gallium/drivers/radeonsi/si_sqtt.c
@@ -31,6 +31,7 @@
 #include "ac_rgp.h"
 #include "ac_sqtt.h"
 #include "util/u_memory.h"
+#include "tgsi/tgsi_from_mesa.h"
 
 static void
 si_emit_spi_config_cntl(struct si_context* sctx,
@@ -959,7 +960,6 @@ si_sqtt_pipe_to_rgp_shader_stage(struct si_shader_key* key, enum pipe_shader_typ
    }
 }
 
-
 static bool
 si_sqtt_add_code_object(struct si_context* sctx,
                         uint64_t pipeline_hash,
@@ -1004,20 +1004,21 @@ si_sqtt_add_code_object(struct si_context* sctx,
       memcpy(code, shader->binary.uploaded_code, shader->binary.uploaded_code_size);
 
       uint64_t va = shader->bo->gpu_address;
-      record->shader_data[i].hash[0] = _mesa_hash_data(code, shader->binary.uploaded_code_size);
-      record->shader_data[i].hash[1] = record->shader_data[i].hash[0];
-      record->shader_data[i].code_size = shader->binary.uploaded_code_size;
-      record->shader_data[i].code = code;
-      record->shader_data[i].vgpr_count = shader->config.num_vgprs;
-      record->shader_data[i].sgpr_count = shader->config.num_sgprs;
-      record->shader_data[i].base_address = va & 0xffffffffffff;
-      record->shader_data[i].elf_symbol_offset = 0;
-      record->shader_data[i].hw_stage = hw_stage;
-      record->shader_data[i].is_combined = false;
-      record->shader_data[i].scratch_memory_size = shader->config.scratch_bytes_per_wave;
-      record->shader_data[i].wavefront_size = si_get_shader_wave_size(shader);
-
-      record->shader_stages_mask |= (1 << i);
+      unsigned gl_shader_stage = tgsi_processor_to_shader_stage(i);
+      record->shader_data[gl_shader_stage].hash[0] = _mesa_hash_data(code, shader->binary.uploaded_code_size);
+      record->shader_data[gl_shader_stage].hash[1] = record->shader_data[gl_shader_stage].hash[0];
+      record->shader_data[gl_shader_stage].code_size = shader->binary.uploaded_code_size;
+      record->shader_data[gl_shader_stage].code = code;
+      record->shader_data[gl_shader_stage].vgpr_count = shader->config.num_vgprs;
+      record->shader_data[gl_shader_stage].sgpr_count = shader->config.num_sgprs;
+      record->shader_data[gl_shader_stage].base_address = va & 0xffffffffffff;
+      record->shader_data[gl_shader_stage].elf_symbol_offset = 0;
+      record->shader_data[gl_shader_stage].hw_stage = hw_stage;
+      record->shader_data[gl_shader_stage].is_combined = false;
+      record->shader_data[gl_shader_stage].scratch_memory_size = shader->config.scratch_bytes_per_wave;
+      record->shader_data[gl_shader_stage].wavefront_size = si_get_shader_wave_size(shader);
+
+      record->shader_stages_mask |= 1 << gl_shader_stage;
       record->num_shaders_combined++;
    }
 



More information about the mesa-commit mailing list