From fa323cb93a128676beda5654d1691f8f5a62f7b5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 2 Mar 2022 13:26:08 -0500 Subject: [PATCH] mesa/st: make export_point_size shader key clobber existing psiz this is necessary to upload the API value using the uniform constant Reviewed-by: Ilia Mirkin Part-of: --- src/mesa/state_tracker/st_program.c | 38 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index c0802ae..06b2eb2 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -798,29 +798,25 @@ st_create_common_variant(struct st_context *st, if (key->export_point_size) { /* if flag is set, shader must export psiz */ - nir_shader *nir = state.ir.nir; - /* avoid clobbering existing psiz output */ - if (!(nir->info.outputs_written & BITFIELD64_BIT(VARYING_SLOT_PSIZ))) { - _mesa_add_state_reference(params, point_size_state); - NIR_PASS_V(state.ir.nir, nir_lower_point_size_mov, - point_size_state); - - switch (prog->info.stage) { - case MESA_SHADER_VERTEX: - prog->affected_states |= ST_NEW_VS_CONSTANTS; - break; - case MESA_SHADER_TESS_EVAL: - prog->affected_states |= ST_NEW_TES_CONSTANTS; - break; - case MESA_SHADER_GEOMETRY: - prog->affected_states |= ST_NEW_GS_CONSTANTS; - break; - default: - unreachable("bad shader stage"); - } + _mesa_add_state_reference(params, point_size_state); + NIR_PASS_V(state.ir.nir, nir_lower_point_size_mov, + point_size_state); - finalize = true; + switch (prog->info.stage) { + case MESA_SHADER_VERTEX: + prog->affected_states |= ST_NEW_VS_CONSTANTS; + break; + case MESA_SHADER_TESS_EVAL: + prog->affected_states |= ST_NEW_TES_CONSTANTS; + break; + case MESA_SHADER_GEOMETRY: + prog->affected_states |= ST_NEW_GS_CONSTANTS; + break; + default: + unreachable("bad shader stage"); } + + finalize = true; } if (key->lower_ucp) { -- 2.7.4