aco: prevent a division by zero when patch control points is dynamic

tess_input_vertices is zero if the state is dynamic.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18344>
This commit is contained in:
Samuel Pitoiset 2022-08-30 17:49:34 +02:00 committed by Marge Bot
parent 21d9390b0e
commit 9a6aa3e23a

View file

@ -11868,8 +11868,8 @@ select_program(Program* program, unsigned shader_count, struct nir_shader* const
if (!ngg_gs && !tcs_skip_barrier) {
sync_scope scope =
ctx.stage == vertex_tess_control_hs &&
program->wave_size % ctx.options->key.tcs.tess_input_vertices == 0 &&
ctx.options->key.tcs.tess_input_vertices == nir->info.tess.tcs_vertices_out
ctx.options->key.tcs.tess_input_vertices == nir->info.tess.tcs_vertices_out &&
program->wave_size % ctx.options->key.tcs.tess_input_vertices == 0
? scope_subgroup
: scope_workgroup;
bld.barrier(aco_opcode::p_barrier,