fprintf(fp, ".%s", bi_cond_name(branch->cond));
}
+static void
+bi_print_texture(struct bi_texture *tex, FILE *fp)
+{
+ fprintf(fp, " - texture %u, sampler %u",
+ tex->texture_index, tex->sampler_index);
+}
+
void
bi_print_instruction(bi_instruction *ins, FILE *fp)
{
fprintf(fp, ".%s", bi_cond_name(ins->cond));
else if (ins->type == BI_BLEND)
fprintf(fp, ".loc%u", ins->blend_location);
- else if (ins->type == BI_TEX)
+ else if (ins->type == BI_TEX) {
fprintf(fp, ".%s", bi_tex_op_name(ins->op.texture));
- else if (ins->type == BI_BITWISE)
+ } else if (ins->type == BI_BITWISE)
fprintf(fp, ".%cshift", ins->bitwise.rshift ? 'r' : 'l');
if (ins->vector_channels)
fprintf(fp, "-> block%u", ins->branch.target->base.name);
else
fprintf(fp, "-> blockhole");
+ } else if (ins->type == BI_TEX) {
+ bi_print_texture(&ins->texture, fp);
}
fprintf(fp, "\n");
bool rshift; /* false for lshift */
};
+struct bi_texture {
+ /* Constant indices. Indirect would need to be in src[..] like normal,
+ * we can reserve some sentinels there for that for future. */
+ unsigned texture_index, sampler_index;
+};
+
typedef struct {
struct list_head link; /* Must be first */
enum bi_class type;
unsigned blend_location;
struct bi_bitwise bitwise;
+ struct bi_texture texture;
};
} bi_instruction;