summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-01-09 07:23:48 -0500
committerMarge Bot <eric+marge@anholt.net>2021-01-18 01:17:19 +0000
commitf1e34f125d9dcf39de751b570a1df375b0d70f11 (patch)
tree34e95d774bd61fd1db7e13732d5b67f7d211f36c
parent4088b6f2936ffccdb2e2b3d8479c964366e51f77 (diff)
radeonsi: don't use si_get_vs_state in most places
It's incorrect because si_get_vs_state returns gs_copy_shader for legacy GS. It was harmless, but let's use si_get_vs, which is simpler. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8548>
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c2
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.cpp4
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c16
3 files changed, 11 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index c2e752ef790..c5a95fcaf75 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -727,7 +727,7 @@ static void si_emit_clip_state(struct si_context *sctx)
static void si_emit_clip_regs(struct si_context *sctx)
{
- struct si_shader *vs = si_get_vs_state(sctx);
+ struct si_shader *vs = si_get_vs(sctx)->current;
struct si_shader_selector *vs_sel = vs->selector;
struct si_shader_info *info = &vs_sel->info;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index f79e1aa28c1..6c68dbb0d9b 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -762,7 +762,7 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx)
sctx->context_roll = true;
if (NGG) {
- struct si_shader *hw_vs = si_get_vs_state(sctx);
+ struct si_shader *hw_vs = si_get_vs(sctx)->current;
if (hw_vs->uses_vs_state_provoking_vertex) {
unsigned vtx_index = rs->flatshade_first ? 0 : gs_out_prim;
@@ -873,7 +873,7 @@ static void gfx10_emit_ge_cntl(struct si_context *sctx, unsigned num_patches)
S_03096C_VERT_GRP_SIZE(0) |
S_03096C_BREAK_WAVE_AT_EOI(key.u.tess_uses_prim_id);
} else {
- ge_cntl = si_get_vs_state(sctx)->ge_cntl;
+ ge_cntl = si_get_vs(sctx)->current->ge_cntl;
}
} else {
unsigned primgroup_size;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 2ab6971c581..f383793aae2 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2984,7 +2984,7 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_shader_selector *old_hw_vs = si_get_vs(sctx)->cso;
- struct si_shader *old_hw_vs_variant = si_get_vs_state(sctx);
+ struct si_shader *old_hw_vs_variant = si_get_vs(sctx)->current;
struct si_shader_selector *sel = state;
if (sctx->vs_shader.cso == sel)
@@ -3003,7 +3003,7 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
si_update_vs_viewport_state(sctx);
si_update_streamout_state(sctx);
si_update_clip_regs(sctx, old_hw_vs, old_hw_vs_variant, si_get_vs(sctx)->cso,
- si_get_vs_state(sctx));
+ si_get_vs(sctx)->current);
}
static void si_update_tess_uses_prim_id(struct si_context *sctx)
@@ -3058,7 +3058,7 @@ static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_shader_selector *old_hw_vs = si_get_vs(sctx)->cso;
- struct si_shader *old_hw_vs_variant = si_get_vs_state(sctx);
+ struct si_shader *old_hw_vs_variant = si_get_vs(sctx)->current;
struct si_shader_selector *sel = state;
bool enable_changed = !!sctx->gs_shader.cso != !!sel;
bool ngg_changed;
@@ -3084,7 +3084,7 @@ static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
si_update_vs_viewport_state(sctx);
si_update_streamout_state(sctx);
si_update_clip_regs(sctx, old_hw_vs, old_hw_vs_variant, si_get_vs(sctx)->cso,
- si_get_vs_state(sctx));
+ si_get_vs(sctx)->current);
}
static void si_bind_tcs_shader(struct pipe_context *ctx, void *state)
@@ -3110,7 +3110,7 @@ static void si_bind_tes_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_shader_selector *old_hw_vs = si_get_vs(sctx)->cso;
- struct si_shader *old_hw_vs_variant = si_get_vs_state(sctx);
+ struct si_shader *old_hw_vs_variant = si_get_vs(sctx)->current;
struct si_shader_selector *sel = state;
bool enable_changed = !!sctx->tes_shader.cso != !!sel;
@@ -3134,7 +3134,7 @@ static void si_bind_tes_shader(struct pipe_context *ctx, void *state)
si_update_vs_viewport_state(sctx);
si_update_streamout_state(sctx);
si_update_clip_regs(sctx, old_hw_vs, old_hw_vs_variant, si_get_vs(sctx)->cso,
- si_get_vs_state(sctx));
+ si_get_vs(sctx)->current);
}
static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
@@ -3906,7 +3906,7 @@ bool si_update_shaders(struct si_context *sctx)
struct pipe_context *ctx = (struct pipe_context *)sctx;
struct si_compiler_ctx_state compiler_state;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
- struct si_shader *old_vs = si_get_vs_state(sctx);
+ struct si_shader *old_vs = si_get_vs(sctx)->current;
unsigned old_kill_clip_distances = old_vs ? old_vs->key.opt.kill_clip_distances : 0;
struct si_shader *old_ps = sctx->ps_shader.current;
union si_vgt_stages_key key;
@@ -4038,7 +4038,7 @@ bool si_update_shaders(struct si_context *sctx)
si_update_vgt_shader_config(sctx, key);
- if (old_kill_clip_distances != si_get_vs_state(sctx)->key.opt.kill_clip_distances)
+ if (old_kill_clip_distances != si_get_vs(sctx)->current->key.opt.kill_clip_distances)
si_mark_atom_dirty(sctx, &sctx->atoms.s.clip_regs);
if (sctx->ps_shader.cso) {