Commit 236cddb9 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Fix attribute meta expansion

parent fd3f3292
......@@ -353,6 +353,7 @@ 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 */
return;
float *buffer = panwrap_fetch_gpu_mem(mem, raw_elements, attr[i].size);
vertex_count = attr[i].size / attr[i].stride;
......@@ -466,7 +467,7 @@ panwrap_replay_blend_equation(const u32 *raw)
}
static void
panwrap_replay_attribute_meta(int job_no, const struct mali_payload_vertex_tiler *v, bool varying)
panwrap_replay_attribute_meta(int job_no, int count, const struct mali_payload_vertex_tiler *v, bool varying)
{
char base[128];
char *prefix = varying ? "varying" : "attribute";
......@@ -475,16 +476,12 @@ panwrap_replay_attribute_meta(int job_no, const struct mali_payload_vertex_tiler
panwrap_log("struct mali_attr_meta %s_%d[] = {\n", base, job_no);
panwrap_indent++;
int count = 0;
struct mali_attr_meta *attr_meta;
mali_ptr p = varying ? (v->unknown6 & ~0xF) : v->attribute_meta;
struct panwrap_mapped_memory *attr_mem = panwrap_find_mapped_gpu_mem_containing(p);
for (;
*PANWRAP_PTR(attr_mem, p, u64) != 0;
p += sizeof(struct mali_attr_meta), count++) {
for (int i = 0; i < count; ++i, p += sizeof(struct mali_attr_meta)) {
attr_meta = panwrap_fetch_gpu_mem(attr_mem, p,
sizeof(*attr_mem));
......@@ -669,7 +666,7 @@ panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
}
if (v->attribute_meta) {
panwrap_replay_attribute_meta(job_no, v, false);
panwrap_replay_attribute_meta(job_no, attribute_count, v, false);
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attributes);
panwrap_replay_attributes(attr_mem, v->attributes, job_no, attribute_count, false);
......@@ -756,7 +753,7 @@ panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
TOUCH(umem, v->unknown6 & ~0xF, *u, "unknown6", job_no, false);
panwrap_replay_attribute_meta(job_no, v, true);
panwrap_replay_attribute_meta(job_no, varying_count, v, true);
}
}
......
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