radeonsi: inline the last use of si_get_vs_state
authorMarek Olšák <marek.olsak@amd.com>
Sat, 9 Jan 2021 12:26:39 +0000 (07:26 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 20 Jan 2021 21:53:13 +0000 (21:53 +0000)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8600>

src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index 055e4cf..1a2a16f 100644 (file)
@@ -1695,15 +1695,6 @@ static inline struct si_shader_info *si_get_vs_info(struct si_context *sctx)
    return vs->cso ? &vs->cso->info : NULL;
 }
 
-static inline struct si_shader *si_get_vs_state(struct si_context *sctx)
-{
-   if (sctx->gs_shader.cso && sctx->gs_shader.current && !sctx->gs_shader.current->key.as_ngg)
-      return sctx->gs_shader.cso->gs_copy_shader;
-
-   struct si_shader_ctx_state *vs = si_get_vs(sctx);
-   return vs->current ? vs->current : NULL;
-}
-
 static inline bool si_can_dump_shader(struct si_screen *sscreen, gl_shader_stage stage)
 {
    return sscreen->debug_flags & (1 << stage);
index f383793..4342c26 100644 (file)
@@ -3337,7 +3337,7 @@ static unsigned si_get_ps_input_cntl(struct si_context *sctx, struct si_shader *
 static void si_emit_spi_map(struct si_context *sctx)
 {
    struct si_shader *ps = sctx->ps_shader.current;
-   struct si_shader *vs = si_get_vs_state(sctx);
+   struct si_shader *vs;
    struct si_shader_info *psinfo = ps ? &ps->selector->info : NULL;
    unsigned i, num_interp, num_written = 0;
    unsigned spi_ps_input_cntl[32];
@@ -3345,6 +3345,12 @@ static void si_emit_spi_map(struct si_context *sctx)
    if (!ps || !ps->selector->info.num_inputs)
       return;
 
+   /* With legacy GS, only the GS copy shader contains information about param exports. */
+   if (sctx->gs_shader.cso && !sctx->ngg)
+      vs = sctx->gs_shader.cso->gs_copy_shader;
+   else
+      vs = si_get_vs(sctx)->current;
+
    num_interp = si_get_ps_num_interp(ps);
    assert(num_interp > 0);