summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-01-09 07:26:39 -0500
committerMarge Bot <eric+marge@anholt.net>2021-01-20 21:53:13 +0000
commitc5d3341b6e1ca502b160249e33c7bb097868dd9a (patch)
treeccc8af226e8cd6334930a6c61d1634559297334d
parent5f7715083bf1523563c9947362f1d129a38591c5 (diff)
radeonsi: inline the last use of si_get_vs_state
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8600>
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.h9
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c8
2 files changed, 7 insertions, 10 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 055e4cffad4..1a2a16f4ec0 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index f383793aae2..4342c26f00d 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -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);