This is done by introducing a separate list.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
if ((*tex_handle)->needs_color_decompress)
si_decompress_color_texture(sctx, tex, view->u.tex.first_level,
view->u.tex.last_level);
+ }
- if ((*tex_handle)->needs_depth_decompress)
- si_decompress_depth(sctx, tex,
- sview->is_stencil_sampler ? PIPE_MASK_S : PIPE_MASK_Z,
- view->u.tex.first_level, view->u.tex.last_level,
- 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
+ util_dynarray_foreach(&sctx->resident_tex_needs_depth_decompress,
+ struct si_texture_handle *, tex_handle) {
+ struct pipe_sampler_view *view = (*tex_handle)->view;
+ struct si_sampler_view *sview = (struct si_sampler_view *)view;
+ struct r600_texture *tex = (struct r600_texture *)view->texture;
+
+ si_decompress_depth(sctx, tex,
+ sview->is_stencil_sampler ? PIPE_MASK_S : PIPE_MASK_Z,
+ view->u.tex.first_level, view->u.tex.last_level,
+ 0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
}
}
struct r600_texture *rtex =
(struct r600_texture *)sview->base.texture;
- tex_handle->needs_depth_decompress =
- depth_needs_decompression(rtex, sview);
+ if (depth_needs_decompression(rtex, sview)) {
+ util_dynarray_append(
+ &sctx->resident_tex_needs_depth_decompress,
+ struct si_texture_handle *,
+ tex_handle);
+ }
+
tex_handle->needs_color_decompress =
color_needs_decompression(rtex);
util_dynarray_delete_unordered(&sctx->resident_tex_handles,
struct si_texture_handle *,
tex_handle);
+
+ if (sview->base.texture->target != PIPE_BUFFER) {
+ util_dynarray_delete_unordered(
+ &sctx->resident_tex_needs_depth_decompress,
+ struct si_texture_handle *, tex_handle);
+ }
}
}
util_dynarray_fini(&sctx->resident_tex_handles);
util_dynarray_fini(&sctx->resident_img_handles);
+ util_dynarray_fini(&sctx->resident_tex_needs_depth_decompress);
FREE(sctx);
}
util_dynarray_init(&sctx->resident_tex_handles, NULL);
util_dynarray_init(&sctx->resident_img_handles, NULL);
+ util_dynarray_init(&sctx->resident_tex_needs_depth_decompress, NULL);
return &sctx->b.b;
fail:
struct si_bindless_descriptor *desc;
struct pipe_sampler_view *view;
bool needs_color_decompress;
- bool needs_depth_decompress;
};
struct si_image_handle
struct util_dynarray resident_tex_handles;
struct util_dynarray resident_img_handles;
+ /* Resident bindless handles which need decompression */
+ struct util_dynarray resident_tex_needs_depth_decompress;
+
/* Bindless state */
bool uses_bindless_samplers;
bool uses_bindless_images;