Commit 50a251ec authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Get entire main block structified

parent e037f62d
...@@ -76,6 +76,18 @@ struct mali_shader_meta { ...@@ -76,6 +76,18 @@ struct mali_shader_meta {
*/ */
u32 uniform_registers; u32 uniform_registers;
/* TODO: Is this a different data structure I don't yet know about? */
u32 unknown2_0;
u32 unknown2_1;
u32 unknown2_2;
u32 unknown2_3;
u32 unknown2_4;
u32 unknown2_5;
u32 unknown2_6;
u32 unknown2_7;
u32 unknown2_8;
u32 unknown2_9;
}; };
/* This only concerns hardware jobs */ /* This only concerns hardware jobs */
...@@ -164,7 +176,7 @@ struct mali_payload_vertex_tiler { ...@@ -164,7 +176,7 @@ struct mali_payload_vertex_tiler {
/* For reasons I don't quite understand this is a pointer to a pointer. /* For reasons I don't quite understand this is a pointer to a pointer.
* That second pointer points to the actual texture descriptor. */ * That second pointer points to the actual texture descriptor. */
uintptr_t texture_meta_trampoline; uintptr_t texture_trampoline;
/* For OpenGL, from what I've seen, this is intimately connected to /* For OpenGL, from what I've seen, this is intimately connected to
* texture_meta. cwabbott says this is not the case under Vulkan, hence * texture_meta. cwabbott says this is not the case under Vulkan, hence
...@@ -184,7 +196,7 @@ struct mali_payload_vertex_tiler { ...@@ -184,7 +196,7 @@ struct mali_payload_vertex_tiler {
} __attribute__((packed)); } __attribute__((packed));
//ASSERT_SIZEOF_TYPE(struct mali_payload_vertex_tiler, 256, 256); //ASSERT_SIZEOF_TYPE(struct mali_payload_vertex_tiler, 256, 256);
/* Pointed to from texture_meta_trampoline, mostly unknown still, haven't /* Pointed to from texture_trampoline, mostly unknown still, haven't
* managed to replay successfully */ * managed to replay successfully */
/* Purposeful off-by-one in width, height fields. For example, a (64, 64) /* Purposeful off-by-one in width, height fields. For example, a (64, 64)
......
...@@ -236,7 +236,7 @@ void panwrap_replay_attributes(const struct panwrap_mapped_memory *mem, ...@@ -236,7 +236,7 @@ void panwrap_replay_attributes(const struct panwrap_mapped_memory *mem,
panwrap_indent--; panwrap_indent--;
panwrap_log("};\n"); panwrap_log("};\n");
TOUCH(mem, addr, *attr, prefix, job_no); TOUCH_LEN(mem, addr, sizeof(*attr) * count, prefix, job_no);
} }
void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h, void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
...@@ -281,6 +281,18 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -281,6 +281,18 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
/* Structure is still mostly unknown, unfortunately */ /* Structure is still mostly unknown, unfortunately */
panwrap_prop("uniform_registers = (%d << 20) | 0x%" PRIx32, uniform_count, s->uniform_registers & ~0x0FF00000); panwrap_prop("uniform_registers = (%d << 20) | 0x%" PRIx32, uniform_count, s->uniform_registers & ~0x0FF00000);
/* WTF? */
panwrap_prop("unknown2_0 = 0x%" PRIx32, s->unknown2_0);
panwrap_prop("unknown2_1 = 0x%" PRIx32, s->unknown2_1);
panwrap_prop("unknown2_2 = 0x%" PRIx32, s->unknown2_2);
panwrap_prop("unknown2_3 = 0x%" PRIx32, s->unknown2_3);
panwrap_prop("unknown2_4 = 0x%" PRIx32, s->unknown2_4);
panwrap_prop("unknown2_5 = 0x%" PRIx32, s->unknown2_5);
panwrap_prop("unknown2_6 = 0x%" PRIx32, s->unknown2_6);
panwrap_prop("unknown2_7 = 0x%" PRIx32, s->unknown2_7);
panwrap_prop("unknown2_8 = 0x%" PRIx32, s->unknown2_8);
panwrap_prop("unknown2_9 = 0x%" PRIx32, s->unknown2_9);
panwrap_indent--; panwrap_indent--;
panwrap_log("};\n"); panwrap_log("};\n");
TOUCH(smem, shader_meta_ptr, *meta, "shader_meta", job_no); TOUCH(smem, shader_meta_ptr, *meta, "shader_meta", job_no);
...@@ -343,12 +355,6 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -343,12 +355,6 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attributes); attr_mem = panwrap_find_mapped_gpu_mem_containing(v->attributes);
#if 0
for (p = v->attribute_meta;
*PANWRAP_PTR(attr_mem, p, u64) != 0;
p += sizeof(struct mali_attr_meta), count++);
#endif
panwrap_replay_attributes( attr_mem, v->attributes, job_no, attribute_count, false); panwrap_replay_attributes( attr_mem, v->attributes, job_no, attribute_count, false);
} }
...@@ -415,7 +421,7 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -415,7 +421,7 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
struct panwrap_mapped_memory *umem = panwrap_find_mapped_gpu_mem_containing(v->unknown6); struct panwrap_mapped_memory *umem = panwrap_find_mapped_gpu_mem_containing(v->unknown6);
if (umem) { if (umem) {
struct mali_unknown6 *PANWRAP_PTR_VAR(u, umem, v->unknown6); struct mali_unknown6 *PANWRAP_PTR_VAR(u, umem, v->unknown6 & ~0xF);
panwrap_log("struct mali_unknown6 unknown6_%d = {\n", job_no); panwrap_log("struct mali_unknown6 unknown6_%d = {\n", job_no);
panwrap_indent++; panwrap_indent++;
...@@ -427,23 +433,23 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -427,23 +433,23 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_indent--; panwrap_indent--;
panwrap_log("};\n"); panwrap_log("};\n");
TOUCH(umem, v->unknown6, *u, "unknown6", job_no); TOUCH(umem, v->unknown6 & ~0xF, *u, "unknown6", job_no);
} }
} }
/* Just a pointer to... another pointer >_< */ /* Just a pointer to... another pointer >_< */
if (v->texture_meta_trampoline) { if (v->texture_trampoline) {
struct panwrap_mapped_memory *mmem = panwrap_find_mapped_gpu_mem_containing(v->texture_meta_trampoline); struct panwrap_mapped_memory *mmem = panwrap_find_mapped_gpu_mem_containing(v->texture_trampoline);
if (mmem) { if (mmem) {
mali_ptr *PANWRAP_PTR_VAR(u, mmem, v->texture_meta_trampoline); mali_ptr *PANWRAP_PTR_VAR(u, mmem, v->texture_trampoline);
char *a = pointer_as_memory_reference(*u); char *a = pointer_as_memory_reference(*u);
panwrap_log("uint64_t texture_meta_trampoline_%d = %s;", job_no, a); panwrap_log("uint64_t texture_trampoline_%d = %s;", job_no, a);
free(a); free(a);
TOUCH(mmem, v->texture_meta_trampoline, *u, "texture_meta_trampoline", job_no); TOUCH(mmem, v->texture_trampoline, *u, "texture_trampoline", job_no);
/* Now, finally, descend down into the texture descriptor */ /* Now, finally, descend down into the texture descriptor */
struct panwrap_mapped_memory *tmem = panwrap_find_mapped_gpu_mem_containing(*u); struct panwrap_mapped_memory *tmem = panwrap_find_mapped_gpu_mem_containing(*u);
...@@ -579,13 +585,13 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -579,13 +585,13 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
DYN_MEMORY_PROP(v, job_no, indices); DYN_MEMORY_PROP(v, job_no, indices);
//DYN_MEMORY_PROP(v, job_no, unknown0); //DYN_MEMORY_PROP(v, job_no, unknown0);
DYN_MEMORY_PROP(v, job_no, unknown1); DYN_MEMORY_PROP(v, job_no, unknown1);
DYN_MEMORY_PROP(v, job_no, texture_meta_trampoline); DYN_MEMORY_PROP(v, job_no, texture_trampoline);
DYN_MEMORY_PROP(v, job_no, sampler_descriptor); DYN_MEMORY_PROP(v, job_no, sampler_descriptor);
DYN_MEMORY_PROP(v, job_no, uniforms); DYN_MEMORY_PROP(v, job_no, uniforms);
DYN_MEMORY_PROP(v, job_no, attributes); DYN_MEMORY_PROP(v, job_no, attributes);
DYN_MEMORY_PROP(v, job_no, attribute_meta); DYN_MEMORY_PROP(v, job_no, attribute_meta);
DYN_MEMORY_PROP(v, job_no, varyings); DYN_MEMORY_PROP(v, job_no, varyings);
DYN_MEMORY_PROP(v, job_no, unknown6); //DYN_MEMORY_PROP(v, job_no, unknown6);
DYN_MEMORY_PROP(v, job_no, nullForVertex); DYN_MEMORY_PROP(v, job_no, nullForVertex);
DYN_MEMORY_PROP(v, job_no, fbd); DYN_MEMORY_PROP(v, job_no, fbd);
...@@ -594,6 +600,8 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header ...@@ -594,6 +600,8 @@ void panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header
panwrap_prop("_shader_upper = (shader_meta_%d_p) >> 4", job_no); panwrap_prop("_shader_upper = (shader_meta_%d_p) >> 4", job_no);
panwrap_prop("flags = %d", v->flags); panwrap_prop("flags = %d", v->flags);
panwrap_prop("unknown6 = (unknown6_%d_p) | 0x%X", job_no, v->unknown6 & 0xF);
panwrap_indent--; panwrap_indent--;
panwrap_log("};\n"); panwrap_log("};\n");
...@@ -717,8 +725,6 @@ int panwrap_replay_jc(mali_ptr jc_gpu_va) ...@@ -717,8 +725,6 @@ int panwrap_replay_jc(mali_ptr jc_gpu_va)
first = false; first = false;
continue;
switch (h->job_type) { switch (h->job_type) {
case JOB_TYPE_SET_VALUE: case JOB_TYPE_SET_VALUE:
{ {
......
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