inst->mlen = 1 + dispatch_width / 8;
}
- bld.MOV(dst, offset(vec4_result, (const_offset & 3) * scale));
+ bld.MOV(dst, offset(vec4_result, bld, (const_offset & 3) * scale));
}
/**
reg.width = this->src[i].width;
if (!this->src[i].equals(reg))
return false;
- reg = ::offset(reg, 1);
+
+ if (i < this->header_size) {
+ reg.reg_offset += 1;
+ } else {
+ reg.reg_offset += this->exec_size / 8;
+ }
}
return true;
} else {
bld.ADD(wpos, this->pixel_x, fs_reg(0.5f));
}
- wpos = offset(wpos, 1);
+ wpos = offset(wpos, bld, 1);
/* gl_FragCoord.y */
if (!flip && pixel_center_integer) {
bld.ADD(wpos, pixel_y, fs_reg(offset));
}
- wpos = offset(wpos, 1);
+ wpos = offset(wpos, bld, 1);
/* gl_FragCoord.z */
if (devinfo->gen >= 6) {
this->delta_xy[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC],
interp_reg(VARYING_SLOT_POS, 2));
}
- wpos = offset(wpos, 1);
+ wpos = offset(wpos, bld, 1);
/* gl_FragCoord.w: Already set up in emit_interpolation */
bld.MOV(wpos, this->wpos_w);
/* If there's no incoming setup data for this slot, don't
* emit interpolation for it.
*/
- attr = offset(attr, type->vector_elements);
+ attr = offset(attr, bld, type->vector_elements);
location++;
continue;
}
interp = suboffset(interp, 3);
interp.type = attr.type;
bld.emit(FS_OPCODE_CINTERP, attr, fs_reg(interp));
- attr = offset(attr, 1);
+ attr = offset(attr, bld, 1);
}
} else {
/* Smooth/noperspective interpolation case. */
if (devinfo->gen < 6 && interpolation_mode == INTERP_QUALIFIER_SMOOTH) {
bld.MUL(attr, attr, this->pixel_w);
}
- attr = offset(attr, 1);
+ attr = offset(attr, bld, 1);
}
}
}
/* Compute gl_SamplePosition.x */
compute_sample_position(pos, int_sample_x);
- pos = offset(pos, 1);
+ pos = offset(pos, abld, 1);
if (dispatch_width == 8) {
abld.MOV(int_sample_y, fs_reg(suboffset(sample_pos_reg, 1)));
} else {
assert(inst->dst.file == MRF || inst->dst.file == GRF);
assert(inst->saturate == false);
-
- const fs_builder ibld = bld.group(inst->exec_size, inst->force_sechalf)
- .exec_all(inst->force_writemask_all)
- .at(block, inst);
fs_reg dst = inst->dst;
/* Get rid of COMPR4. We'll add it back in if we need it */
dst.reg = dst.reg & ~BRW_MRF_COMPR4;
dst.width = 8;
+ const fs_builder hbld = bld.group(8, 0).exec_all().at(block, inst);
+
for (uint8_t i = 0; i < inst->header_size; i++) {
if (inst->src[i].file != BAD_FILE) {
fs_reg mov_dst = retype(dst, BRW_REGISTER_TYPE_UD);
fs_reg mov_src = retype(inst->src[i], BRW_REGISTER_TYPE_UD);
mov_src.width = 8;
- ibld.exec_all().MOV(mov_dst, mov_src);
+ hbld.MOV(mov_dst, mov_src);
}
- dst = offset(dst, 1);
+ dst = offset(dst, hbld, 1);
}
dst.width = inst->exec_size;
+ const fs_builder ibld = bld.group(inst->exec_size, inst->force_sechalf)
+ .exec_all(inst->force_writemask_all)
+ .at(block, inst);
+
if (inst->dst.file == MRF && (inst->dst.reg & BRW_MRF_COMPR4) &&
inst->exec_size > 8) {
/* In this case, the payload portion of the LOAD_PAYLOAD isn't
fs_reg mov_dst = retype(dst, inst->src[i].type);
mov_dst.width = 8;
ibld.half(0).MOV(mov_dst, half(inst->src[i], 0));
- ibld.half(1).MOV(offset(mov_dst, 4), half(inst->src[i], 1));
+ mov_dst.reg += 4;
+ ibld.half(1).MOV(mov_dst, half(inst->src[i], 1));
}
}
for (uint8_t i = inst->header_size; i < inst->sources; i++) {
if (inst->src[i].file != BAD_FILE)
ibld.MOV(retype(dst, inst->src[i].type), inst->src[i]);
- dst = offset(dst, 1);
+ dst = offset(dst, ibld, 1);
}
inst->remove(block);
{
foreach_list_typed(nir_variable, var, node, &shader->inputs) {
enum brw_reg_type type = brw_type_for_base_type(var->type);
- fs_reg input = offset(nir_inputs, var->data.driver_location);
+ fs_reg input = offset(nir_inputs, bld, var->data.driver_location);
fs_reg reg;
switch (stage) {
unsigned array_length = var->type->is_array() ? var->type->length : 1;
for (unsigned i = 0; i < array_length; i++) {
for (unsigned j = 0; j < components; j++) {
- bld.MOV(retype(offset(input, components * i + j), type),
- offset(fs_reg(ATTR, var->data.location + i, type), j));
+ bld.MOV(retype(offset(input, bld, components * i + j), type),
+ offset(fs_reg(ATTR, var->data.location + i, type), bld, j));
}
}
break;
brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
foreach_list_typed(nir_variable, var, node, &shader->outputs) {
- fs_reg reg = offset(nir_outputs, var->data.driver_location);
+ fs_reg reg = offset(nir_outputs, bld, var->data.driver_location);
int vector_elements =
var->type->is_array() ? var->type->fields.array->vector_elements
if (stage == MESA_SHADER_VERTEX) {
for (int i = 0; i < ALIGN(type_size(var->type), 4) / 4; i++) {
int output = var->data.location + i;
- this->outputs[output] = offset(reg, 4 * i);
+ this->outputs[output] = offset(reg, bld, 4 * i);
this->output_components[output] = vector_elements;
}
} else if (var->data.index > 0) {
/* General color output. */
for (unsigned int i = 0; i < MAX2(1, var->type->length); i++) {
int output = var->data.location - FRAG_RESULT_DATA0 + i;
- this->outputs[output] = offset(reg, vector_elements * i);
+ this->outputs[output] = offset(reg, bld, vector_elements * i);
this->output_components[output] = vector_elements;
}
}
continue;
if (instr->op == nir_op_imov || instr->op == nir_op_fmov) {
- inst = bld.MOV(offset(temp, i),
- offset(op[0], instr->src[0].swizzle[i]));
+ inst = bld.MOV(offset(temp, bld, i),
+ offset(op[0], bld, instr->src[0].swizzle[i]));
} else {
- inst = bld.MOV(offset(temp, i),
- offset(op[i], instr->src[i].swizzle[0]));
+ inst = bld.MOV(offset(temp, bld, i),
+ offset(op[i], bld, instr->src[i].swizzle[0]));
}
inst->saturate = instr->dest.saturate;
}
if (!(instr->dest.write_mask & (1 << i)))
continue;
- bld.MOV(offset(result, i), offset(temp, i));
+ bld.MOV(offset(result, bld, i), offset(temp, bld, i));
}
}
return;
assert(_mesa_bitcount(instr->dest.write_mask) == 1);
channel = ffs(instr->dest.write_mask) - 1;
- result = offset(result, channel);
+ result = offset(result, bld, channel);
}
for (unsigned i = 0; i < nir_op_infos[instr->op].num_inputs; i++) {
assert(nir_op_infos[instr->op].input_sizes[i] < 2);
- op[i] = offset(op[i], instr->src[i].swizzle[channel]);
+ op[i] = offset(op[i], bld, instr->src[i].swizzle[channel]);
}
switch (instr->op) {
fs_reg reg = bld.vgrf(BRW_REGISTER_TYPE_D, instr->def.num_components);
for (unsigned i = 0; i < instr->def.num_components; i++)
- bld.MOV(offset(reg, i), fs_reg(instr->value.i[i]));
+ bld.MOV(offset(reg, bld, i), fs_reg(instr->value.i[i]));
nir_ssa_values[instr->def.index] = reg;
}
else
reg = v->nir_locals[nir_reg->index];
- reg = offset(reg, base_offset * nir_reg->num_components);
+ reg = offset(reg, v->bld, base_offset * nir_reg->num_components);
if (indirect) {
int multiplier = nir_reg->num_components * (v->dispatch_width / 8);
continue;
fs_inst *new_inst = new(mem_ctx) fs_inst(inst);
- new_inst->dst = offset(new_inst->dst, i);
+ new_inst->dst = offset(new_inst->dst, bld, i);
for (unsigned j = 0; j < new_inst->sources; j++)
if (new_inst->src[j].file == GRF)
- new_inst->src[j] = offset(new_inst->src[j], i);
+ new_inst->src[j] = offset(new_inst->src[j], bld, i);
bld.emit(new_inst);
}
assert(sample_pos.file != BAD_FILE);
dest.type = sample_pos.type;
bld.MOV(dest, sample_pos);
- bld.MOV(offset(dest, 1), offset(sample_pos, 1));
+ bld.MOV(offset(dest, bld, 1), offset(sample_pos, bld, 1));
break;
}
}
for (unsigned j = 0; j < instr->num_components; j++) {
- fs_reg src = offset(retype(uniform_reg, dest.type), index);
+ fs_reg src = offset(retype(uniform_reg, dest.type), bld, index);
if (has_indirect)
src.reladdr = new(mem_ctx) fs_reg(get_nir_src(instr->src[0]));
index++;
bld.MOV(dest, src);
- dest = offset(dest, 1);
+ dest = offset(dest, bld, 1);
}
break;
}
unsigned vec4_offset = instr->const_index[0] / 4;
for (int i = 0; i < instr->num_components; i++)
- VARYING_PULL_CONSTANT_LOAD(bld, offset(dest, i), surf_index,
+ VARYING_PULL_CONSTANT_LOAD(bld, offset(dest, bld, i), surf_index,
base_offset, vec4_offset + i);
} else {
fs_reg packed_consts = vgrf(glsl_type::float_type);
assert(packed_consts.subreg_offset < 32);
bld.MOV(dest, packed_consts);
- dest = offset(dest, 1);
+ dest = offset(dest, bld, 1);
}
}
break;
case nir_intrinsic_load_input: {
unsigned index = 0;
for (unsigned j = 0; j < instr->num_components; j++) {
- fs_reg src = offset(retype(nir_inputs, dest.type),
+ fs_reg src = offset(retype(nir_inputs, dest.type), bld,
instr->const_index[0] + index);
if (has_indirect)
src.reladdr = new(mem_ctx) fs_reg(get_nir_src(instr->src[0]));
index++;
bld.MOV(dest, src);
- dest = offset(dest, 1);
+ dest = offset(dest, bld, 1);
}
break;
}
BRW_REGISTER_TYPE_F);
for (int i = 0; i < 2; i++) {
fs_reg temp = vgrf(glsl_type::float_type);
- bld.MUL(temp, offset(offset_src, i), fs_reg(16.0f));
+ bld.MUL(temp, offset(offset_src, bld, i), fs_reg(16.0f));
fs_reg itemp = vgrf(glsl_type::int_type);
bld.MOV(itemp, temp); /* float to int */
* FRAGMENT_INTERPOLATION_OFFSET_BITS"
*/
set_condmod(BRW_CONDITIONAL_L,
- bld.SEL(offset(src, i), itemp, fs_reg(7)));
+ bld.SEL(offset(src, bld, i), itemp, fs_reg(7)));
}
mlen = 2;
src.type = dest.type;
bld.emit(FS_OPCODE_LINTERP, dest, dst_xy, src);
- dest = offset(dest, 1);
+ dest = offset(dest, bld, 1);
}
break;
}
fs_reg src = get_nir_src(instr->src[0]);
unsigned index = 0;
for (unsigned j = 0; j < instr->num_components; j++) {
- fs_reg new_dest = offset(retype(nir_outputs, src.type),
+ fs_reg new_dest = offset(retype(nir_outputs, src.type), bld,
instr->const_index[0] + index);
if (has_indirect)
src.reladdr = new(mem_ctx) fs_reg(get_nir_src(instr->src[1]));
index++;
bld.MOV(new_dest, src);
- src = offset(src, 1);
+ src = offset(src, bld, 1);
}
break;
}
if (shadow_c.file != BAD_FILE) {
for (int i = 0; i < coord_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
/* gen4's SIMD8 sampler always has the slots for u,v,r present.
} else if (op == ir_tex) {
for (int i = 0; i < coord_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
/* zero the others. */
for (int i = coord_components; i<3; i++) {
for (int i = 0; i < coord_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
/* the slots for u and v are always present, but r is optional */
mlen += MAX2(coord_components, 2);
*/
for (int i = 0; i < grad_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen), dPdx);
- dPdx = offset(dPdx, 1);
+ dPdx = offset(dPdx, bld, 1);
}
mlen += MAX2(grad_components, 2);
for (int i = 0; i < grad_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen), dPdy);
- dPdy = offset(dPdy, 1);
+ dPdy = offset(dPdy, bld, 1);
}
mlen += MAX2(grad_components, 2);
} else if (op == ir_txs) {
for (int i = 0; i < coord_components; i++) {
bld.MOV(fs_reg(MRF, base_mrf + mlen + i * 2, coordinate.type),
coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
/* Initialize the rest of u/v/r with 0.0. Empirically, this seems to
if (simd16) {
for (int i = 0; i < 4; i++) {
bld.MOV(orig_dst, dst);
- orig_dst = offset(orig_dst, 1);
- dst = offset(dst, 2);
+ orig_dst = offset(orig_dst, bld, 1);
+ dst = offset(dst, bld, 2);
}
}
/* Copy the coordinates. */
for (int i = 0; i < vector_elements; i++) {
- bld.MOV(retype(offset(message, i), coordinate.type), coordinate);
- coordinate = offset(coordinate, 1);
+ bld.MOV(retype(offset(message, bld, i), coordinate.type), coordinate);
+ coordinate = offset(coordinate, bld, 1);
}
- fs_reg msg_end = offset(message, vector_elements);
+ fs_reg msg_end = offset(message, bld, vector_elements);
/* Messages other than sample and ld require all three components */
if (vector_elements > 0 && (has_lod || shadow_c.file != BAD_FILE)) {
for (int i = vector_elements; i < 3; i++) {
- bld.MOV(offset(message, i), fs_reg(0.0f));
+ bld.MOV(offset(message, bld, i), fs_reg(0.0f));
}
- msg_end = offset(message, 3);
+ msg_end = offset(message, bld, 3);
}
if (has_lod) {
fs_reg msg_lod = retype(msg_end, op == ir_txf ?
BRW_REGISTER_TYPE_UD : BRW_REGISTER_TYPE_F);
bld.MOV(msg_lod, lod);
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
}
if (shadow_c.file != BAD_FILE) {
- fs_reg msg_ref = offset(message, 3 + has_lod);
+ fs_reg msg_ref = offset(message, bld, 3 + has_lod);
bld.MOV(msg_ref, shadow_c);
- msg_end = offset(msg_ref, 1);
+ msg_end = offset(msg_ref, bld, 1);
}
enum opcode opcode;
}
for (int i = 0; i < vector_elements; i++) {
- bld.MOV(retype(offset(msg_coords, i), coordinate.type), coordinate);
- coordinate = offset(coordinate, 1);
+ bld.MOV(retype(offset(msg_coords, bld, i), coordinate.type), coordinate);
+ coordinate = offset(coordinate, bld, 1);
}
- fs_reg msg_end = offset(msg_coords, vector_elements);
- fs_reg msg_lod = offset(msg_coords, 4);
+ fs_reg msg_end = offset(msg_coords, bld, vector_elements);
+ fs_reg msg_lod = offset(msg_coords, bld, 4);
if (shadow_c.file != BAD_FILE) {
fs_reg msg_shadow = msg_lod;
bld.MOV(msg_shadow, shadow_c);
- msg_lod = offset(msg_shadow, 1);
+ msg_lod = offset(msg_shadow, bld, 1);
msg_end = msg_lod;
}
break;
case ir_txb:
bld.MOV(msg_lod, lod);
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
opcode = FS_OPCODE_TXB;
break;
case ir_txl:
bld.MOV(msg_lod, lod);
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
opcode = SHADER_OPCODE_TXL;
break;
msg_end = msg_lod;
for (int i = 0; i < grad_components; i++) {
bld.MOV(msg_end, lod);
- lod = offset(lod, 1);
- msg_end = offset(msg_end, 1);
+ lod = offset(lod, bld, 1);
+ msg_end = offset(msg_end, bld, 1);
bld.MOV(msg_end, lod2);
- lod2 = offset(lod2, 1);
- msg_end = offset(msg_end, 1);
+ lod2 = offset(lod2, bld, 1);
+ msg_end = offset(msg_end, bld, 1);
}
opcode = SHADER_OPCODE_TXD;
case ir_txs:
msg_lod = retype(msg_end, BRW_REGISTER_TYPE_UD);
bld.MOV(msg_lod, lod);
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
opcode = SHADER_OPCODE_TXS;
break;
case ir_query_levels:
msg_lod = msg_end;
bld.MOV(retype(msg_lod, BRW_REGISTER_TYPE_UD), fs_reg(0u));
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
opcode = SHADER_OPCODE_TXS;
break;
case ir_txf:
- msg_lod = offset(msg_coords, 3);
+ msg_lod = offset(msg_coords, bld, 3);
bld.MOV(retype(msg_lod, BRW_REGISTER_TYPE_UD), lod);
- msg_end = offset(msg_lod, 1);
+ msg_end = offset(msg_lod, bld, 1);
opcode = SHADER_OPCODE_TXF;
break;
case ir_txf_ms:
- msg_lod = offset(msg_coords, 3);
+ msg_lod = offset(msg_coords, bld, 3);
/* lod */
bld.MOV(retype(msg_lod, BRW_REGISTER_TYPE_UD), fs_reg(0u));
/* sample index */
- bld.MOV(retype(offset(msg_lod, 1), BRW_REGISTER_TYPE_UD), sample_index);
- msg_end = offset(msg_lod, 2);
+ bld.MOV(retype(offset(msg_lod, bld, 1), BRW_REGISTER_TYPE_UD), sample_index);
+ msg_end = offset(msg_lod, bld, 2);
opcode = SHADER_OPCODE_TXF_CMS;
break;
*/
for (int i = 0; i < coord_components; i++) {
bld.MOV(sources[length], coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
/* For cube map array, the coordinate is (u,v,r,ai) but there are
*/
if (i < grad_components) {
bld.MOV(sources[length], lod);
- lod = offset(lod, 1);
+ lod = offset(lod, bld, 1);
length++;
bld.MOV(sources[length], lod2);
- lod2 = offset(lod2, 1);
+ lod2 = offset(lod2, bld, 1);
length++;
}
}
*/
bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
if (devinfo->gen >= 9) {
if (coord_components >= 2) {
bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
length++;
}
for (int i = devinfo->gen >= 9 ? 2 : 1; i < coord_components; i++) {
bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
}
*/
for (int i = 0; i < coord_components; i++) {
bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
}
/* More crazy intermixing */
for (int i = 0; i < 2; i++) { /* u, v */
bld.MOV(sources[length], coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
}
for (int i = 0; i < 2; i++) { /* offu, offv */
bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), offset_value);
- offset_value = offset(offset_value, 1);
+ offset_value = offset(offset_value, bld, 1);
length++;
}
if (coord_components == 3) { /* r if present */
bld.MOV(sources[length], coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
}
if (!coordinate_done) {
for (int i = 0; i < coord_components; i++) {
bld.MOV(sources[length], coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
length++;
}
}
coordinate = dst;
bld.MUL(dst, src, scale_x);
- dst = offset(dst, 1);
- src = offset(src, 1);
+ dst = offset(dst, bld, 1);
+ src = offset(src, bld, 1);
bld.MUL(dst, src, scale_y);
} else if (is_rect) {
/* On gen6+, the sampler handles the rectangle coordinates
for (int i = 0; i < 2; i++) {
if (key_tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
- chan = offset(chan, i);
+ chan = offset(chan, bld, i);
set_condmod(BRW_CONDITIONAL_GE,
bld.emit(BRW_OPCODE_SEL, chan, chan, fs_reg(0.0f)));
for (int i = 0; i < MIN2(coord_components, 3); i++) {
if (key_tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
- chan = offset(chan, i);
+ chan = offset(chan, bld, i);
set_saturate(true, bld.MOV(chan, chan));
}
}
for (int i = 0; i < components; i++) {
sources[i] = vgrf(glsl_type::float_type);
bld.MOV(retype(sources[i], BRW_REGISTER_TYPE_D), coordinate);
- coordinate = offset(coordinate, 1);
+ coordinate = offset(coordinate, bld, 1);
}
bld.LOAD_PAYLOAD(payload, sources, components, 0);
for (int i=0; i<4; i++) {
bld.MOV(res, fs_reg(swiz == SWIZZLE_ZERO ? 0.0f : 1.0f));
- res = offset(res, 1);
+ res = offset(res, bld, 1);
}
return;
}
/* fixup #layers for cube map arrays */
if (op == ir_txs && is_cube_array) {
- fs_reg depth = offset(dst, 2);
+ fs_reg depth = offset(dst, bld, 2);
fs_reg fixed_depth = vgrf(glsl_type::int_type);
bld.emit(SHADER_OPCODE_INT_QUOTIENT, fixed_depth, depth, fs_reg(6));
if (i == 2) {
fixed_payload[i] = fixed_depth;
} else {
- fixed_payload[i] = offset(dst, i);
+ fixed_payload[i] = offset(dst, bld, i);
}
}
bld.LOAD_PAYLOAD(dst, fixed_payload, components, 0);
bld.ASR(dst, dst, fs_reg(32 - width));
}
- dst = offset(dst, 1);
+ dst = offset(dst, bld, 1);
}
}
{
if (op == ir_query_levels) {
/* # levels is in .w */
- this->result = offset(orig_val, 3);
+ this->result = offset(orig_val, bld, 3);
return;
}
for (int i = 0; i < 4; i++) {
int swiz = GET_SWZ(key_tex->swizzles[sampler], i);
fs_reg l = swizzled_result;
- l = offset(l, i);
+ l = offset(l, bld, i);
if (swiz == SWIZZLE_ZERO) {
bld.MOV(l, fs_reg(0.0f));
} else if (swiz == SWIZZLE_ONE) {
bld.MOV(l, fs_reg(1.0f));
} else {
- bld.MOV(l, offset(orig_val,
- GET_SWZ(key_tex->swizzles[sampler], i)));
+ bld.MOV(l, offset(orig_val, bld,
+ GET_SWZ(key_tex->swizzles[sampler], i)));
}
}
this->result = swizzled_result;
if (devinfo->has_pln && dispatch_width == 16) {
for (unsigned i = 0; i < 2; i++) {
- abld.half(i).ADD(half(offset(delta_xy, i), 0),
+ abld.half(i).ADD(half(offset(delta_xy, abld, i), 0),
half(this->pixel_x, i), xstart);
- abld.half(i).ADD(half(offset(delta_xy, i), 1),
+ abld.half(i).ADD(half(offset(delta_xy, abld, i), 1),
half(this->pixel_y, i), ystart);
}
} else {
- abld.ADD(offset(delta_xy, 0), this->pixel_x, xstart);
- abld.ADD(offset(delta_xy, 1), this->pixel_y, ystart);
+ abld.ADD(offset(delta_xy, abld, 0), this->pixel_x, xstart);
+ abld.ADD(offset(delta_xy, abld, 1), this->pixel_y, ystart);
}
abld = bld.annotate("compute pos.w and 1/pos.w");
fs_reg tmp = vgrf(glsl_type::vec4_type);
assert(color.type == BRW_REGISTER_TYPE_F);
for (unsigned i = 0; i < components; i++) {
- inst = bld.MOV(offset(tmp, i), offset(color, i));
+ inst = bld.MOV(offset(tmp, bld, i), offset(color, bld, i));
inst->saturate = true;
}
color = tmp;
if (exec_size < dispatch_width) {
unsigned half_idx = use_2nd_half ? 1 : 0;
for (unsigned i = 0; i < components; i++)
- dst[i] = half(offset(color, i), half_idx);
+ dst[i] = half(offset(color, bld, i), half_idx);
} else {
for (unsigned i = 0; i < components; i++)
- dst[i] = offset(color, i);
+ dst[i] = offset(color, bld, i);
}
}
BRW_CONDITIONAL_NEQ);
} else {
/* RT0 alpha */
- fs_reg color = offset(outputs[0], 3);
+ fs_reg color = offset(outputs[0], bld, 3);
/* f0.1 &= func(color, ref) */
cmp = abld.CMP(bld.null_reg_f(), color, fs_reg(key->alpha_test_ref),
* alpha-testing, alpha-to-coverage, and so on.
*/
if (this->outputs[0].file != BAD_FILE)
- setup_color_payload(&sources[length + 3], offset(this->outputs[0], 3),
+ setup_color_payload(&sources[length + 3],
+ offset(this->outputs[0], bld, 3),
1, exec_size, false);
length += 4;
} else if (color1.file == BAD_FILE) {
fs_reg src0_alpha;
if (devinfo->gen >= 6 && key->replicate_alpha && target != 0)
- src0_alpha = offset(outputs[0], 3);
+ src0_alpha = offset(outputs[0], bld, 3);
inst = emit_single_fb_write(abld, this->outputs[target], reg_undef,
src0_alpha,
abld.MUL(output, outputs[clip_vertex], u);
for (int j = 1; j < 4; j++) {
u.reg = userplane[i].reg + j;
- abld.MAD(output, output, offset(outputs[clip_vertex], j), u);
+ abld.MAD(output, output, offset(outputs[clip_vertex], bld, j), u);
}
}
}
*/
for (int i = 0; i < 4; i++) {
reg = fs_reg(GRF, alloc.allocate(1), outputs[varying].type);
- src = offset(this->outputs[varying], i);
+ src = offset(this->outputs[varying], bld, i);
set_saturate(true, bld.MOV(reg, src));
sources[length++] = reg;
}
} else {
for (int i = 0; i < 4; i++)
- sources[length++] = offset(this->outputs[varying], i);
+ sources[length++] = offset(this->outputs[varying], bld, i);
}
break;
}