[Mesa-dev] [PATCH 09/11] radeonsi: simplify the signature of si_update_vs_writes_viewport_index

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 29 11:01:36 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/gallium/drivers/radeonsi/si_pipe.h          | 3 +--
 src/gallium/drivers/radeonsi/si_state_shaders.c | 6 +++---
 src/gallium/drivers/radeonsi/si_viewport.c      | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index e0759eddb2c..4fe158fb9af 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -562,22 +562,21 @@ void si_init_perfcounters(struct si_screen *screen);
 /* si_uvd.c */
 struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
 					       const struct pipe_video_codec *templ);
 
 struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
 						 const struct pipe_video_buffer *tmpl);
 
 /* si_viewport.c */
 void si_viewport_set_rast_deps(struct si_context *rctx,
 			       bool scissor_enable, bool clip_halfz);
-void si_update_vs_writes_viewport_index(struct si_context *ctx,
-					struct tgsi_shader_info *info);
+void si_update_vs_writes_viewport_index(struct si_context *ctx);
 void si_init_viewport_functions(struct si_context *ctx);
 
 
 /*
  * common helpers
  */
 
 static inline void
 si_invalidate_draw_sh_constants(struct si_context *sctx)
 {
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 7619e2f04aa..1fadc7ec5d9 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2294,21 +2294,21 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
 	struct si_shader *old_hw_vs_variant = si_get_vs_state(sctx);
 	struct si_shader_selector *sel = state;
 
 	if (sctx->vs_shader.cso == sel)
 		return;
 
 	sctx->vs_shader.cso = sel;
 	sctx->vs_shader.current = sel ? sel->first_variant : NULL;
 
 	si_update_common_shader_state(sctx);
-	si_update_vs_writes_viewport_index(sctx, si_get_vs_info(sctx));
+	si_update_vs_writes_viewport_index(sctx);
 	si_set_active_descriptors_for_shader(sctx, sel);
 	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));
 }
 
 static void si_update_tess_uses_prim_id(struct si_context *sctx)
 {
 	sctx->ia_multi_vgt_param_key.u.tess_uses_prim_id =
 		(sctx->tes_shader.cso &&
@@ -2337,21 +2337,21 @@ static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
 	sctx->ia_multi_vgt_param_key.u.uses_gs = sel != NULL;
 
 	si_update_common_shader_state(sctx);
 	sctx->last_rast_prim = -1; /* reset this so that it gets updated */
 
 	if (enable_changed) {
 		si_shader_change_notify(sctx);
 		if (sctx->ia_multi_vgt_param_key.u.uses_tess)
 			si_update_tess_uses_prim_id(sctx);
 	}
-	si_update_vs_writes_viewport_index(sctx, si_get_vs_info(sctx));
+	si_update_vs_writes_viewport_index(sctx);
 	si_set_active_descriptors_for_shader(sctx, sel);
 	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));
 }
 
 static void si_bind_tcs_shader(struct pipe_context *ctx, void *state)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
 	struct si_shader_selector *sel = state;
@@ -2388,21 +2388,21 @@ static void si_bind_tes_shader(struct pipe_context *ctx, void *state)
 	sctx->ia_multi_vgt_param_key.u.uses_tess = sel != NULL;
 	si_update_tess_uses_prim_id(sctx);
 
 	si_update_common_shader_state(sctx);
 	sctx->last_rast_prim = -1; /* reset this so that it gets updated */
 
 	if (enable_changed) {
 		si_shader_change_notify(sctx);
 		sctx->last_tes_sh_base = -1; /* invalidate derived tess state */
 	}
-	si_update_vs_writes_viewport_index(sctx, si_get_vs_info(sctx));
+	si_update_vs_writes_viewport_index(sctx);
 	si_set_active_descriptors_for_shader(sctx, sel);
 	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));
 }
 
 static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
 	struct si_shader_selector *old_sel = sctx->ps_shader.cso;
diff --git a/src/gallium/drivers/radeonsi/si_viewport.c b/src/gallium/drivers/radeonsi/si_viewport.c
index 2d8b182ace0..c4ffe385765 100644
--- a/src/gallium/drivers/radeonsi/si_viewport.c
+++ b/src/gallium/drivers/radeonsi/si_viewport.c
@@ -383,23 +383,23 @@ void si_viewport_set_rast_deps(struct si_context *ctx,
 		si_mark_atom_dirty(ctx, &ctx->viewports.atom);
 	}
 }
 
 /**
  * Normally, we only emit 1 viewport and 1 scissor if no shader is using
  * the VIEWPORT_INDEX output, and emitting the other viewports and scissors
  * is delayed. When a shader with VIEWPORT_INDEX appears, this should be
  * called to emit the rest.
  */
-void si_update_vs_writes_viewport_index(struct si_context *ctx,
-					struct tgsi_shader_info *info)
+void si_update_vs_writes_viewport_index(struct si_context *ctx)
 {
+	struct tgsi_shader_info *info = si_get_vs_info(ctx);
 	bool vs_window_space;
 
 	if (!info)
 		return;
 
 	/* When the VS disables clipping and viewport transformation. */
 	vs_window_space =
 		info->properties[TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION];
 
 	if (ctx->vs_disables_clipping_viewport != vs_window_space) {
-- 
2.11.0



More information about the mesa-dev mailing list