diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h index 6ba3a6ca97e..3a4acc1834a 100644 --- a/src/intel/compiler/brw_ir_fs.h +++ b/src/intel/compiler/brw_ir_fs.h @@ -451,13 +451,15 @@ regs_written(const fs_inst *inst) * Return the number of dataflow registers read by the instruction (either * fully or partially) counted from 'floor(reg_offset(inst->src[i]) / * register_size)'. The somewhat arbitrary register size unit is 4B for the - * UNIFORM and IMM files and 32B for all other files. + * UNIFORM files and 32B for all other files. */ inline unsigned regs_read(const fs_inst *inst, unsigned i) { - const unsigned reg_size = - inst->src[i].file == UNIFORM || inst->src[i].file == IMM ? 4 : REG_SIZE; + if (inst->src[i].file == IMM) + return 1; + + const unsigned reg_size = inst->src[i].file == UNIFORM ? 4 : REG_SIZE; return DIV_ROUND_UP(reg_offset(inst->src[i]) % reg_size + inst->size_read(i) - MIN2(inst->size_read(i), reg_padding(inst->src[i])),