From bcfac614683eb44450e75c057dbfe6159c5ea43d Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 2 Apr 2024 15:13:45 +0200 Subject: [PATCH] radv: move radv_shader_{layout,stage} to radv_shader.h Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_private.h | 48 ----------------------------------- src/amd/vulkan/radv_shader.h | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index fc991b5c9ba..b1473d8a771 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -2427,57 +2427,9 @@ RADV_DECL_PIPELINE_DOWNCAST(graphics_lib, RADV_PIPELINE_GRAPHICS_LIB) RADV_DECL_PIPELINE_DOWNCAST(compute, RADV_PIPELINE_COMPUTE) RADV_DECL_PIPELINE_DOWNCAST(ray_tracing, RADV_PIPELINE_RAY_TRACING) -struct radv_shader_layout { - uint32_t num_sets; - - struct { - struct radv_descriptor_set_layout *layout; - uint32_t dynamic_offset_start; - } set[MAX_SETS]; - - uint32_t push_constant_size; - uint32_t dynamic_offset_count; - bool use_dynamic_descriptors; -}; - -struct radv_shader_stage { - gl_shader_stage stage; - gl_shader_stage next_stage; - - struct { - const struct vk_object_base *object; - const char *data; - uint32_t size; - } spirv; - - const char *entrypoint; - const VkSpecializationInfo *spec_info; - - unsigned char shader_sha1[20]; - - nir_shader *nir; - nir_shader *internal_nir; /* meta shaders */ - - struct radv_shader_info info; - struct radv_shader_args args; - struct radv_shader_stage_key key; - - VkPipelineCreationFeedback feedback; - - struct radv_shader_layout layout; -}; - void radv_shader_layout_init(const struct radv_pipeline_layout *pipeline_layout, gl_shader_stage stage, struct radv_shader_layout *layout); -static inline bool -radv_is_last_vgt_stage(const struct radv_shader_stage *stage) -{ - return (stage->info.stage == MESA_SHADER_VERTEX || stage->info.stage == MESA_SHADER_TESS_EVAL || - stage->info.stage == MESA_SHADER_GEOMETRY || stage->info.stage == MESA_SHADER_MESH) && - (stage->info.next_stage == MESA_SHADER_FRAGMENT || stage->info.next_stage == MESA_SHADER_NONE); -} - static inline bool radv_pipeline_has_stage(const struct radv_graphics_pipeline *pipeline, gl_shader_stage stage) { diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index fb6a47227d0..da0b3eed64e 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -464,6 +464,54 @@ struct radv_shader_info { struct gfx10_ngg_info ngg_info; }; +struct radv_shader_layout { + uint32_t num_sets; + + struct { + struct radv_descriptor_set_layout *layout; + uint32_t dynamic_offset_start; + } set[MAX_SETS]; + + uint32_t push_constant_size; + uint32_t dynamic_offset_count; + bool use_dynamic_descriptors; +}; + +struct radv_shader_stage { + gl_shader_stage stage; + gl_shader_stage next_stage; + + struct { + const struct vk_object_base *object; + const char *data; + uint32_t size; + } spirv; + + const char *entrypoint; + const VkSpecializationInfo *spec_info; + + unsigned char shader_sha1[20]; + + nir_shader *nir; + nir_shader *internal_nir; /* meta shaders */ + + struct radv_shader_info info; + struct radv_shader_args args; + struct radv_shader_stage_key key; + + VkPipelineCreationFeedback feedback; + + struct radv_shader_layout layout; +}; + +static inline bool +radv_is_last_vgt_stage(const struct radv_shader_stage *stage) +{ + return (stage->info.stage == MESA_SHADER_VERTEX || stage->info.stage == MESA_SHADER_TESS_EVAL || + stage->info.stage == MESA_SHADER_GEOMETRY || stage->info.stage == MESA_SHADER_MESH) && + (stage->info.next_stage == MESA_SHADER_FRAGMENT || stage->info.next_stage == MESA_SHADER_NONE); +} + struct radv_vs_input_state { uint32_t attribute_mask;