radv: track if patch control points is dynamic from the cmdbuf state

This allows us to remove one more pipeline occurence during cmdbuf
recording. Note that patch control points is always dynamic with
shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24473>
This commit is contained in:
Samuel Pitoiset
2023-08-03 15:09:25 +02:00
committed by Marge Bot
parent b56c288589
commit 0a102d3fd6
2 changed files with 8 additions and 4 deletions
+7 -4
View File
@@ -2511,10 +2511,10 @@ radv_emit_patch_control_points(struct radv_cmd_buffer *cmd_buffer)
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
unsigned ls_hs_config, base_reg;
/* Compute tessellation info that depends on the number of patch control points
* when the bound pipeline declared this state as dynamic.
/* Compute tessellation info that depends on the number of patch control points when this state
* is dynamic.
*/
if (cmd_buffer->state.graphics_pipeline->dynamic_states & RADV_DYNAMIC_PATCH_CONTROL_POINTS) {
if (cmd_buffer->state.uses_dynamic_patch_control_points) {
/* Compute the number of patches. */
cmd_buffer->state.tess_num_patches = get_tcs_num_patches(
d->vk.ts.patch_control_points, tcs->info.tcs.tcs_vertices_out, tcs->info.tcs.num_linked_inputs,
@@ -6610,8 +6610,11 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_VGT_FLUSH;
}
cmd_buffer->state.uses_dynamic_patch_control_points =
!!(graphics_pipeline->dynamic_states & RADV_DYNAMIC_PATCH_CONTROL_POINTS);
if (graphics_pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) {
if (!(graphics_pipeline->dynamic_states & RADV_DYNAMIC_PATCH_CONTROL_POINTS)) {
if (!cmd_buffer->state.uses_dynamic_patch_control_points) {
/* Bind the tessellation state from the pipeline when it's not dynamic. */
struct radv_shader *tcs = cmd_buffer->state.shaders[MESA_SHADER_TESS_CTRL];
+1
View File
@@ -1758,6 +1758,7 @@ struct radv_cmd_state {
bool uses_out_of_order_rast;
bool uses_vrs_attachment;
bool uses_dynamic_patch_control_points;
};
struct radv_cmd_buffer_upload {