summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-06-21 15:18:44 +1000
committerDave Airlie <[email protected]>2011-06-21 15:18:44 +1000
commite251b3903a6aadd49cec6a9ce1ce466e3fcbbdcd (patch)
treee6c4a08a2f1112360619a9d27a54766195e05793 /src/gallium
parent59a402cecd74e0a7a277f5af0b8a2707857846ed (diff)
r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 0fe0e3d5d67..30c61817a08 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -576,10 +576,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
if (rctx->alpha_ref_dirty)
r600_update_alpha_ref(rctx);
- mask = 0;
- for (int i = 0; i < rctx->framebuffer.nr_cbufs; i++) {
- mask |= (0xF << (i * 4));
- }
+ mask = (1ULL << ((unsigned)rctx->framebuffer.nr_cbufs * 4)) - 1;
if (rctx->vgt.id != R600_PIPE_STATE_VGT) {
rctx->vgt.id = R600_PIPE_STATE_VGT;