[Mesa-dev] [PATCH 06.5/20] radeonsi: update shader image descriptor for invalidated buffer
Nicolai Hähnle
nhaehnle at gmail.com
Thu Mar 17 01:55:33 UTC 2016
On 15.03.2016 22:04, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
> src/gallium/drivers/radeonsi/si_descriptors.c | 22 +++++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
> index 37e49e5..10d4499 100644
> --- a/src/gallium/drivers/radeonsi/si_descriptors.c
> +++ b/src/gallium/drivers/radeonsi/si_descriptors.c
> @@ -1094,7 +1094,27 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource
> }
> }
>
> - /* Shader images - update TODO */
> + /* Shader images */
> + for (shader = 0; shader < SI_NUM_IMAGES; ++shader) {
This should of course be SI_NUM_SHADERS, as a non-debug build just
warned me...
> + struct si_images_info *images = &sctx->images[shader];
> + unsigned mask = images->desc.enabled_mask;
> +
> + while (mask) {
> + unsigned i = u_bit_scan(&mask);
> +
> + if (images->views[i].resource == buf) {
> + si_desc_reset_buffer_offset(
> + ctx, images->desc.list + i * 8 + 4,
> + old_va, buf);
> + images->desc.list_dirty = true;
> +
> + radeon_add_to_buffer_list(
> + &sctx->b, &sctx->b.gfx, rbuffer,
> + RADEON_USAGE_READWRITE,
> + RADEON_PRIO_SAMPLER_BUFFER);
> + }
> + }
> + }
> }
>
> /* SHADER USER DATA */
>
More information about the mesa-dev
mailing list