summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-06-18 12:07:27 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2015-06-30 16:13:48 -0700
commitf7dcc1160331462a071c54ca1067f9e2f57b55be (patch)
treeab471cafed1bd40a479787ed981388ff28a4298e /src/mesa/drivers/dri/i965/brw_fs.cpp
parent7fcbe141076d18bf0245de1fd589c82f7c543fdf (diff)
downloadexternal_mesa3d-f7dcc1160331462a071c54ca1067f9e2f57b55be.zip
external_mesa3d-f7dcc1160331462a071c54ca1067f9e2f57b55be.tar.gz
external_mesa3d-f7dcc1160331462a071c54ca1067f9e2f57b55be.tar.bz2
i965/fs: Add a builder argument to offset()
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Acked-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index cae4e42..ceac20c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -267,7 +267,7 @@ fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_builder &bld,
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));
}
/**
@@ -361,7 +361,12 @@ fs_inst::is_copy_payload(const brw::simple_allocator &grf_alloc) const
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;
@@ -926,7 +931,7 @@ fs_visitor::emit_fragcoord_interpolation(bool pixel_center_integer,
} 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) {
@@ -942,7 +947,7 @@ fs_visitor::emit_fragcoord_interpolation(bool 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) {
@@ -952,7 +957,7 @@ fs_visitor::emit_fragcoord_interpolation(bool pixel_center_integer,
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);
@@ -1035,7 +1040,7 @@ fs_visitor::emit_general_interpolation(fs_reg attr, const char *name,
/* 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;
}
@@ -1050,7 +1055,7 @@ fs_visitor::emit_general_interpolation(fs_reg attr, const char *name,
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. */
@@ -1088,7 +1093,7 @@ fs_visitor::emit_general_interpolation(fs_reg attr, const char *name,
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);
}
}
@@ -1196,7 +1201,7 @@ fs_visitor::emit_samplepos_setup()
}
/* 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 {
@@ -2986,10 +2991,6 @@ fs_visitor::lower_load_payload()
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 */
@@ -2997,17 +2998,23 @@ fs_visitor::lower_load_payload()
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
@@ -3039,7 +3046,8 @@ fs_visitor::lower_load_payload()
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));
}
}
@@ -3064,7 +3072,7 @@ fs_visitor::lower_load_payload()
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);