[Mesa-dev] [PATCH 06/11] radeonsi: remove si_apply_scissor_bug_workaround

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


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

It only affects pre-SI chips.
---
 src/gallium/drivers/radeon/r600_pipe_common.h |  2 --
 src/gallium/drivers/radeonsi/si_viewport.c    | 17 -----------------
 2 files changed, 19 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index f6ded92dc5b..4508a768768 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -873,22 +873,20 @@ void si_do_fast_color_clear(struct r600_common_context *rctx,
 			    struct pipe_framebuffer_state *fb,
 			    struct r600_atom *fb_state,
 			    unsigned *buffers, ubyte *dirty_cbufs,
 			    const union pipe_color_union *color);
 bool si_texture_disable_dcc(struct r600_common_context *rctx,
 			    struct r600_texture *rtex);
 void si_init_screen_texture_functions(struct r600_common_screen *rscreen);
 void si_init_context_texture_functions(struct r600_common_context *rctx);
 
 /* r600_viewport.c */
-void si_apply_scissor_bug_workaround(struct r600_common_context *rctx,
-				     struct pipe_scissor_state *scissor);
 void si_viewport_set_rast_deps(struct r600_common_context *rctx,
 			       bool scissor_enable, bool clip_halfz);
 void si_update_vs_writes_viewport_index(struct r600_common_context *rctx,
 					struct tgsi_shader_info *info);
 void si_init_viewport_functions(struct r600_common_context *rctx);
 
 /* cayman_msaa.c */
 void si_get_sample_position(struct pipe_context *ctx, unsigned sample_count,
 			    unsigned sample_index, float *out_value);
 void si_init_msaa(struct pipe_context *ctx);
diff --git a/src/gallium/drivers/radeonsi/si_viewport.c b/src/gallium/drivers/radeonsi/si_viewport.c
index 00fa4c0d026..54f31c4694d 100644
--- a/src/gallium/drivers/radeonsi/si_viewport.c
+++ b/src/gallium/drivers/radeonsi/si_viewport.c
@@ -108,54 +108,37 @@ static void r600_clip_scissor(struct pipe_scissor_state *out,
 
 static void r600_scissor_make_union(struct r600_signed_scissor *out,
 				    struct r600_signed_scissor *in)
 {
 	out->minx = MIN2(out->minx, in->minx);
 	out->miny = MIN2(out->miny, in->miny);
 	out->maxx = MAX2(out->maxx, in->maxx);
 	out->maxy = MAX2(out->maxy, in->maxy);
 }
 
-void si_apply_scissor_bug_workaround(struct r600_common_context *rctx,
-				     struct pipe_scissor_state *scissor)
-{
-	if (rctx->chip_class == EVERGREEN || rctx->chip_class == CAYMAN) {
-		if (scissor->maxx == 0)
-			scissor->minx = 1;
-		if (scissor->maxy == 0)
-			scissor->miny = 1;
-
-		if (rctx->chip_class == CAYMAN &&
-		    scissor->maxx == 1 && scissor->maxy == 1)
-			scissor->maxx = 2;
-	}
-}
-
 static void r600_emit_one_scissor(struct r600_common_context *rctx,
 				  struct radeon_winsys_cs *cs,
 				  struct r600_signed_scissor *vp_scissor,
 				  struct pipe_scissor_state *scissor)
 {
 	struct pipe_scissor_state final;
 
 	if (rctx->vs_disables_clipping_viewport) {
 		final.minx = final.miny = 0;
 		final.maxx = final.maxy = GET_MAX_SCISSOR(rctx);
 	} else {
 		r600_clamp_scissor(rctx, &final, vp_scissor);
 	}
 
 	if (scissor)
 		r600_clip_scissor(&final, scissor);
 
-	si_apply_scissor_bug_workaround(rctx, &final);
-
 	radeon_emit(cs, S_028250_TL_X(final.minx) |
 			S_028250_TL_Y(final.miny) |
 			S_028250_WINDOW_OFFSET_DISABLE(1));
 	radeon_emit(cs, S_028254_BR_X(final.maxx) |
 			S_028254_BR_Y(final.maxy));
 }
 
 /* the range is [-MAX, MAX] */
 #define GET_MAX_VIEWPORT_RANGE(rctx) (rctx->chip_class >= EVERGREEN ? 32768 : 16384)
 
-- 
2.11.0



More information about the mesa-dev mailing list