radv: use the pipeline key as hash for pipeline bind markers

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>
This commit is contained in:
Samuel Pitoiset 2021-02-16 17:31:52 +01:00 committed by Marge Bot
parent 51f3855cc4
commit b02c709b70
3 changed files with 7 additions and 3 deletions

View 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);
}

View 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};

View 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)