Commit 628e9492 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Cleanup how varyings are passed

parent 71e7dfd9
......@@ -112,19 +112,16 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_tripipe *meta,
* arbitrary */
if (type == JOB_TYPE_VERTEX) {
struct mali_attr varyings[] = {
trans_attr(sizeof(float), 4, 0),
trans_attr(sizeof(float), 4, 0)
};
ctx->varyings_stride[0] = 4 * sizeof(float);
ctx->varyings_stride[1] = 4 * sizeof(float);
ctx->varying_count = 2;
memcpy(&ctx->varyings, &varyings, sizeof(varyings));
ctx->varying_count = 2;
ctx->varyings_descriptor_0.unknown0 = 0x179a2201;
ctx->varyings_descriptor_0.unknown1 = 0x17e49000;
ctx->varyings_descriptor_0.unknown0 = 0x179a2201;
ctx->varyings_descriptor_0.unknown1 = 0x17e49000;
ctx->varyings_descriptor_1.unknown0 = 0x2fda2200;
ctx->varyings_descriptor_1.unknown1 = 0x2fda2200;
ctx->varyings_descriptor_1.unknown0 = 0x2fda2200;
ctx->varyings_descriptor_1.unknown1 = 0x2fda2200;
}
}
......@@ -435,11 +435,14 @@ trans_emit_for_draw(struct panfrost_context *ctx)
}
if (ctx->dirty & PAN_DIRTY_VARYINGS) {
struct mali_attr varyings[PIPE_MAX_ATTRIBS];
for (int i = 0; i < ctx->varying_count; ++i) {
ctx->varyings[i].elements = (ctx->varying_mem.gpu + ctx->varying_height) | 1;
int size = ctx->varyings[i].stride * ctx->vertex_count;
ctx->varyings[i].size = size;
int size = ctx->varyings_stride[i] * ctx->vertex_count;
varyings[i].elements = (ctx->varying_mem.gpu + ctx->varying_height) | 1;
varyings[i].size = size;
varyings[i].stride = ctx->varyings_stride[i];
/* Varyings appear to need 64-byte alignment */
size += 64 - size & 63;
......@@ -448,7 +451,7 @@ trans_emit_for_draw(struct panfrost_context *ctx)
ctx->varying_height += size;
}
mali_ptr varyings_p = panfrost_upload(&ctx->cmdstream, &ctx->varyings, ctx->varying_count * sizeof(struct mali_attr), false);
mali_ptr varyings_p = panfrost_upload(&ctx->cmdstream, &varyings, ctx->varying_count * sizeof(struct mali_attr), false);
ctx->payload_vertex.varyings = varyings_p;
ctx->payload_tiler.varyings = varyings_p;
ctx->payload_tiler.varyings_end = ctx->varying_mem.gpu + ctx->varying_height;
......
......@@ -92,7 +92,7 @@ struct panfrost_context {
struct mali_attr attributes[PIPE_MAX_ATTRIBS];
struct mali_attr varyings[MAX_VARYINGS];
int varyings_stride[MAX_VARYINGS];
int varying_count;
int varying_height;
struct mali_unknown6 varyings_descriptor_0;
......
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