diff options
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c index 8bd016c5535..2c9119d9ccf 100644 --- a/src/gallium/drivers/vc4/vc4_qir.c +++ b/src/gallium/drivers/vc4/vc4_qir.c @@ -104,12 +104,10 @@ qir_get_op_name(enum qop qop) } int -qir_get_op_nsrc(enum qop qop) +qir_get_nsrc(struct qinst *inst) { - if (qop < ARRAY_SIZE(qir_op_info) && qir_op_info[qop].name) - return qir_op_info[qop].nsrc; - else - abort(); + assert(qir_op_info[inst->op].name); + return qir_op_info[inst->op].nsrc; } /** @@ -140,7 +138,7 @@ qir_has_side_effect_reads(struct vc4_compile *c, struct qinst *inst) * point/line coordinates reads, because they're generated by * fixed-function hardware. */ - for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) { + for (int i = 0; i < qir_get_nsrc(inst); i++) { if (inst->src[i].file == QFILE_VARY && c->input_slots[inst->src[i].index].slot == 0xff) { return true; @@ -372,7 +370,7 @@ qir_dump_inst(struct vc4_compile *c, struct qinst *inst) } } - for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) { + for (int i = 0; i < qir_get_nsrc(inst); i++) { fprintf(stderr, ", "); qir_print_reg(c, inst->src[i], false); vc4_qpu_disasm_unpack(stderr, inst->src[i].pack); |