inst->src[i].file = VGRF;
inst->src[i].nr = dst.nr;
inst->src[i].reg_offset = 0;
- inst->src[i].set_smear(pull_index & 3);
+ inst->src[i].set_smear((pull_index & 3) * 4 /
+ type_sz(inst->src[i].type));
brw_mark_surface_used(prog_data, index);
}
bld.emit(FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD, packed_consts,
surf_index, const_offset_reg);
- for (unsigned i = 0; i < instr->num_components; i++) {
- packed_consts.set_smear(const_offset->u32[0] % 16 / 4 + i);
+ const fs_reg consts = byte_offset(packed_consts, const_offset->u32[0] % 16);
- /* The std140 packing rules don't allow vectors to cross 16-byte
- * boundaries, and a reg is 32 bytes.
- */
- assert(packed_consts.subreg_offset < 32);
-
- bld.MOV(dest, packed_consts);
- dest = offset(dest, bld, 1);
- }
+ for (unsigned i = 0; i < instr->num_components; i++)
+ bld.MOV(offset(dest, bld, i), component(consts, i));
}
break;
}