radeonsi: simplify write_psize code in si_get_vs_out_cntl
authorMarek Olšák <marek.olsak@amd.com>
Tue, 5 Oct 2021 21:16:10 +0000 (17:16 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 13 Oct 2021 10:28:14 +0000 (10:28 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12789>

src/gallium/drivers/radeonsi/si_state_shaders.c

index 3d7dad4..921bd54 100644 (file)
@@ -1119,14 +1119,11 @@ static unsigned si_get_vs_out_cntl(const struct si_shader_selector *sel,
    /* Clip distances can be killed, but cull distances can't. */
    unsigned clipcull_mask = (sel->clipdist_mask & ~shader->key.opt.kill_clip_distances) |
                             sel->culldist_mask;
-   bool writes_psize = sel->info.writes_psize;
-
-   if (shader)
-      writes_psize &= !shader->key.opt.kill_pointsize;
-
+   bool writes_psize = sel->info.writes_psize && !shader->key.opt.kill_pointsize;
    bool misc_vec_ena = writes_psize || (sel->info.writes_edgeflag && !ngg) ||
                        sel->screen->options.vrs2x2 ||
                        sel->info.writes_layer || sel->info.writes_viewport_index;
+
    return S_02881C_VS_OUT_CCDIST0_VEC_ENA((clipcull_mask & 0x0F) != 0) |
           S_02881C_VS_OUT_CCDIST1_VEC_ENA((clipcull_mask & 0xF0) != 0) |
           S_02881C_USE_VTX_POINT_SIZE(writes_psize) |