}
static struct ureg_dst
-calc_line(struct ureg_program *shader)
+calc_line(struct pipe_screen *screen, struct ureg_program *shader)
{
struct ureg_dst tmp;
struct ureg_src pos;
tmp = ureg_DECL_temporary(shader);
- pos = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS, TGSI_INTERPOLATE_LINEAR);
+ if (screen->get_param(screen, PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL))
+ pos = ureg_DECL_system_value(shader, TGSI_SEMANTIC_POSITION, 0);
+ else
+ pos = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS,
+ TGSI_INTERPOLATE_LINEAR);
/*
* tmp.y = fraction(pos.y / 2) >= 0.5 ? 1 : 0
fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0);
- field = calc_line(shader);
+ field = calc_line(r->pipe->screen, shader);
/*
* ref = field.z ? tc[1] : tc[0]
fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0);
- tmp = calc_line(shader);
+ tmp = calc_line(r->pipe->screen, shader);
/*
* if (field == tc.w)