summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-19 09:07:13 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-20 07:48:04 -0700
commit3faf33488a5c8767448ae158f78de53d51bcaa6d (patch)
tree1fb1e4e9ee6a34499363a85693c8c4aa5acb1173 /src/gallium/drivers
parent0021fae7f80801d46e1ed019201303f56fd1d4c9 (diff)
panfrost/decode: Print COMPUTE uniforms as pointers
In OpenGL, uniforms generally represent fp32 vec4s (at least in highp mode). In OpenCL, they represent vec2s of 64-bit pointers. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pandecode/decode.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pandecode/decode.c b/src/gallium/drivers/panfrost/pandecode/decode.c
index 7b8b2c87f7e..c402ff91cbc 100644
--- a/src/gallium/drivers/panfrost/pandecode/decode.c
+++ b/src/gallium/drivers/panfrost/pandecode/decode.c
@@ -1523,7 +1523,9 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
pandecode_replay_attribute_meta(job_no, varying_count, p, true, suffix);
}
- if (p->uniforms) {
+ bool is_compute = job_type == JOB_TYPE_COMPUTE;
+
+ if (p->uniforms && !is_compute) {
int rows = uniform_count, width = 4;
size_t sz = rows * width * sizeof(float);
@@ -1550,6 +1552,27 @@ pandecode_replay_vertex_tiler_postfix_pre(const struct mali_vertex_tiler_postfix
pandecode_indent--;
pandecode_log("};\n");
+ } else if (p->uniforms) {
+ int rows = uniform_count * 2;
+ size_t sz = rows * sizeof(mali_ptr);
+
+ struct pandecode_mapped_memory *uniform_mem = pandecode_find_mapped_gpu_mem_containing(p->uniforms);
+ pandecode_fetch_gpu_mem(uniform_mem, p->uniforms, sz);
+ mali_ptr *PANDECODE_PTR_VAR(uniforms, uniform_mem, p->uniforms);
+
+ pandecode_log("mali_ptr uniforms_%d%s[] = {\n", job_no, suffix);
+
+ pandecode_indent++;
+
+ for (int row = 0; row < rows; row++) {
+ char *a = pointer_as_memory_reference(uniforms[row]);
+ pandecode_log("%s,\n", a);
+ free(a);
+ }
+
+ pandecode_indent--;
+ pandecode_log("};\n");
+
}
if (p->uniform_buffers) {