tu: Fix param_stride placement

Even though it's tessellation-related, it's set based on the
tessellation variant which is only known after linking. The param stride
may change due to LTO if fast linking is not used.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18773>
This commit is contained in:
Connor Abbott
2022-09-21 13:46:27 +02:00
committed by Marge Bot
parent 998122d9c2
commit 042c135a99
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -2566,7 +2566,7 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
/* maximum number of patches that can fit in tess factor/param buffers */
uint32_t subdraw_size = MIN2(TU_TESS_FACTOR_SIZE / ir3_tess_factor_stride(pipeline->tess.patch_type),
TU_TESS_PARAM_SIZE / pipeline->tess.param_stride);
TU_TESS_PARAM_SIZE / pipeline->program.hs_param_stride);
/* convert from # of patches to draw count */
subdraw_size *= pipeline->tess.patch_control_points;
+4 -1
View File
@@ -3858,6 +3858,10 @@ tu_pipeline_builder_parse_shader_stages(struct tu_pipeline_builder *builder,
&builder->const_state[i],
builder->variants[i]);
}
struct ir3_shader_variant *hs = builder->variants[MESA_SHADER_TESS_CTRL];
if (hs)
pipeline->program.hs_param_stride = hs->output_size * 4;
}
static bool
@@ -3975,7 +3979,6 @@ tu_pipeline_builder_parse_tessellation(struct tu_pipeline_builder *builder,
pipeline->tess.upper_left_domain_origin = !domain_info ||
domain_info->domainOrigin == VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT;
const struct ir3_shader_variant *hs = builder->variants[MESA_SHADER_TESS_CTRL];
pipeline->tess.param_stride = hs->output_size * 4;
}
static void
+2 -1
View File
@@ -205,6 +205,8 @@ struct tu_pipeline
struct tu_draw_state binning_state;
struct tu_program_descriptor_linkage link[MESA_SHADER_STAGES];
uint32_t hs_param_stride;
} program;
struct
@@ -217,7 +219,6 @@ struct tu_pipeline
{
uint32_t patch_type;
uint32_t patch_control_points;
uint32_t param_stride;
bool upper_left_domain_origin;
} tess;