anv: only check patch_control_points changes in runtime flush
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28396>
This commit is contained in:
committed by
Marge Bot
parent
e2bcbcd24f
commit
85dd83aa46
@@ -705,10 +705,6 @@ void anv_CmdBindPipeline(
|
||||
push->gfx.fs_msaa_flags = new_pipeline->fs_msaa_flags;
|
||||
cmd_buffer->state.push_constants_dirty |= VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
}
|
||||
if (new_pipeline->dynamic_patch_control_points) {
|
||||
cmd_buffer->state.push_constants_dirty |=
|
||||
VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
|
||||
}
|
||||
|
||||
anv_cmd_buffer_flush_pipeline_state(cmd_buffer, old_pipeline, new_pipeline);
|
||||
break;
|
||||
|
||||
@@ -756,18 +756,6 @@ genX(cmd_buffer_flush_gfx_state)(struct anv_cmd_buffer *cmd_buffer)
|
||||
|
||||
cmd_buffer->state.gfx.vb_dirty &= ~vb_emit;
|
||||
|
||||
/* If patch control points value is changed, let's just update the push
|
||||
* constant data. If the current pipeline also use this, we need to reemit
|
||||
* the 3DSTATE_CONSTANT packet.
|
||||
*/
|
||||
struct anv_push_constants *push = &cmd_buffer->state.gfx.base.push_constants;
|
||||
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_TS_PATCH_CONTROL_POINTS) &&
|
||||
push->gfx.tcs_input_vertices != dyn->ts.patch_control_points) {
|
||||
push->gfx.tcs_input_vertices = dyn->ts.patch_control_points;
|
||||
if (pipeline->dynamic_patch_control_points)
|
||||
cmd_buffer->state.push_constants_dirty |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
|
||||
}
|
||||
|
||||
const bool any_dynamic_state_dirty =
|
||||
vk_dynamic_graphics_state_any_dirty(dyn);
|
||||
uint32_t descriptors_dirty = cmd_buffer->state.descriptors_dirty &
|
||||
|
||||
@@ -1331,6 +1331,20 @@ genX(cmd_buffer_flush_gfx_runtime_state)(struct anv_cmd_buffer *cmd_buffer)
|
||||
}
|
||||
#endif
|
||||
|
||||
struct anv_push_constants *push = &cmd_buffer->state.gfx.base.push_constants;
|
||||
|
||||
/* If the pipeline uses a dynamic value of patch_control_points and either
|
||||
* the pipeline change or the dynamic value change, check the value and
|
||||
* reemit if needed.
|
||||
*/
|
||||
if (pipeline->dynamic_patch_control_points &&
|
||||
((gfx->dirty & ANV_CMD_DIRTY_PIPELINE) ||
|
||||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_TS_PATCH_CONTROL_POINTS)) &&
|
||||
push->gfx.tcs_input_vertices != dyn->ts.patch_control_points) {
|
||||
push->gfx.tcs_input_vertices = dyn->ts.patch_control_points;
|
||||
cmd_buffer->state.push_constants_dirty |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
|
||||
}
|
||||
|
||||
#undef GET
|
||||
#undef SET
|
||||
#undef SET_STAGE
|
||||
|
||||
Reference in New Issue
Block a user