aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2020-03-05 19:48:30 +0100
committerBoris Brezillon <[email protected]>2020-03-10 12:47:34 +0100
commit575f62ea02ecd420572fd952cff5da0304ade17c (patch)
tree85ec0c0fe567d948b11c6b510074bcb5f3d3b58e /src/gallium/drivers/panfrost
parent4a2ee61a22f5b408a4ac5377b735df3d9d312f50 (diff)
panfrost: Emit attribute descriptors after patching the templates
Patching attribute desc when they are in cacheable memory should be more efficient. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4083>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 4fea5f507b3..f91a2d24743 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -192,13 +192,6 @@ panfrost_stage_attributes(struct panfrost_context *ctx)
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
struct panfrost_vertex_state *so = ctx->vertex;
- size_t sz = sizeof(struct mali_attr_meta) * PAN_MAX_ATTRIBUTE;
- struct panfrost_transfer transfer = panfrost_allocate_transient(batch, sz);
- struct mali_attr_meta *target = (struct mali_attr_meta *) transfer.cpu;
-
- /* Copy as-is for the first pass */
- memcpy(target, so->hw, sz);
-
/* Fixup offsets for the second pass. Recall that the hardware
* calculates attribute addresses as:
*
@@ -241,10 +234,14 @@ panfrost_stage_attributes(struct panfrost_context *ctx)
if (so->pipe[i].instance_divisor && ctx->instance_count > 1 && start)
src_offset -= buf->stride * start;
- target[i].src_offset = src_offset;
+ so->hw[i].src_offset = src_offset;
}
- ctx->payloads[PIPE_SHADER_VERTEX].postfix.attribute_meta = transfer.gpu;
+ mali_ptr out = panfrost_upload_transient(batch, so->hw,
+ sizeof(*so->hw) *
+ PAN_MAX_ATTRIBUTE);
+
+ ctx->payloads[PIPE_SHADER_VERTEX].postfix.attribute_meta = out;
}
/* Compute number of UBOs active (more specifically, compute the highest UBO