[Mesa-dev] [PATCH 1/8] r600g: simplify framebuffer state size computation

Marek Olšák maraeo at gmail.com
Wed May 7 06:53:37 PDT 2014


From: Marek Olšák <marek.olsak at amd.com>

Take the upper bound. The number doesn't have to absolutely correct, only safe.
---
 src/gallium/drivers/r600/evergreen_state.c | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index f7a63a8..7b1a44b 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1394,32 +1394,10 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
 	rctx->framebuffer.atom.num_dw = 4; /* SCISSOR */
 
 	/* MSAA. */
-	if (rctx->b.chip_class == EVERGREEN) {
-		switch (rctx->framebuffer.nr_samples) {
-		case 2:
-		case 4:
-			rctx->framebuffer.atom.num_dw += 6;
-			break;
-		case 8:
-			rctx->framebuffer.atom.num_dw += 10;
-			break;
-		}
-		rctx->framebuffer.atom.num_dw += 4;
-	} else {
-		switch (rctx->framebuffer.nr_samples) {
-		case 2:
-		case 4:
-			rctx->framebuffer.atom.num_dw += 12;
-			break;
-		case 8:
-			rctx->framebuffer.atom.num_dw += 16;
-			break;
-		case 16:
-			rctx->framebuffer.atom.num_dw += 18;
-			break;
-		}
-		rctx->framebuffer.atom.num_dw += 7;
-	}
+	if (rctx->b.chip_class == EVERGREEN)
+		rctx->framebuffer.atom.num_dw += 14; /* Evergreen */
+	else
+		rctx->framebuffer.atom.num_dw += 25; /* Cayman */
 
 	/* Colorbuffers. */
 	rctx->framebuffer.atom.num_dw += state->nr_cbufs * 23;
-- 
1.9.1



More information about the mesa-dev mailing list