Decode one uniform as a half-float vec4
authorCafe <cafe@not.applicable>
Wed, 2 Aug 2017 18:24:24 +0000 (18:24 +0000)
committerCafe <cafe@not.applicable>
Wed, 2 Aug 2017 18:24:24 +0000 (18:24 +0000)
src/trace.c

index ba11d95c5fdf4509382d7efa3914ba1a4dff7aae..b102c6fa92a401d592ff96760fc35ca284ff399e 100644 (file)
@@ -411,6 +411,20 @@ static void chai_trace_hw_chain(uint64_t chain)
                                relax_mapped_gpu(sbuf);
                        }
 
+                       if(addr == 4 && h->job_type == JOB_TYPE_TILER) {
+                               __fp16 *uniforms = (__fp16*) buf;
+
+                               printf("uniform vec4 u = vec4(");
+
+                               for(int u = 0; u < 4; ++u) {
+                                       float v = (float) uniforms[u];
+                                       printf("%f, ", v);
+                               }
+
+                               printf("\b\b);\n");
+                       }
+
+
                        relax_mapped_gpu(buf);
                }