zink: remove loop from generated tcs

this is already using per-vertex io, no need to add conditionals to verify

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15225>
This commit is contained in:
Mike Blumenkrantz 2022-02-09 07:59:46 -05:00 committed by Marge Bot
parent 7e63fa2bb1
commit af5f49f663
1 changed files with 5 additions and 9 deletions

View File

@ -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;