}
+static void
+print_texture_barrier(FILE *fp, uint32_t *word)
+{
+ midgard_texture_barrier_word *barrier = (midgard_texture_barrier_word *) word;
+
+ if (!barrier->cont)
+ fprintf(fp, "/* cont missing? */");
+
+ if (!barrier->last)
+ fprintf(fp, "/* last missing? */");
+
+ if (barrier->zero1)
+ fprintf(fp, "/* zero1 = 0x%X */ ", barrier->zero1);
+
+ if (barrier->zero2)
+ fprintf(fp, "/* zero2 = 0x%X */ ", barrier->zero2);
+
+ if (barrier->zero3)
+ fprintf(fp, "/* zero3 = 0x%X */ ", barrier->zero3);
+
+ if (barrier->zero4)
+ fprintf(fp, "/* zero4 = 0x%X */ ", barrier->zero4);
+
+ if (barrier->zero5)
+ fprintf(fp, "/* zero4 = 0x%" PRIx64 " */ ", barrier->zero5);
+
+ fprintf(fp, " 0x%X\n", barrier->unknown4);
+}
+
#undef DEFINE_CASE
static void
/* Broad category of texture operation in question */
print_texture_op(fp, texture->op, texture->is_gather);
+ /* Barriers use a dramatically different code path */
+ if (texture->op == TEXTURE_OP_BARRIER) {
+ print_texture_barrier(fp, word);
+ return;
+ }
+
/* Specific format in question */
print_texture_format(fp, texture->format);
}
midgard_texture_word;
-/* Up to 16 constant bytes can be embedded in a bundle. This union describes
- * all possible layouts.
- */
+/* Technically barriers are texture instructions but it's less work to add them
+ * as an explicitly zeroed special case, since most fields are forced to go to
+ * zero */
+
+typedef struct
+__attribute__((__packed__))
+{
+ unsigned type : 4;
+ unsigned next_type : 4;
+
+ /* op = TEXTURE_OP_BARRIER */
+ unsigned op : 6;
+ unsigned zero1 : 2;
+
+ /* Since helper invocations don't make any sense, these are forced to one */
+ unsigned cont : 1;
+ unsigned last : 1;
+ unsigned zero2 : 14;
+
+ unsigned zero3 : 24;
+ unsigned unknown4 : 1;
+ unsigned zero4 : 7;
+
+ uint64_t zero5;
+} midgard_texture_barrier_word;
typedef union midgard_constants {
double f64[2];