diff options
author | Kristian Høgsberg <[email protected]> | 2014-12-10 14:59:26 -0800 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2015-01-08 10:13:32 -0800 |
commit | 0ac4c272755c75108a10a84ce33bf6a6234985d3 (patch) | |
tree | 189075a0a81346137c2f448f4d7b804f16261935 /src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | |
parent | cec8eff28e765b3958a2c3ac41578dfd1c4c8d0c (diff) |
i965/skl: Always use a header for SIMD4x2 sampler messages
SKL+ overloads the SIMD4x2 SIMD mode to mean either SIMD8D or SIMD4x2
depending on bit 22 in the message header. If the bit is 0 or there is
no header we get SIMD8D. We always wand SIMD4x2 in vec4 and for fs pull
constants, so use a message header in those cases and set bit 22 there.
Based on an initial patch from Ken.
Reviewed-by: Kenneth Graunke <[email protected]>
Signed-off-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_generator.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp index b88a57912cb..f900bf7f300 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp @@ -328,6 +328,7 @@ vec4_generator::generate_tex(vec4_instruction *inst, } else { struct brw_reg header = retype(brw_message_reg(inst->base_mrf), BRW_REGISTER_TYPE_UD); + uint32_t dw2 = 0; /* Explicitly set up the message header by copying g0 to the MRF. */ brw_push_insn_state(p); @@ -336,11 +337,18 @@ vec4_generator::generate_tex(vec4_instruction *inst, brw_set_default_access_mode(p, BRW_ALIGN_1); - if (inst->offset) { + if (inst->offset) /* Set the texel offset bits in DWord 2. */ - brw_MOV(p, get_element_ud(header, 2), - brw_imm_ud(inst->offset)); - } + dw2 = inst->offset; + + if (brw->gen >= 9) + /* SKL+ overloads BRW_SAMPLER_SIMD_MODE_SIMD4X2 to also do SIMD8D, + * based on bit 22 in the header. + */ + dw2 |= GEN9_SAMPLER_SIMD_MODE_EXTENSION_SIMD4X2; + + if (dw2) + brw_MOV(p, get_element_ud(header, 2), brw_imm_ud(dw2)); brw_adjust_sampler_state_pointer(p, header, sampler_index, dst); brw_pop_insn_state(p); |