Commit 0970cbb5 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Abstract out attribute_meta

parent 97be73fa
......@@ -465,6 +465,54 @@ panwrap_replay_blend_equation(const u32 *raw)
panwrap_log("},\n");
}
static void
panwrap_replay_attribute_meta(int job_no, const struct mali_payload_vertex_tiler *v, bool varying)
{
char base[128];
char *prefix = varying ? "varying" : "attribute";
snprintf(base, sizeof(base), "%s_meta", prefix, job_no);
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 : 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++) {
attr_meta = panwrap_fetch_gpu_mem(attr_mem, p,
sizeof(*attr_mem));
panwrap_log("{\n");
panwrap_indent++;
panwrap_prop("index = %d", attr_meta->index);
panwrap_prop("type = %d", attr_meta->type);
panwrap_prop("nr_components = MALI_POSITIVE(%d)", MALI_NEGATIVE(attr_meta->nr_components));
/* TODO: Dissect correctly */
panwrap_prop("is_int_signed = %d", attr_meta->is_int_signed);
panwrap_prop("not_normalised = %d", attr_meta->not_normalised);
panwrap_prop("unknown1 = 0x%" PRIx64, (u64) attr_meta->unknown1);
panwrap_prop("unknown2 = 0x%" PRIx64, (u64) attr_meta->unknown2);
panwrap_prop("unknown3 = 0x%" PRIx64, (u64) attr_meta->unknown3);
panwrap_indent--;
panwrap_log("},\n");
}
panwrap_indent--;
panwrap_log("};\n");
panwrap_msg("not working but touching %d * %d?\n", sizeof(struct mali_attr_meta), count);
TOUCH_LEN(attr_mem, p, sizeof(struct mali_attr_meta) * count, base, job_no, true);
}
static int
panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
const struct panwrap_mapped_memory *mem,
......@@ -621,48 +669,10 @@ panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
}
if (v->attribute_meta) {
panwrap_log("struct mali_attr_meta attribute_meta_%d[] = {\n", job_no);
panwrap_indent++;
size_t count = 0;
struct mali_attr_meta *attr_meta;
mali_ptr p;
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attribute_meta);
for (p = v->attribute_meta;
*PANWRAP_PTR(attr_mem, p, u64) != 0;
p += sizeof(struct mali_attr_meta), count++) {
attr_meta = panwrap_fetch_gpu_mem(attr_mem, p,
sizeof(*attr_mem));
panwrap_log("{\n");
panwrap_indent++;
panwrap_prop("index = %d", attr_meta->index);
panwrap_prop("type = %d", attr_meta->type);
panwrap_prop("nr_components = MALI_POSITIVE(%d)", MALI_NEGATIVE(attr_meta->nr_components));
/* TODO: Dissect correctly */
panwrap_prop("is_int_signed = %d", attr_meta->is_int_signed);
panwrap_prop("not_normalised = %d", attr_meta->not_normalised);
panwrap_prop("unknown1 = 0x%" PRIx64, (u64) attr_meta->unknown1);
panwrap_prop("unknown2 = 0x%" PRIx64, (u64) attr_meta->unknown2);
panwrap_prop("unknown3 = 0x%" PRIx64, (u64) attr_meta->unknown3);
panwrap_indent--;
panwrap_log("},\n");
}
panwrap_indent--;
panwrap_log("};\n");
TOUCH_LEN(attr_mem, v->attribute_meta, sizeof(struct mali_attr_meta) * count, "attribute_meta", job_no, true);
panwrap_replay_attribute_meta(job_no, v, false);
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attributes);
panwrap_replay_attributes( attr_mem, v->attributes, job_no, attribute_count, false);
panwrap_replay_attributes(attr_mem, v->attributes, job_no, attribute_count, false);
}
/* Varyings are encoded like attributes but not actually sent; we just
......
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