radv/rt: extend radv_pipeline_group_handle with shader VAs
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 7 Mar 2023 23:36:45 +0000 (00:36 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 8 Jun 2023 00:37:03 +0000 (00:37 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22096>

src/amd/vulkan/radv_pipeline_rt.c
src/amd/vulkan/radv_private.h
src/amd/vulkan/radv_rt_shader.c

index 1ecff07..dee19c4 100644 (file)
@@ -178,6 +178,8 @@ radv_rt_fill_group_info(struct radv_device *device,
                dst->any_hit_shader += stage_count;
             if (dst->intersection_shader != VK_SHADER_UNUSED_KHR)
                dst->intersection_shader += stage_count;
+            /* Don't set the shader VA since the handles are part of the pipeline hash */
+            dst->handle.recursive_shader_ptr = 0;
          }
          idx += library_pipeline->group_count;
          stage_count += library_pipeline->stage_count;
index 7bd6a78..d8db5cc 100644 (file)
@@ -2197,6 +2197,8 @@ enum radv_pipeline_type {
 };
 
 struct radv_pipeline_group_handle {
+   uint64_t recursive_shader_ptr;
+
    union {
       uint32_t general_index;
       uint32_t closest_hit_index;
index 36fb4c0..e97ba2e 100644 (file)
@@ -244,6 +244,7 @@ enum sbt_type {
 };
 
 enum sbt_entry {
+   SBT_RECURSIVE_PTR = offsetof(struct radv_pipeline_group_handle, recursive_shader_ptr),
    SBT_GENERAL_IDX = offsetof(struct radv_pipeline_group_handle, general_index),
    SBT_CLOSEST_HIT_IDX = offsetof(struct radv_pipeline_group_handle, closest_hit_index),
    SBT_INTERSECTION_IDX = offsetof(struct radv_pipeline_group_handle, intersection_index),