diff options
author | Francisco Jerez <[email protected]> | 2016-04-25 18:33:22 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-05-29 15:44:50 -0700 |
commit | 39de901a96bd1048b2c0de32a469014b398f38ae (patch) | |
tree | d83edcd2f7e55774efd9ab9963a3a4a806235480 /src/intel/compiler/brw_fs.cpp | |
parent | 4bfa2ac2eab7551b1d89309fa8da44a487542f72 (diff) |
intel/fs: Use the ATTR file for FS inputs
This replaces the special magic opcodes which implicitly read inputs
with explicit use of the ATTR file.
v2 (Jason Ekstrand):
- Break into multiple patches
- Change the units of the FS ATTR to be in logical scalars
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs.cpp')
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index b21996c1682..8d9278684fd 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -1079,8 +1079,8 @@ fs_visitor::emit_fragcoord_interpolation(fs_reg wpos) bld.MOV(wpos, fs_reg(brw_vec8_grf(payload.source_depth_reg, 0))); } else { bld.emit(FS_OPCODE_LINTERP, wpos, - this->delta_xy[BRW_BARYCENTRIC_PERSPECTIVE_PIXEL], - interp_reg(VARYING_SLOT_POS, 2)); + this->delta_xy[BRW_BARYCENTRIC_PERSPECTIVE_PIXEL], + component(interp_reg(VARYING_SLOT_POS, 2), 0)); } wpos = offset(wpos, bld, 1); @@ -1609,14 +1609,26 @@ fs_visitor::assign_urb_setup() * setup regs, now that the location of the constants has been chosen. */ foreach_block_and_inst(block, fs_inst, inst, cfg) { - if (inst->opcode == FS_OPCODE_LINTERP) { - assert(inst->src[1].file == FIXED_GRF); - inst->src[1].nr += urb_start; - } - - if (inst->opcode == FS_OPCODE_CINTERP) { - assert(inst->src[0].file == FIXED_GRF); - inst->src[0].nr += urb_start; + for (int i = 0; i < inst->sources; i++) { + if (inst->src[i].file == ATTR) { + /* ATTR regs in the FS are in units of logical scalar inputs each + * of which consumes half of a GRF register. + */ + assert(inst->src[i].offset < REG_SIZE / 2); + const unsigned grf = urb_start + inst->src[i].nr / 2; + const unsigned offset = (inst->src[i].nr % 2) * (REG_SIZE / 2) + + inst->src[i].offset; + const unsigned width = inst->src[i].stride == 0 ? + 1 : MIN2(inst->exec_size, 8); + struct brw_reg reg = stride( + byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type), + offset), + width * inst->src[i].stride, + width, inst->src[i].stride); + reg.abs = inst->src[i].abs; + reg.negate = inst->src[i].negate; + inst->src[i] = reg; + } } } |