Commit 11a9a728 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Debug issue with non-tri varyings etc

parent d80b0717
......@@ -113,8 +113,8 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_tripipe *meta,
if (type == JOB_TYPE_VERTEX) {
struct mali_attr varyings[] = {
trans_attr(sizeof(float), 4, 3),
trans_attr(sizeof(float), 4, 3)
trans_attr(sizeof(float), 4, 0),
trans_attr(sizeof(float), 4, 0)
};
memcpy(&ctx->varyings, &varyings, sizeof(varyings));
......
......@@ -440,18 +440,21 @@ trans_emit_for_draw(struct panfrost_context *ctx)
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].size;
int size = ctx->varyings[i].stride * ctx->vertex_count;
ctx->varyings[i].size = size;
printf("Sz %d\n", size);
/* Apparently has to be 64-byte aligned? */
size += 64 - (size & 63);
size += 64 - size & 63;
ctx->varying_height += size;
if (i + 1 != ctx->varying_count)
ctx->varying_height += size;
}
mali_ptr varyings_p = panfrost_upload(&ctx->cmdstream, &ctx->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 - 64; /* XXX: Off by 64 */
ctx->payload_tiler.varyings_end = ctx->varying_mem.gpu + ctx->varying_height;
ctx->dirty &= ~PAN_DIRTY_VARYINGS;
}
......
......@@ -25,9 +25,10 @@ int main(int argc, const char **argv)
gallium->bind_vs_state(gallium, gallium->create_vs_state(gallium, &vs_cso));
float attributes_data_1_0[] = {
0.000000f, 0.500000f, 0.000000f, 1.0f,
0.500000f, 0.500000f, 0.000000f, 1.0f,
0.500000f, -0.500000f, 0.000000f, 1.0f,
-0.50000f, -0.500000f, 0.000000f, 1.0f,
-0.50000f, 0.500000f, 0.000000f, 1.0f,
};
struct pipe_resource templ = {
......@@ -73,7 +74,7 @@ int main(int argc, const char **argv)
gallium->clear(gallium, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL, &u, 0.0, 0.0);
const struct pipe_rasterizer_state state = {
.line_width = i,
.line_width = 1.0f,
.front_ccw = false
};
......@@ -82,8 +83,8 @@ int main(int argc, const char **argv)
const struct pipe_draw_info info = {
.start = 0,
.count = 3,
.mode = PIPE_PRIM_LINE_LOOP
.count = 4,
.mode = PIPE_PRIM_LINE_STRIP
};
gallium->draw_vbo(gallium, &info);
......
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