From af5f49f663d29abfd840e5c258b422107ae38f01 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 9 Feb 2022 07:59:46 -0500 Subject: [PATCH] zink: remove loop from generated tcs this is already using per-vertex io, no need to add conditionals to verify Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index f6df42a059b..ec6aef06d17 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -2085,15 +2085,11 @@ zink_shader_tcs_create(struct zink_screen *screen, struct zink_shader *vs, unsig implementation-dependent maximum patch size (gl_MaxPatchVertices). - ARB_tessellation_shader */ - for (unsigned i = 0; i < vertices_per_patch; i++) { - /* we need to load the invocation-specific value of the vertex output and then store it to the per-patch output */ - nir_if *start_block = nir_push_if(&b, nir_ieq(&b, invocation_id, nir_imm_int(&b, i))); - nir_deref_instr *in_array_var = nir_build_deref_array(&b, nir_build_deref_var(&b, in), invocation_id); - nir_ssa_def *load = nir_load_deref(&b, in_array_var); - nir_deref_instr *out_array_var = nir_build_deref_array_imm(&b, nir_build_deref_var(&b, out), i); - nir_store_deref(&b, out_array_var, load, 0xff); - nir_pop_if(&b, start_block); - } + /* we need to load the invocation-specific value of the vertex output and then store it to the per-patch output */ + nir_deref_instr *in_array_var = nir_build_deref_array(&b, nir_build_deref_var(&b, in), invocation_id); + nir_ssa_def *load = nir_load_deref(&b, in_array_var); + nir_deref_instr *out_array_var = nir_build_deref_array(&b, nir_build_deref_var(&b, out), invocation_id); + nir_store_deref(&b, out_array_var, load, 0xff); } nir_variable *gl_TessLevelInner = nir_variable_create(nir, nir_var_shader_out, glsl_array_type(glsl_float_type(), 2, 0), "gl_TessLevelInner"); gl_TessLevelInner->data.location = VARYING_SLOT_TESS_LEVEL_INNER;