static struct brw_fp_src get_pixel_w( struct brw_wm_compile *c ) { if (src_is_undef(c->fp_pixel_w)) { struct brw_fp_dst pixel_w = get_temp(c); struct brw_fp_src deltas = get_delta_xy(c); /* XXX: assuming position is always first -- valid? */ struct brw_fp_src interp_wpos = src_reg(BRW_FILE_PAYLOAD, 0); /* deltas.xyw = DELTAS2 deltas.xy, payload.interp_wpos.x */ emit_op3(c, WM_PIXELW, dst_mask(pixel_w, BRW_WRITEMASK_W), interp_wpos, deltas, src_undef()); c->fp_pixel_w = src_reg_from_dst(pixel_w); } return c->fp_pixel_w; }
static struct prog_src_register get_pixel_xy( struct brw_wm_compile *c ) { if (src_is_undef(c->pixel_xy)) { struct prog_dst_register pixel_xy = get_temp(c); struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); /* Emit the out calculations, and hold onto the results. Use * two instructions as a temporary is required. */ /* pixel_xy.xy = PIXELXY payload[0]; */ emit_op(c, WM_PIXELXY, dst_mask(pixel_xy, WRITEMASK_XY), 0, payload_r0_depth, src_undef(), src_undef()); c->pixel_xy = src_reg_from_dst(pixel_xy); } return c->pixel_xy; }
static struct brw_fp_src get_delta_xy( struct brw_wm_compile *c ) { if (src_is_undef(c->fp_delta_xy)) { struct brw_fp_dst delta_xy = get_temp(c); struct brw_fp_src pixel_xy = get_pixel_xy(c); struct brw_fp_src payload_r0_depth = src_reg(BRW_FILE_PAYLOAD, PAYLOAD_DEPTH); /* deltas.xy = DELTAXY pixel_xy, payload[0] */ emit_op3(c, WM_DELTAXY, dst_mask(delta_xy, BRW_WRITEMASK_XY), pixel_xy, payload_r0_depth, src_undef()); c->fp_delta_xy = src_reg_from_dst(delta_xy); } return c->fp_delta_xy; }
static struct brw_fp_src get_pixel_xy( struct brw_wm_compile *c ) { if (src_is_undef(c->fp_pixel_xy)) { struct brw_fp_dst pixel_xy = get_temp(c); struct brw_fp_src payload_r0_depth = src_reg(BRW_FILE_PAYLOAD, PAYLOAD_DEPTH); /* Emit the out calculations, and hold onto the results. Use * two instructions as a temporary is required. */ /* pixel_xy.xy = PIXELXY payload[0]; */ emit_op1(c, WM_PIXELXY, dst_mask(pixel_xy, BRW_WRITEMASK_XY), payload_r0_depth); c->fp_pixel_xy = src_reg_from_dst(pixel_xy); } return c->fp_pixel_xy; }
static struct prog_src_register get_delta_xy( struct brw_wm_compile *c ) { if (src_is_undef(c->delta_xy)) { struct prog_dst_register delta_xy = get_temp(c); struct prog_src_register pixel_xy = get_pixel_xy(c); struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); /* deltas.xy = DELTAXY pixel_xy, payload[0] */ emit_op(c, WM_DELTAXY, dst_mask(delta_xy, WRITEMASK_XY), 0, pixel_xy, payload_r0_depth, src_undef()); c->delta_xy = src_reg_from_dst(delta_xy); } return c->delta_xy; }
static struct prog_src_register get_pixel_w( struct brw_wm_compile *c ) { if (src_is_undef(c->pixel_w)) { struct prog_dst_register pixel_w = get_temp(c); struct prog_src_register deltas = get_delta_xy(c); struct prog_src_register interp_wpos = src_reg(PROGRAM_PAYLOAD, FRAG_ATTRIB_WPOS); /* deltas.xyw = DELTAS2 deltas.xy, payload.interp_wpos.x */ emit_op(c, WM_PIXELW, dst_mask(pixel_w, WRITEMASK_W), 0, interp_wpos, deltas, src_undef()); c->pixel_w = src_reg_from_dst(pixel_w); } return c->pixel_w; }