radv: use the pipeline key as hash for pipeline bind markers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Feb 2021 16:31:52 +0000 (17:31 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Feb 2021 08:28:49 +0000 (08:28 +0000)
It's way easier to identify a pipeline compared to a random CPU addr.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9083>

src/amd/vulkan/layers/radv_sqtt_layer.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h

index f10b407e7970482b4e16aa70120b55db42296fbe..f719db3a034a9cf02af7c984416cc5b535181019 100644 (file)
@@ -327,7 +327,6 @@ radv_describe_pipeline_bind(struct radv_cmd_buffer *cmd_buffer,
 {
        struct rgp_sqtt_marker_pipeline_bind marker = {0};
        struct radeon_cmdbuf *cs = cmd_buffer->cs;
-       uint64_t pipeline_idx = (uintptr_t)pipeline;
 
        // TODO: Enable when PSO records & friends are dumped.
        return;
@@ -338,8 +337,8 @@ radv_describe_pipeline_bind(struct radv_cmd_buffer *cmd_buffer,
        marker.identifier = RGP_SQTT_MARKER_IDENTIFIER_BIND_PIPELINE;
        marker.cb_id = 0;
        marker.bind_point = pipelineBindPoint;
-       marker.api_pso_hash[0] = pipeline_idx;
-       marker.api_pso_hash[1] = pipeline_idx >> 32;
+       marker.api_pso_hash[0] = pipeline->pipeline_hash;
+       marker.api_pso_hash[1] = pipeline->pipeline_hash >> 32;
 
        radv_emit_thread_trace_userdata(cmd_buffer->device, cs, &marker, sizeof(marker) / 4);
 }
index cacf246077025e0c1cd9980370bc30683dc9ba35..907fa4e396f4a975897d3a8592548f642bbde444 100644 (file)
@@ -3233,6 +3233,8 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline,
        memcpy(gs_copy_hash, hash, 20);
        gs_copy_hash[0] ^= 1;
 
+       pipeline->pipeline_hash = *(uint64_t *)hash;
+
        bool found_in_application_cache = true;
        if (modules[MESA_SHADER_GEOMETRY] && !keep_executable_info && !keep_statistic_info) {
                struct radv_shader_variant *variants[MESA_SHADER_STAGES] = {0};
index 125bf333f27e2c15f219b2f92d0ad7f6684f6fbe..4118d05ad0a5bdc072c2ab90517ca01db54d4f6a 100644 (file)
@@ -1752,6 +1752,9 @@ struct radv_pipeline {
 
        /* Not NULL if graphics pipeline uses streamout. */
        struct radv_shader_variant *streamout_shader;
+
+       /* Unique pipeline hash identifier. */
+       uint64_t pipeline_hash;
 };
 
 static inline bool radv_pipeline_has_gs(const struct radv_pipeline *pipeline)