diff --git a/src/intel/compiler/brw_eu_defines.h b/src/intel/compiler/brw_eu_defines.h index 31fe60e7924..a83d6cb6de1 100644 --- a/src/intel/compiler/brw_eu_defines.h +++ b/src/intel/compiler/brw_eu_defines.h @@ -737,6 +737,8 @@ enum interpolator_logical_srcs { INTERP_SRC_MSG_DESC, /** Flag register for dynamic mode */ INTERP_SRC_DYNAMIC_MODE, + /** Whether this should use noperspective (0/1 as UD immediate) */ + INTERP_SRC_NOPERSPECTIVE, INTERP_NUM_SRCS }; diff --git a/src/intel/compiler/brw_from_nir.cpp b/src/intel/compiler/brw_from_nir.cpp index 34ea630109b..fba8c1edc92 100644 --- a/src/intel/compiler/brw_from_nir.cpp +++ b/src/intel/compiler/brw_from_nir.cpp @@ -2083,12 +2083,11 @@ emit_pixel_interpolater_send(const brw_builder &bld, srcs[INTERP_SRC_MSG_DESC] = desc; srcs[INTERP_SRC_DYNAMIC_MODE] = flag_reg; + srcs[INTERP_SRC_NOPERSPECTIVE] = brw_imm_ud(false); - brw_inst *inst = bld.emit(opcode, dst, srcs, INTERP_NUM_SRCS); - /* 2 floats per slot returned */ - inst->size_written = 2 * dst.component_size(inst->exec_size); if (interpolation == INTERP_MODE_NOPERSPECTIVE) { - inst->pi_noperspective = true; + srcs[INTERP_SRC_NOPERSPECTIVE] = brw_imm_ud(true); + /* TGL BSpec says: * This field cannot be set to "Linear Interpolation" * unless Non-Perspective Barycentric Enable in 3DSTATE_CLIP is enabled" @@ -2096,6 +2095,10 @@ emit_pixel_interpolater_send(const brw_builder &bld, wm_prog_data->uses_nonperspective_interp_modes = true; } + brw_inst *inst = bld.emit(opcode, dst, srcs, INTERP_NUM_SRCS); + /* 2 floats per slot returned */ + inst->size_written = 2 * dst.component_size(inst->exec_size); + wm_prog_data->pulls_bary = true; return inst; diff --git a/src/intel/compiler/brw_inst.cpp b/src/intel/compiler/brw_inst.cpp index 3e80d8f57ab..062ddae5a0c 100644 --- a/src/intel/compiler/brw_inst.cpp +++ b/src/intel/compiler/brw_inst.cpp @@ -197,10 +197,12 @@ brw_inst::is_control_source(unsigned arg) const case SHADER_OPCODE_BROADCAST: case SHADER_OPCODE_SHUFFLE: case SHADER_OPCODE_QUAD_SWIZZLE: + return arg == 1; + case FS_OPCODE_INTERPOLATE_AT_SAMPLE: case FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET: case FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET: - return arg == 1; + return arg == INTERP_SRC_MSG_DESC || arg == INTERP_SRC_NOPERSPECTIVE; case SHADER_OPCODE_MOV_INDIRECT: case SHADER_OPCODE_CLUSTER_BROADCAST: diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h index 26f5334f2fa..651f6022c8e 100644 --- a/src/intel/compiler/brw_inst.h +++ b/src/intel/compiler/brw_inst.h @@ -192,7 +192,7 @@ public: */ unsigned rcount:4; - unsigned pad:3; + unsigned pad:4; bool predicate_inverse:1; bool writes_accumulator:1; /**< instruction implicitly writes accumulator */ @@ -215,7 +215,6 @@ public: bool predicate_trivial:1; bool eot:1; bool last_rt:1; - bool pi_noperspective:1; /**< Pixel interpolator noperspective flag */ bool keep_payload_trailing_zeros:1; /** * Whether the parameters of the SEND instructions are build with diff --git a/src/intel/compiler/brw_lower_logical_sends.cpp b/src/intel/compiler/brw_lower_logical_sends.cpp index 7bdedd66881..90a26cfcb97 100644 --- a/src/intel/compiler/brw_lower_logical_sends.cpp +++ b/src/intel/compiler/brw_lower_logical_sends.cpp @@ -2072,6 +2072,8 @@ lower_interpolator_logical_send(const brw_builder &bld, brw_inst *inst, const struct brw_wm_prog_key *wm_prog_key, const struct brw_wm_prog_data *wm_prog_data) { + assert(inst->src[INTERP_SRC_NOPERSPECTIVE].file == IMM); + const intel_device_info *devinfo = bld.shader->devinfo; /* We have to send something */ @@ -2110,7 +2112,7 @@ lower_interpolator_logical_send(const brw_builder &bld, brw_inst *inst, * dynamic, it will be ORed in below. */ dynamic_mode ? 0 : mode, - inst->pi_noperspective, + inst->src[INTERP_SRC_NOPERSPECTIVE].ud, false /* coarse_pixel_rate */, inst->exec_size, inst->group);