diff options
author | Marek Olšák <[email protected]> | 2017-01-17 20:46:39 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-18 19:51:31 +0100 |
commit | 861d7af1cb33483902796f5b29ce496e4a322e94 (patch) | |
tree | 86c8ffcab97f4e7e5ae1b1450fb8f67eb265e516 /src/gallium/drivers/radeonsi/si_blit.c | |
parent | 4bde7d3d3c90e3930e56b83f8e517d6ce6ea26d4 (diff) |
radeonsi: use a bitmask-based loop in si_decompress_textures
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_blit.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_blit.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 5b533732a4d..da6c0cda2bb 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -618,10 +618,9 @@ static void si_check_render_feedback(struct si_context *sctx) sctx->need_check_render_feedback = false; } -static void si_decompress_textures(struct si_context *sctx, int shader_start, - int shader_end) +static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask) { - unsigned compressed_colortex_counter; + unsigned compressed_colortex_counter, mask; if (sctx->blitter->running) return; @@ -633,8 +632,11 @@ static void si_decompress_textures(struct si_context *sctx, int shader_start, si_update_compressed_colortex_masks(sctx); } - /* Flush depth textures which need to be flushed. */ - for (int i = shader_start; i < shader_end; i++) { + /* Decompress color & depth textures if needed. */ + mask = sctx->compressed_tex_shader_mask & shader_mask; + while (mask) { + unsigned i = u_bit_scan(&mask); + if (sctx->samplers[i].depth_texture_mask) { si_flush_depth_textures(sctx, &sctx->samplers[i]); } @@ -651,12 +653,12 @@ static void si_decompress_textures(struct si_context *sctx, int shader_start, void si_decompress_graphics_textures(struct si_context *sctx) { - si_decompress_textures(sctx, 0, SI_NUM_GRAPHICS_SHADERS); + si_decompress_textures(sctx, u_bit_consecutive(0, SI_NUM_GRAPHICS_SHADERS)); } void si_decompress_compute_textures(struct si_context *sctx) { - si_decompress_textures(sctx, SI_NUM_GRAPHICS_SHADERS, SI_NUM_SHADERS); + si_decompress_textures(sctx, 1 << PIPE_SHADER_COMPUTE); } static void si_clear(struct pipe_context *ctx, unsigned buffers, |