diff options
author | Kenneth Graunke <[email protected]> | 2012-12-16 00:02:43 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-12-02 13:19:10 -0800 |
commit | 93658054c03b4463d301be83b20c8933e49a5771 (patch) | |
tree | 6b5a07568a28c0cc0bd0ea3ffd6515f44b02cbe1 /src | |
parent | dd159f25e484d2285773347b66f82719b6bfa01a (diff) |
i965/vs: Always store pull constant offsets in GRFs on Gen8.
We need to SEND from a GRF, and we can only obtain those prior to
register allocation.
This allows us to do pull constant loads without the MRF hack.
v2: Reword comments (suggested by Paul).
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index a13eafb7d4a..9c1975b3e5e 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1581,7 +1581,16 @@ vec4_visitor::visit(ir_expression *ir) src_reg surf_index = src_reg(prog_data->base.binding_table.ubo_start + uniform_block->value.u[0]); if (const_offset_ir) { - offset = src_reg(const_offset / 16); + if (brw->gen >= 8) { + /* Store the offset in a GRF so we can send-from-GRF. */ + offset = src_reg(this, glsl_type::int_type); + emit(MOV(dst_reg(offset), src_reg(const_offset / 16))); + } else { + /* Immediates are fine on older generations since they'll be moved + * to a (potentially fake) MRF at the generator level. + */ + offset = src_reg(const_offset / 16); + } } else { offset = src_reg(this, glsl_type::uint_type); emit(SHR(dst_reg(offset), op[1], src_reg(4))); @@ -2982,6 +2991,11 @@ vec4_visitor::get_pull_constant_offset(vec4_instruction *inst, } return index; + } else if (brw->gen >= 8) { + /* Store the offset in a GRF so we can send-from-GRF. */ + src_reg offset = src_reg(this, glsl_type::int_type); + emit_before(inst, MOV(dst_reg(offset), src_reg(reg_offset))); + return offset; } else { int message_header_scale = brw->gen < 6 ? 16 : 1; return src_reg(reg_offset * message_header_scale); |