summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-04-22 15:27:33 -0500
committerNicolai Hähnle <[email protected]>2016-04-27 11:16:40 -0500
commit450ff0f0d5d603bb36ca3fbd9c871c9e8553baab (patch)
treef7a799f3a029d15bf38a55b1b2971859ec17489b /src/gallium
parent0ff05b55c62d0a809f3beb46ac587d4952ded59a (diff)
radeonsi: use level mask for early out in si_blit_decompress_color
Mostly for consistency with the other decompress functions, but note that in the non-DCC decompress case, the function can now early-out in slightly more (albeit probably rare) cases. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 09f32071365..32f953daef6 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -309,17 +309,19 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
bool need_dcc_decompress)
{
struct si_context *sctx = (struct si_context *)ctx;
- unsigned layer, level, checked_last_layer, max_layer;
+ unsigned layer, checked_last_layer, max_layer;
+ unsigned level_mask =
+ u_bit_consecutive(first_level, last_level - first_level + 1);
- if (!rtex->dirty_level_mask && !need_dcc_decompress)
+ if (!need_dcc_decompress)
+ level_mask &= rtex->dirty_level_mask;
+ if (!level_mask)
return;
- for (level = first_level; level <= last_level; level++) {
+ while (level_mask) {
+ unsigned level = u_bit_scan(&level_mask);
void* custom_blend;
- if (!(rtex->dirty_level_mask & (1 << level)) && !need_dcc_decompress)
- continue;
-
if (rtex->dcc_offset && need_dcc_decompress) {
custom_blend = sctx->custom_blend_dcc_decompress;
} else if (rtex->fmask.size) {