v2: - add assert so we don't run into trouble on Gen6.
- adjust for Tapani's rearrangement of ir_variable
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
return reg;
}
+fs_reg *
+fs_visitor::emit_samplemaskin_setup(ir_variable *ir)
+{
+ assert(brw->gen >= 7);
+ this->current_annotation = "compute gl_SampleMaskIn";
+ fs_reg *reg = new(this->mem_ctx) fs_reg(this, ir->type);
+ emit(MOV(*reg, fs_reg(retype(brw_vec8_grf(c->sample_mask_reg, 0), BRW_REGISTER_TYPE_D))));
+ return reg;
+}
+
fs_reg
fs_visitor::fix_math_operand(fs_reg src)
{
c->nr_payload_regs++;
}
- /* R32-: bary for 32-pixel. */
+ /* R32: MSAA input coverage mask */
+ if (fp->Base.SystemValuesRead & SYSTEM_BIT_SAMPLE_MASK_IN) {
+ assert(brw->gen >= 7);
+ c->sample_mask_reg = c->nr_payload_regs;
+ c->nr_payload_regs++;
+ if (dispatch_width == 16) {
+ /* R33: input coverage mask if not 8-wide. */
+ c->nr_payload_regs++;
+ }
+ }
+
+ /* R34-: bary for 32-pixel. */
/* R58-59: interp W for 32-pixel. */
if (fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
fs_reg *emit_frontfacing_interpolation(ir_variable *ir);
fs_reg *emit_samplepos_setup(ir_variable *ir);
fs_reg *emit_sampleid_setup(ir_variable *ir);
+ fs_reg *emit_samplemaskin_setup(ir_variable *ir);
fs_reg *emit_general_interpolation(ir_variable *ir);
void emit_interpolation_setup_gen4();
void emit_interpolation_setup_gen6();
reg = emit_samplepos_setup(ir);
} else if (ir->data.location == SYSTEM_VALUE_SAMPLE_ID) {
reg = emit_sampleid_setup(ir);
+ } else if (ir->data.location == SYSTEM_VALUE_SAMPLE_MASK_IN) {
+ reg = emit_samplemaskin_setup(ir);
}
}
uint8_t aa_dest_stencil_reg;
uint8_t dest_depth_reg;
uint8_t sample_pos_reg;
+ uint8_t sample_mask_reg;
uint8_t barycentric_coord_reg[BRW_WM_BARYCENTRIC_INTERP_MODE_COUNT];
uint8_t nr_payload_regs;
GLuint source_depth_to_render_target:1;
dw2 |= GEN7_WM_MSDISPMODE_PERSAMPLE;
}
+ if (fp->program.Base.SystemValuesRead & SYSTEM_BIT_SAMPLE_MASK_IN) {
+ dw1 |= GEN7_WM_USES_INPUT_COVERAGE_MASK;
+ }
+
BEGIN_BATCH(3);
OUT_BATCH(_3DSTATE_WM << 16 | (3 - 2));
OUT_BATCH(dw1);