freedreno/ir3: get the post-lowering clip/cull mask
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 21 Nov 2021 00:17:43 +0000 (19:17 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 28 Nov 2021 07:55:58 +0000 (02:55 -0500)
The variant may include a lowered gl_Clip/CullDistance array. So we have
to use the variant's info (which is not available). However we save off
the clip/cull masks already, so just reuse those.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13891>

src/freedreno/ir3/ir3_compiler_nir.c

index 05c9372..bb4b627 100644 (file)
@@ -3573,10 +3573,7 @@ pack_inlocs(struct ir3_context *ctx)
     * use the NIR clip/cull distances to avoid reading ucp_enables in the
     * shader key.
     */
-   unsigned clip_cull_size =
-      ctx->so->shader->nir->info.clip_distance_array_size +
-      ctx->so->shader->nir->info.cull_distance_array_size;
-   unsigned clip_cull_mask = MASK(clip_cull_size);
+   unsigned clip_cull_mask = so->clip_mask | so->cull_mask;
 
    for (unsigned i = 0; i < so->inputs_count; i++) {
       unsigned compmask = 0, maxcomp = 0;