diff options
author | Marek Olšák <[email protected]> | 2016-01-07 23:14:55 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-01-08 20:07:16 +0100 |
commit | d0cf66d8358448ea752a1d84fdb1503e61b49065 (patch) | |
tree | fd287e62aa8435b9e5e9f1a3ba3db0d7a066a30c | |
parent | 69f43c2cc903d5973bab2515be51465c9e8f9f9e (diff) |
vl: allow fragment shader POSITION to be a system value
Reviewed-by: Edward O'Callaghan <[email protected]
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/vl/vl_mc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mc.c b/src/gallium/auxiliary/vl/vl_mc.c index 6c317bbe04a..eb703a90445 100644 --- a/src/gallium/auxiliary/vl/vl_mc.c +++ b/src/gallium/auxiliary/vl/vl_mc.c @@ -79,14 +79,18 @@ calc_position(struct vl_mc *r, struct ureg_program *shader, struct ureg_src bloc } 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 @@ -177,7 +181,7 @@ create_ref_frag_shader(struct vl_mc *r) 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] @@ -324,7 +328,7 @@ create_ycbcr_frag_shader(struct vl_mc *r, float scale, bool invert, fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0); - tmp = calc_line(shader); + tmp = calc_line(r->pipe->screen, shader); /* * if (field == tc.w) |