ac/nir/ngg: fix clip dist culling mask uninitialized

Fixes: f75452918b ("ac/nir/ngg: support clipdist culling")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
This commit is contained in:
Qiang Yu 2023-01-14 22:06:32 +08:00 committed by Marge Bot
parent 7c41cdb81f
commit d798214c7b

View file

@ -1391,12 +1391,17 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
nir_local_variable_create(impl, glsl_uint_type(), "repacked_arg_3"),
};
b->cursor = nir_before_cf_list(&impl->body);
if (nogs_state->options->clipdist_enable_mask ||
nogs_state->options->user_clip_plane_enable_mask) {
nogs_state->clip_vertex_var =
nir_local_variable_create(impl, glsl_vec4_type(), "clip_vertex");
nogs_state->clipdist_neg_mask_var =
nir_local_variable_create(impl, glsl_uint8_t_type(), "clipdist_neg_mask");
/* init mask to 0 */
nir_store_var(b, nogs_state->clipdist_neg_mask_var, nir_imm_intN_t(b, 0, 8), 1);
}
/* Top part of the culling shader (aka. position shader part)
@ -1406,8 +1411,6 @@ add_deferred_attribute_culling(nir_builder *b, nir_cf_list *original_extracted_c
* The position output is stored into a temporary variable, and reloaded later.
*/
b->cursor = nir_before_cf_list(&impl->body);
nir_ssa_def *es_thread = has_input_vertex(b);
nir_if *if_es_thread = nir_push_if(b, es_thread);
{