Commit 7f970c3b authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Upload vertex _buffers_, not vertices

parent 0f1224db
......@@ -811,15 +811,14 @@ trans_emit_for_draw(struct panfrost_context *ctx)
/* TODO: Only update the dirtied buffers */
struct mali_attr attrs[PIPE_MAX_ATTRIBS];
for (int i = 0; i < ctx->vertex->num_elements; ++i) {
struct pipe_vertex_buffer *buf = &ctx->vertex_buffers[ctx->vertex->pipe[i].vertex_buffer_index];
for (int i = 0; i < ctx->vertex_buffer_count; ++i) {
struct pipe_vertex_buffer *buf = &ctx->vertex_buffers[i];
struct panfrost_resource *rsrc = (struct panfrost_resource *) (buf->buffer.resource);
/* Offset vertex count by draw_start to make sure we upload enough */
attrs[i] = trans_attr(sizeof(float), ctx->vertex->nr_components[i], ctx->payload_vertex.draw_start + ctx->vertex_count);
attrs[i].stride = buf->stride;
attrs[i].size = buf->stride * (ctx->payload_vertex.draw_start + ctx->vertex_count);
attrs[i].elements = panfrost_upload(&ctx->cmdstream, rsrc->cpu[0] + buf->buffer_offset + ctx->vertex->pipe[i].src_offset, attrs[i].size, false) | 1;
attrs[i].elements = panfrost_upload(&ctx->cmdstream, rsrc->cpu[0] + buf->buffer_offset /* + ctx->vertex->pipe[i].src_offset */, attrs[i].size, false) | 1;
}
ctx->payload_vertex.attributes = panfrost_upload(&ctx->cmdstream, attrs, ctx->vertex_buffer_count * sizeof(struct mali_attr), false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment