Module: Mesa
Branch: main
Commit: 124973c63586fac5f123195c875ad622aa3c9404
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=124973c63586fac5f123195c875ad622aa3c9404

Author: Felix DeGrood <[email protected]>
Date:   Thu Jun 29 04:03:03 2023 +0000

anv: Add Source hash field to VkPipelineExecutableStatisticKHR

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>

---

 src/intel/vulkan/anv_pipeline.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index c9525ee7df2..a0b8944631c 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -4286,6 +4286,20 @@ VkResult anv_GetPipelineExecutableStatisticsKHR(
          stat->value.u64 = 0;
    }
 
+   vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) {
+      uint32_t hash = pipeline->type == ANV_PIPELINE_COMPUTE ?
+                      anv_pipeline_to_compute(pipeline)->source_hash :
+                      (pipeline->type == ANV_PIPELINE_GRAPHICS_LIB ||
+                       pipeline->type == ANV_PIPELINE_GRAPHICS) ?
+                      
anv_pipeline_to_graphics_base(pipeline)->source_hashes[exe->stage] :
+                      0 /* No source hash for ray tracing */;
+      WRITE_STR(stat->name, "Source hash");
+      WRITE_STR(stat->description,
+                "hash = 0x%08x. Hash generated from shader source.", hash);
+      stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR;
+      stat->value.u64 = hash;
+   }
+
    return vk_outarray_status(&out);
 }
 

Reply via email to