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;
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]);
}
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,
(rtex->dcc_offset && rtex->dirty_level_mask);
}
+static void si_update_compressed_tex_shader_mask(struct si_context *sctx,
+ unsigned shader)
+{
+ struct si_textures_info *samplers = &sctx->samplers[shader];
+ unsigned shader_bit = 1 << shader;
+
+ if (samplers->depth_texture_mask ||
+ samplers->compressed_colortex_mask ||
+ sctx->images[shader].compressed_colortex_mask)
+ sctx->compressed_tex_shader_mask |= shader_bit;
+ else
+ sctx->compressed_tex_shader_mask &= ~shader_bit;
+}
+
static void si_set_sampler_views(struct pipe_context *ctx,
enum pipe_shader_type shader, unsigned start,
unsigned count,
samplers->compressed_colortex_mask &= ~(1u << slot);
}
}
+
+ si_update_compressed_tex_shader_mask(sctx, shader);
}
static void
for (i = 0, slot = start_slot; i < count; ++i, ++slot)
si_set_shader_image(ctx, shader, slot, NULL);
}
+
+ si_update_compressed_tex_shader_mask(ctx, shader);
}
static void
for (int i = 0; i < SI_NUM_SHADERS; ++i) {
si_samplers_update_compressed_colortex_mask(&sctx->samplers[i]);
si_images_update_compressed_colortex_mask(&sctx->images[i]);
+ si_update_compressed_tex_shader_mask(sctx, i);
}
}
si_set_sampler_view(sctx, shader, i,
samplers->views[i], true);
}
+
+ si_update_compressed_tex_shader_mask(sctx, shader);
}
}
struct si_descriptors vertex_buffers;
struct si_descriptors descriptors[SI_NUM_DESCS];
unsigned descriptors_dirty;
+ unsigned compressed_tex_shader_mask;
struct si_buffer_resources rw_buffers;
struct si_buffer_resources const_buffers[SI_NUM_SHADERS];
struct si_buffer_resources shader_buffers[SI_NUM_SHADERS];