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

Author: Daniel Schürmann <[email protected]>
Date:   Tue Apr 25 13:24:55 2023 +0200

radv/rt: rename radv_ray_tracing_module -> radv_ray_tracing_group

This name better reflects the purpose and content of this struct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22686>

---

 src/amd/vulkan/radv_pipeline_cache.c |  6 +++---
 src/amd/vulkan/radv_pipeline_rt.c    | 12 ++++++------
 src/amd/vulkan/radv_private.h        |  9 ++++-----
 src/amd/vulkan/radv_rt_shader.c      |  8 ++++----
 src/amd/vulkan/radv_shader.h         |  4 ++--
 5 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline_cache.c 
b/src/amd/vulkan/radv_pipeline_cache.c
index 9391ff83ed1..8ae1494fc5a 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -80,7 +80,7 @@ radv_hash_rt_stages(struct mesa_sha1 *ctx, const 
VkPipelineShaderStageCreateInfo
 void
 radv_hash_rt_shaders(unsigned char *hash, const 
VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
                      const struct radv_pipeline_key *key,
-                     const struct radv_ray_tracing_module *groups, uint32_t 
flags)
+                     const struct radv_ray_tracing_group *groups, uint32_t 
flags)
 {
    RADV_FROM_HANDLE(radv_pipeline_layout, layout, pCreateInfo->layout);
    struct mesa_sha1 ctx;
@@ -410,7 +410,7 @@ radv_pipeline_cache_search(struct radv_device *device, 
struct vk_pipeline_cache
       unsigned num_rt_groups = 
radv_pipeline_to_ray_tracing(pipeline)->group_count;
       assert(num_rt_groups == pipeline_obj->num_stack_sizes);
       struct radv_pipeline_shader_stack_size *stack_sizes = pipeline_obj->data;
-      struct radv_ray_tracing_module *rt_groups = 
radv_pipeline_to_ray_tracing(pipeline)->groups;
+      struct radv_ray_tracing_group *rt_groups = 
radv_pipeline_to_ray_tracing(pipeline)->groups;
       for (unsigned i = 0; i < num_rt_groups; i++)
          rt_groups[i].stack_size = stack_sizes[i];
    }
@@ -473,7 +473,7 @@ radv_pipeline_cache_insert(struct radv_device *device, 
struct vk_pipeline_cache
 
    if (pipeline->type == RADV_PIPELINE_RAY_TRACING) {
       struct radv_pipeline_shader_stack_size *stack_sizes = pipeline_obj->data;
-      struct radv_ray_tracing_module *rt_groups = 
radv_pipeline_to_ray_tracing(pipeline)->groups;
+      struct radv_ray_tracing_group *rt_groups = 
radv_pipeline_to_ray_tracing(pipeline)->groups;
       for (unsigned i = 0; i < num_rt_groups; i++)
          stack_sizes[i] = rt_groups[i].stack_size;
    }
diff --git a/src/amd/vulkan/radv_pipeline_rt.c 
b/src/amd/vulkan/radv_pipeline_rt.c
index db6afe3b71c..223e0b2fdc8 100644
--- a/src/amd/vulkan/radv_pipeline_rt.c
+++ b/src/amd/vulkan/radv_pipeline_rt.c
@@ -82,7 +82,7 @@ handle_from_stages(struct radv_device *device, const 
VkPipelineShaderStageCreate
 static VkResult
 radv_create_group_handles(struct radv_device *device,
                           const VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
-                          struct radv_ray_tracing_module *groups)
+                          struct radv_ray_tracing_group *groups)
 {
    bool capture_replay = pCreateInfo->flags &
                          
VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR;
@@ -209,7 +209,7 @@ radv_rt_pipeline_compile(struct radv_ray_tracing_pipeline 
*pipeline,
                          const VkPipelineShaderStageCreateInfo *pStage,
                          const VkPipelineCreateFlags flags, const uint8_t 
*custom_hash,
                          const VkPipelineCreationFeedbackCreateInfo 
*creation_feedback,
-                         struct radv_ray_tracing_module *rt_groups, uint32_t 
num_rt_groups)
+                         struct radv_ray_tracing_group *rt_groups, uint32_t 
num_rt_groups)
 {
    struct radv_shader_binary *binaries[MESA_VULKAN_SHADER_STAGES] = {NULL};
    unsigned char hash[20];
@@ -337,7 +337,7 @@ radv_rt_pipeline_library_create(VkDevice _device, 
VkPipelineCache _cache,
       return VK_ERROR_OUT_OF_HOST_MEMORY;
 
    size_t pipeline_size =
-      sizeof(*pipeline) + local_create_info.groupCount * sizeof(struct 
radv_ray_tracing_module);
+      sizeof(*pipeline) + local_create_info.groupCount * sizeof(struct 
radv_ray_tracing_group);
    pipeline = vk_zalloc2(&device->vk.alloc, pAllocator, pipeline_size, 8,
                          VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (!pipeline) {
@@ -410,7 +410,7 @@ radv_rt_pipeline_has_dynamic_stack_size(const 
VkRayTracingPipelineCreateInfoKHR
 
 static unsigned
 compute_rt_stack_size(const VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
-                      const struct radv_ray_tracing_module *groups)
+                      const struct radv_ray_tracing_group *groups)
 {
    if (radv_rt_pipeline_has_dynamic_stack_size(pCreateInfo))
       return -1u;
@@ -544,7 +544,7 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache 
_cache,
       pCreateInfo->flags | 
VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT;
 
    size_t pipeline_size =
-      sizeof(*rt_pipeline) + local_create_info.groupCount * sizeof(struct 
radv_ray_tracing_module);
+      sizeof(*rt_pipeline) + local_create_info.groupCount * sizeof(struct 
radv_ray_tracing_group);
    rt_pipeline = vk_zalloc2(&device->vk.alloc, pAllocator, pipeline_size, 8,
                             VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (rt_pipeline == NULL) {
@@ -665,7 +665,7 @@ radv_GetRayTracingShaderGroupHandlesKHR(VkDevice device, 
VkPipeline _pipeline, u
                                         uint32_t groupCount, size_t dataSize, 
void *pData)
 {
    RADV_FROM_HANDLE(radv_pipeline, pipeline, _pipeline);
-   struct radv_ray_tracing_module *groups;
+   struct radv_ray_tracing_group *groups;
    if (pipeline->type == RADV_PIPELINE_RAY_TRACING_LIB) {
       groups = radv_pipeline_to_ray_tracing_lib(pipeline)->groups;
    } else {
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 68a0ec65aea..40ae52149c8 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -2097,7 +2097,6 @@ struct radv_event {
 #define RADV_HASH_SHADER_NO_FMASK              (1 << 19)
 #define RADV_HASH_SHADER_NGG_STREAMOUT         (1 << 20)
 
-struct radv_ray_tracing_module;
 struct radv_pipeline_key;
 
 void radv_pipeline_stage_init(const VkPipelineShaderStageCreateInfo *sinfo,
@@ -2112,7 +2111,7 @@ void radv_hash_rt_stages(struct mesa_sha1 *ctx, const 
VkPipelineShaderStageCreat
 
 void radv_hash_rt_shaders(unsigned char *hash, const 
VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
                           const struct radv_pipeline_key *key,
-                          const struct radv_ray_tracing_module *groups, 
uint32_t flags);
+                          const struct radv_ray_tracing_group *groups, 
uint32_t flags);
 
 uint32_t radv_get_hash_flags(const struct radv_device *device, bool stats);
 
@@ -2285,7 +2284,7 @@ struct radv_compute_pipeline {
    struct radv_pipeline base;
 };
 
-struct radv_ray_tracing_module {
+struct radv_ray_tracing_group {
    struct radv_pipeline_group_handle handle;
    struct radv_pipeline_shader_stack_size stack_size;
 };
@@ -2300,7 +2299,7 @@ struct radv_ray_tracing_lib_pipeline {
    VkPipelineShaderStageCreateInfo *stages;
    unsigned group_count;
    VkRayTracingShaderGroupCreateInfoKHR *group_infos;
-   struct radv_ray_tracing_module groups[];
+   struct radv_ray_tracing_group groups[];
 };
 
 struct radv_graphics_lib_pipeline {
@@ -2329,7 +2328,7 @@ struct radv_ray_tracing_pipeline {
 
    uint32_t group_count;
    uint32_t stack_size;
-   struct radv_ray_tracing_module groups[];
+   struct radv_ray_tracing_group groups[];
 };
 
 #define RADV_DECL_PIPELINE_DOWNCAST(pipe_type, pipe_enum)            \
diff --git a/src/amd/vulkan/radv_rt_shader.c b/src/amd/vulkan/radv_rt_shader.c
index 44d70c3b901..1e553bdb53b 100644
--- a/src/amd/vulkan/radv_rt_shader.c
+++ b/src/amd/vulkan/radv_rt_shader.c
@@ -818,7 +818,7 @@ inline_constants(nir_shader *dst, nir_shader *src)
 static void
 insert_rt_case(nir_builder *b, nir_shader *shader, struct rt_variables *vars, 
nir_ssa_def *idx,
                uint32_t call_idx_base, uint32_t call_idx, unsigned stage_idx,
-               struct radv_ray_tracing_module *groups)
+               struct radv_ray_tracing_group *groups)
 {
    uint32_t workgroup_size = b->shader->info.workgroup_size[0] * 
b->shader->info.workgroup_size[1] *
                              b->shader->info.workgroup_size[2];
@@ -1189,7 +1189,7 @@ struct traversal_data {
    struct rt_traversal_vars *trav_vars;
    nir_variable *barycentrics;
 
-   struct radv_ray_tracing_module *groups;
+   struct radv_ray_tracing_group *groups;
    const struct radv_pipeline_key *key;
 };
 
@@ -1423,7 +1423,7 @@ load_stack_entry(nir_builder *b, nir_ssa_def *index, 
const struct radv_ray_trave
 static nir_shader *
 build_traversal_shader(struct radv_device *device,
                        const VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
-                       struct radv_ray_tracing_module *groups, const struct 
radv_pipeline_key *key)
+                       struct radv_ray_tracing_group *groups, const struct 
radv_pipeline_key *key)
 {
    /* Create the traversal shader as an intersection shader to prevent 
validation failures due to
     * invalid variable modes.*/
@@ -1619,7 +1619,7 @@ move_rt_instructions(nir_shader *shader)
 
 nir_shader *
 create_rt_shader(struct radv_device *device, const 
VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
-                 struct radv_ray_tracing_module *groups, const struct 
radv_pipeline_key *key)
+                 struct radv_ray_tracing_group *groups, const struct 
radv_pipeline_key *key)
 {
    nir_builder b = radv_meta_init_shader(device, MESA_SHADER_RAYGEN, 
"rt_combined");
    b.shader->info.internal = false;
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 21554d3dd30..a46f2170301 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -43,7 +43,7 @@
 struct radv_physical_device;
 struct radv_device;
 struct radv_pipeline;
-struct radv_ray_tracing_module;
+struct radv_ray_tracing_group;
 struct radv_pipeline_key;
 struct radv_shader_args;
 struct radv_vs_input_state;
@@ -757,7 +757,7 @@ void radv_get_nir_options(struct radv_physical_device 
*device);
 
 nir_shader *create_rt_shader(struct radv_device *device,
                              const VkRayTracingPipelineCreateInfoKHR 
*pCreateInfo,
-                             struct radv_ray_tracing_module *groups,
+                             struct radv_ray_tracing_group *groups,
                              const struct radv_pipeline_key *key);
 
 #endif

Reply via email to