radv: zero-initialize radv_shader_info earlier for graphics pipeline
This should allow us to remove a big memset when compiling a graphics pipeline. This is mostly for imported NIR stages which don't go through radv_pipeline_stage_init(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947>
This commit is contained in:
@@ -2541,7 +2541,6 @@ radv_fill_shader_info(struct radv_graphics_pipeline *pipeline,
|
|||||||
bool consider_force_vrs = radv_consider_force_vrs(pipeline, noop_fs, stages);
|
bool consider_force_vrs = radv_consider_force_vrs(pipeline, noop_fs, stages);
|
||||||
|
|
||||||
radv_foreach_stage(i, active_nir_stages) {
|
radv_foreach_stage(i, active_nir_stages) {
|
||||||
radv_nir_shader_info_init(&stages[i].info);
|
|
||||||
radv_nir_shader_info_pass(device, stages[i].nir, pipeline_layout, pipeline_key,
|
radv_nir_shader_info_pass(device, stages[i].nir, pipeline_layout, pipeline_key,
|
||||||
pipeline->base.type,
|
pipeline->base.type,
|
||||||
i == pipeline->last_vgt_api_stage && consider_force_vrs,
|
i == pipeline->last_vgt_api_stage && consider_force_vrs,
|
||||||
@@ -3554,6 +3553,10 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline,
|
|||||||
|
|
||||||
bool optimize_conservatively = pipeline_key->optimisations_disabled;
|
bool optimize_conservatively = pipeline_key->optimisations_disabled;
|
||||||
|
|
||||||
|
radv_foreach_stage(i, active_nir_stages) {
|
||||||
|
radv_nir_shader_info_init(&stages[i].info);
|
||||||
|
}
|
||||||
|
|
||||||
/* Determine if shaders uses NGG before linking because it's needed for some NIR pass. */
|
/* Determine if shaders uses NGG before linking because it's needed for some NIR pass. */
|
||||||
radv_fill_shader_info_ngg(pipeline, pipeline_key, stages);
|
radv_fill_shader_info_ngg(pipeline, pipeline_key, stages);
|
||||||
|
|
||||||
|
@@ -690,6 +690,8 @@ gather_shader_info_task(const nir_shader *nir, struct radv_shader_info *info)
|
|||||||
void
|
void
|
||||||
radv_nir_shader_info_init(struct radv_shader_info *info)
|
radv_nir_shader_info_init(struct radv_shader_info *info)
|
||||||
{
|
{
|
||||||
|
memset(info, 0, sizeof(*info));
|
||||||
|
|
||||||
/* Assume that shaders can inline all push constants by default. */
|
/* Assume that shaders can inline all push constants by default. */
|
||||||
info->can_inline_all_push_constants = true;
|
info->can_inline_all_push_constants = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user