mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nir/gather_info: clear clip/cull_distance_array_size if the IO is not present
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38465>
This commit is contained in:
parent
a03b686805
commit
bdcb7bc674
1 changed files with 15 additions and 0 deletions
|
|
@ -1140,4 +1140,19 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
|
|||
shader->info.ray_queries += MAX2(glsl_get_aoa_size(var->type), 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clip distance varyings might have been eliminated because they only
|
||||
* contained out-of-bounds writes. Clear clip/cull distance array sizes
|
||||
* in shader_info if they no longer exist. The array sizes refer to
|
||||
* outputs except FS where they refer to inputs.
|
||||
*/
|
||||
uint64_t clipdist_io_mask = shader->info.stage == MESA_SHADER_FRAGMENT ?
|
||||
shader->info.inputs_read :
|
||||
shader->info.outputs_written;
|
||||
if (!(clipdist_io_mask &
|
||||
(BITFIELD64_RANGE(VARYING_SLOT_CLIP_DIST0, 2) |
|
||||
BITFIELD64_RANGE(VARYING_SLOT_CULL_DIST0, 2)))) {
|
||||
shader->info.clip_distance_array_size = 0;
|
||||
shader->info.cull_distance_array_size = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue