[Mesa-dev] [PATCH 17/17] radeonsi: remove upload code for zero-stride vertex attribs

Marek Olšák maraeo at gmail.com
Mon May 1 12:53:06 UTC 2017


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

st/mesa takes care of it now.
---
 src/gallium/drivers/radeonsi/si_state.c | 34 ++++++++-------------------------
 1 file changed, 8 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index b67667f..4f90e33 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3835,46 +3835,28 @@ static void si_set_vertex_buffers(struct pipe_context *ctx,
 	struct si_context *sctx = (struct si_context *)ctx;
 	struct pipe_vertex_buffer *dst = sctx->vertex_buffer + start_slot;
 	int i;
 
 	assert(start_slot + count <= ARRAY_SIZE(sctx->vertex_buffer));
 
 	if (buffers) {
 		for (i = 0; i < count; i++) {
 			const struct pipe_vertex_buffer *src = buffers + i;
 			struct pipe_vertex_buffer *dsti = dst + i;
-
-			if (unlikely(src->is_user_buffer)) {
-				/* Zero-stride attribs only. */
-				assert(src->stride == 0);
-
-				/* Assume that the user_buffer comes from
-				 * gl_current_attrib, which implies it has
-				 * 4 * 8 bytes (for dvec4 attributes).
-				 *
-				 * Use const_uploader to upload into VRAM directly.
-				 */
-				u_upload_data(sctx->b.b.const_uploader, 0, 32, 32,
-					      src->buffer.user,
-					      &dsti->buffer_offset,
-					      &dsti->buffer.resource);
-				dsti->stride = 0;
-			} else {
-				struct pipe_resource *buf = src->buffer.resource;
-
-				pipe_resource_reference(&dsti->buffer.resource, buf);
-				dsti->buffer_offset = src->buffer_offset;
-				dsti->stride = src->stride;
-				r600_context_add_resource_size(ctx, buf);
-				if (buf)
-					r600_resource(buf)->bind_history |= PIPE_BIND_VERTEX_BUFFER;
-			}
+			struct pipe_resource *buf = src->buffer.resource;
+
+			pipe_resource_reference(&dsti->buffer.resource, buf);
+			dsti->buffer_offset = src->buffer_offset;
+			dsti->stride = src->stride;
+			r600_context_add_resource_size(ctx, buf);
+			if (buf)
+				r600_resource(buf)->bind_history |= PIPE_BIND_VERTEX_BUFFER;
 		}
 	} else {
 		for (i = 0; i < count; i++) {
 			pipe_resource_reference(&dst[i].buffer.resource, NULL);
 		}
 	}
 	sctx->vertex_buffers_dirty = true;
 }
 
 /*
-- 
2.7.4



More information about the mesa-dev mailing list