nir/lower_clip_cull: Store array size for FS inputs
I think the rationale for not setting the size for inputs is that when passed between geometry stages the clip and cull distances are supposed to be treated like any other varying. However, this isn't 100% the case for the FS, since when it's read by the FS it's also used by the fixed-function stage. In freedreno we setup varying locations when compiling the FS, and then tack on VS-only outputs like gl_Position at the end. Furthermore there's code to compact input locations based on what's actually read. But this compaction can't happen for clip and cull distances, because then we won't have space for components that are only read by the clipper. So, we need to know the original number of components for both arrays. Modify this pass so that we don't have to go digging around for it ourselves. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6959>
This commit is contained in:
parent
cb6ce4a265
commit
4ca38a1995
|
@ -127,8 +127,10 @@ nir_lower_clip_cull_distance_arrays(nir_shader *nir)
|
|||
if (nir->info.stage <= MESA_SHADER_GEOMETRY)
|
||||
progress |= combine_clip_cull(nir, nir_var_shader_out, true);
|
||||
|
||||
if (nir->info.stage > MESA_SHADER_VERTEX)
|
||||
progress |= combine_clip_cull(nir, nir_var_shader_in, false);
|
||||
if (nir->info.stage > MESA_SHADER_VERTEX) {
|
||||
progress |= combine_clip_cull(nir, nir_var_shader_in,
|
||||
nir->info.stage == MESA_SHADER_FRAGMENT);
|
||||
}
|
||||
|
||||
nir_foreach_function(function, nir) {
|
||||
if (!function->impl)
|
||||
|
|
Loading…
Reference in New Issue