if (ir3_shader_debug & IR3_DBG_DISASM) {
struct ir3_shader_key key = v->key;
- printf("disassemble: type=%d, k={bp=%u,cts=%u,hp=%u}", v->type,
+ printf("disassemble: type=%d, k={bp=%u,cts=%u,hp=%u}\n", v->type,
v->binning_pass, key.color_two_side, key.half_precision);
ir3_shader_disasm(v, bin, stdout);
}
static void dump_reg(FILE *out, const char *name, uint32_t r)
{
- if (r != regid(63,0))
- fprintf(out, "; %s: r%d.%c\n", name, r >> 2, "xyzw"[r & 0x3]);
+ if (r != regid(63,0)) {
+ const char *reg_type = (r & HALF_REG_ID) ? "hr" : "r";
+ fprintf(out, "; %s: %s%d.%c\n", name, reg_type,
+ (r & ~HALF_REG_ID) >> 2, "xyzw"[r & 0x3]);
+ }
}
static void dump_output(FILE *out, struct ir3_shader_variant *so,
fprintf(out, "; %s: outputs:", type);
for (i = 0; i < so->outputs_count; i++) {
uint8_t regid = so->outputs[i].regid;
- fprintf(out, " r%d.%c (%s)",
- (regid >> 2), "xyzw"[regid & 0x3],
+ const char *reg_type = so->outputs[i].half ? "hr" : "r";
+ fprintf(out, " %s%d.%c (%s)",
+ reg_type, (regid >> 2), "xyzw"[regid & 0x3],
gl_frag_result_name(so->outputs[i].slot));
}
fprintf(out, "\n");
uint8_t tex_base; /* the number of real textures, ie. image/ssbo start here */
};
+/* Represents half register in regid */
+#define HALF_REG_ID 0x100
+
struct ir3_shader_variant {
struct fd_bo *bo;
{
int j;
for (j = 0; j < so->outputs_count; j++)
- if (so->outputs[j].slot == slot)
- return so->outputs[j].regid;
+ if (so->outputs[j].slot == slot) {
+ uint32_t regid = so->outputs[j].regid;
+ if (so->outputs[j].half)
+ regid |= HALF_REG_ID;
+ return regid;
+ }
return regid(63, 0);
}
OUT_PKT4(ring, REG_A6XX_SP_FS_OUTPUT_REG(0), 8);
for (i = 0; i < 8; i++) {
OUT_RING(ring, A6XX_SP_FS_OUTPUT_REG_REGID(color_regid[i]) |
- COND(s[FS].v->outputs[i].half, A6XX_SP_FS_OUTPUT_REG_HALF_PRECISION));
+ COND(color_regid[i] & HALF_REG_ID, A6XX_SP_FS_OUTPUT_REG_HALF_PRECISION));
}
OUT_PKT4(ring, REG_A6XX_VPC_PACK, 1);