Commit 3da65f2e authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Demonstrate a varying write from the vertex shader

parent d0d3956e
......@@ -356,6 +356,8 @@ void panwrap_replay_attributes(const struct panwrap_mapped_memory *mem,
/* TODO: Attributes are not necessarily float32 vectors in general;
* decoding like this without snarfing types from the shader is unsafe all things considered */
panwrap_msg("i: %d\n", i);
panwrap_msg("attr: %llx\n", raw_elements);
float *buffer = panwrap_fetch_gpu_mem(mem, raw_elements, attr[i].size);
vertex_count = attr[i].size / attr[i].stride;
......
......@@ -104,17 +104,17 @@ panfrost_shader_compile(struct panfrost_context *ctx, struct mali_tripipe *meta,
if (type == JOB_TYPE_VERTEX) {
meta->attribute_count = 1;
meta->varying_count = 3;
meta->varying_count = 4;
meta->uniform_count = 0;
meta->unknown1 = 1; /* XXX: WTF is this?! */
} else {
meta->attribute_count = 0;
meta->varying_count = 1;
meta->varying_count = 2;
meta->uniform_count = 0;
meta->unknown1 = MALI_NO_ALPHA_TO_COVERAGE | 0x200; /* XXX: WTF is this?! */
}
meta->work_count = 8;
meta->work_count = 16;
/* Varyings are known only through the shader. We choose to upload this
* information with the vertex shader, though the choice is perhaps
......
......@@ -817,9 +817,14 @@ panfrost_bind_vs_state(
ctx->vs = hwcso;
if (!ctx->vs->compiled) {
printf("Comp\n");
char src[] = R"(
ld_attr_32 r1, 0, 0x1E1E
ld_attr_32 r0, 0, 0x1E1E
vmul.fmov r27, r24, r0
st_vary_32 r1, 2, 0x1E9E
vmul.fmov r1, r24, r0
vmul.fmul r3, r1, r26
fconstants 200, 120, 0.5, 0
......@@ -828,8 +833,9 @@ vadd.fadd r27, r26, r3
fconstants 200, 120, 0.5, 1
st_vary_32 r1, 0, 0x1E9E
)";
printf("%s\n", src);
panfrost_shader_compile(ctx, &ctx->vs->tripipe, src, JOB_TYPE_VERTEX);
ctx->vs->compiled = true;
}
......
......@@ -94,6 +94,7 @@ int main(int argc, const char **argv)
}
gallium->transfer_unmap(gallium, transfer);
sleep(1);
return 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