ac/nir/tess: Return undef when loading an unwritten TCS output.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28487>
This commit is contained in:
Timur Kristóf 2024-03-30 23:14:43 +01:00 committed by Marge Bot
parent a1c821e911
commit a167cb9ba3

View file

@ -544,6 +544,10 @@ lower_hs_output_load(nir_builder *b,
return nir_extract_bits(b, &var, 1, component * bit_size, num_components, bit_size);
}
/* If an output is not stored by the shader, replace the output load by undef. */
if (!tcs_output_needs_lds(intrin, b->shader, st))
return nir_undef(b, intrin->def.num_components, intrin->def.bit_size);
nir_def *off = hs_output_lds_offset(b, st, intrin);
return nir_load_shared(b, intrin->def.num_components, intrin->def.bit_size, off);
}