[Mesa-dev] [PATCH 1/7] radeonsi: mark all bound shader buffer ranges as initialized

Marek Olšák maraeo at gmail.com
Sun Mar 12 17:16:25 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

This should prevent cases when a buffer was incorrectly mapped without
synchronization just because this wasn't done.

Cc: 13.0 17.0 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_descriptors.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 10acb27..eb79578 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1220,20 +1220,23 @@ static void si_set_shader_buffers(struct pipe_context *ctx,
 		pipe_resource_reference(&buffers->buffers[slot], &buf->b.b);
 		radeon_add_to_buffer_list_check_mem(&sctx->b, &sctx->b.gfx, buf,
 						    buffers->shader_usage,
 						    buffers->priority, true);
 		buf->bind_history |= PIPE_BIND_SHADER_BUFFER;
 
 		buffers->enabled_mask |= 1u << slot;
 		descs->dirty_mask |= 1u << slot;
 		sctx->descriptors_dirty |=
 			1u << si_shader_buffer_descriptors_idx(shader);
+
+		util_range_add(&buf->valid_buffer_range, sbuffer->buffer_offset,
+			       sbuffer->buffer_offset + sbuffer->buffer_size);
 	}
 }
 
 void si_get_shader_buffers(struct si_context *sctx,
 			   enum pipe_shader_type shader,
 			   uint start_slot, uint count,
 			   struct pipe_shader_buffer *sbuf)
 {
 	struct si_buffer_resources *buffers = &sctx->shader_buffers[shader];
 	struct si_descriptors *descs = si_shader_buffer_descriptors(sctx, shader);
-- 
2.7.4



More information about the mesa-dev mailing list