diff options
author | Marek Olšák <[email protected]> | 2014-08-11 15:06:23 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-08-14 20:45:03 +0200 |
commit | 87a8ed9389bbc49828e711515e0cafc7b9424a30 (patch) | |
tree | 9d9b88bc62cf513950514f9b426115557724eb76 /src/gallium/drivers/radeonsi/si_descriptors.c | |
parent | 79f28cdb983b7faf9d3008fae541a30e34ccce5a (diff) |
radeonsi: fix buffer invalidation of unbound texture buffer objects
This maintains a list of all TBOs in a pipe_context.
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index c877797b83c..0e95f485e52 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -914,6 +914,7 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource uint64_t old_va = rbuffer->gpu_address; unsigned num_elems = sctx->vertex_elements ? sctx->vertex_elements->count : 0; + struct si_pipe_sampler_view *view; /* Reallocate the buffer in the same pipe_resource. */ r600_init_resource(&sctx->screen->b, rbuffer, rbuffer->b.b.width0, @@ -1000,7 +1001,13 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource } } - /* Texture buffers. */ + /* Texture buffers - update virtual addresses in sampler view descriptors. */ + LIST_FOR_EACH_ENTRY(view, &sctx->b.texture_buffers, list) { + if (view->base.texture == buf) { + si_desc_reset_buffer_offset(ctx, view->state, old_va, buf); + } + } + /* Texture buffers - update bindings. */ for (shader = 0; shader < SI_NUM_SHADERS; shader++) { struct si_sampler_views *views = &sctx->samplers[shader].views; bool found = false; @@ -1009,10 +1016,6 @@ static void si_invalidate_buffer(struct pipe_context *ctx, struct pipe_resource while (mask) { unsigned i = u_bit_scan(&mask); if (views->views[i]->texture == buf) { - /* This updates the sampler view directly. */ - si_desc_reset_buffer_offset(ctx, views->desc_data[i], - old_va, buf); - r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx, rbuffer, RADEON_USAGE_READ, RADEON_PRIO_SHADER_BUFFER_RO); |