diff options
author | Marek Olšák <[email protected]> | 2016-04-28 21:08:27 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-04-30 19:36:16 +0200 |
commit | 53435514c16714b3ed80fc0c1008461b2fff8a9a (patch) | |
tree | 68d5a2eae7e0178b6fb8f3fac002eb5df8b481d7 /src/gallium/drivers/radeonsi | |
parent | 8f2238ccbae399a20fce24c5941accced7cee8d2 (diff) |
radeonsi: fix synchronization of shader images
This fixes the winsys->cs_is_buffer_referenced query, which is used for
synchronization before buffers are mapped.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index fbaf804be90..27f2a7412e6 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -261,15 +261,15 @@ static void si_release_sampler_views(struct si_sampler_views *views) } static void si_sampler_view_add_buffer(struct si_context *sctx, - struct pipe_resource *resource) + struct pipe_resource *resource, + enum radeon_bo_usage usage) { struct r600_resource *rres = (struct r600_resource*)resource; if (!resource) return; - radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, rres, - RADEON_USAGE_READ, + radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx, rres, usage, r600_get_sampler_view_priority(rres)); } @@ -282,7 +282,8 @@ static void si_sampler_views_begin_new_cs(struct si_context *sctx, while (mask) { int i = u_bit_scan(&mask); - si_sampler_view_add_buffer(sctx, views->views[i]->texture); + si_sampler_view_add_buffer(sctx, views->views[i]->texture, + RADEON_USAGE_READ); } views->desc.ce_ram_dirty = true; @@ -310,7 +311,8 @@ static void si_set_sampler_view(struct si_context *sctx, if (view) { struct r600_texture *rtex = (struct r600_texture *)view->texture; - si_sampler_view_add_buffer(sctx, view->texture); + si_sampler_view_add_buffer(sctx, view->texture, + RADEON_USAGE_READ); pipe_sampler_view_reference(&views->views[slot], view); memcpy(views->desc.list + slot * 16, rview->state, 8*4); @@ -441,7 +443,8 @@ si_image_views_begin_new_cs(struct si_context *sctx, struct si_images_info *imag assert(view->resource); - si_sampler_view_add_buffer(sctx, view->resource); + si_sampler_view_add_buffer(sctx, view->resource, + RADEON_USAGE_READWRITE); } images->desc.ce_ram_dirty = true; @@ -495,7 +498,8 @@ si_set_shader_images(struct pipe_context *pipe, unsigned shader, res = (struct r600_resource *)views[i].resource; util_copy_image_view(&images->views[slot], &views[i]); - si_sampler_view_add_buffer(ctx, &res->b.b); + si_sampler_view_add_buffer(ctx, &res->b.b, + RADEON_USAGE_READWRITE); if (res->b.b.target == PIPE_BUFFER) { si_make_buffer_descriptor(screen, res, |