Commit 391f6c15 authored by Connor Abbott's avatar Connor Abbott

panwrap: Use texture/sampler count when dumping

Rather than hardcoding it
parent 4ba0b562
......@@ -922,6 +922,7 @@ panwrap_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix *
panwrap_replay_sfbd((u64) (uintptr_t) p->framebuffer, job_no);
int varying_count = 0, attribute_count = 0, uniform_count = 0, uniform_buffer_count = 0;
int texture_count = 0, sampler_count = 0;
if (shader_meta_ptr) {
struct panwrap_mapped_memory *smem = panwrap_find_mapped_gpu_mem_containing(shader_meta_ptr);
......@@ -933,6 +934,8 @@ panwrap_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix *
/* Save for dumps */
attribute_count = s->attribute_count;
varying_count = s->varying_count;
texture_count = s->texture_count;
sampler_count = s->sampler_count;
if (is_bifrost) {
uniform_count = s->bifrost2.uniform_count;
uniform_buffer_count = s->bifrost1.uniform_buffer_count;
......@@ -1196,7 +1199,7 @@ panwrap_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix *
panwrap_log("uint64_t texture_trampoline_%d[] = {\n", job_no);
panwrap_indent++;
for (int tex = 0; tex < 3; ++tex) {
for (int tex = 0; tex < texture_count; ++tex) {
mali_ptr *PANWRAP_PTR_VAR(u, mmem, p->texture_trampoline + tex*sizeof(mali_ptr));
char *a = pointer_as_memory_reference(*u);
panwrap_log("%s,\n", a);
......@@ -1209,7 +1212,7 @@ panwrap_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix *
//TOUCH(mmem, p->texture_trampoline, *u, "texture_trampoline", job_no, true);
/* Now, finally, descend down into the texture descriptor */
for (int tex = 0; tex < 3; ++tex) {
for (int tex = 0; tex < texture_count; ++tex) {
mali_ptr *PANWRAP_PTR_VAR(u, mmem, p->texture_trampoline + tex*sizeof(mali_ptr));
struct panwrap_mapped_memory *tmem = panwrap_find_mapped_gpu_mem_containing(*u);
......@@ -1300,7 +1303,7 @@ panwrap_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix *
mali_ptr d = p->sampler_descriptor;
for (int i = 0; i < 3; ++i) {
for (int i = 0; i < sampler_count; ++i) {
s = panwrap_fetch_gpu_mem(smem, d + sizeof(*s)*i, sizeof(*s));
panwrap_log("struct mali_sampler_descriptor sampler_descriptor_%d_%d = {\n", job_no, i);
......
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