diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-07 20:11:23 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-12-08 09:51:19 +0100 |
commit | 340c0f6f9ece070e3f3245134eabe80d7551a870 (patch) | |
tree | 6afbb0277d8d4493ec67dbcd150bd834fbe1e95a /src/gallium/state_trackers/xa/xa_tgsi.c | |
parent | d4976158c7f32705b48c773c3abd1b22bebe9c16 (diff) | |
download | external_mesa3d-340c0f6f9ece070e3f3245134eabe80d7551a870.zip external_mesa3d-340c0f6f9ece070e3f3245134eabe80d7551a870.tar.gz external_mesa3d-340c0f6f9ece070e3f3245134eabe80d7551a870.tar.bz2 |
st/xa: Update xa_yuv_planar_blit semantics
Change and document the interpretation of the color conversion matrix
in order to make the function more versatile and to simplify the
generated shader.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'src/gallium/state_trackers/xa/xa_tgsi.c')
-rw-r--r-- | src/gallium/state_trackers/xa/xa_tgsi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/xa/xa_tgsi.c b/src/gallium/state_trackers/xa/xa_tgsi.c index ed1690e..c7454c9 100644 --- a/src/gallium/state_trackers/xa/xa_tgsi.c +++ b/src/gallium/state_trackers/xa/xa_tgsi.c @@ -320,7 +320,7 @@ create_yuv_shader(struct pipe_context *pipe, struct ureg_program *ureg) { struct ureg_src y_sampler, u_sampler, v_sampler; struct ureg_src pos; - struct ureg_src matrow0, matrow1, matrow2; + struct ureg_src matrow0, matrow1, matrow2, matrow3; struct ureg_dst y, u, v, rgb; struct ureg_dst out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, @@ -342,24 +342,20 @@ create_yuv_shader(struct pipe_context *pipe, struct ureg_program *ureg) matrow0 = ureg_DECL_constant(ureg, 0); matrow1 = ureg_DECL_constant(ureg, 1); matrow2 = ureg_DECL_constant(ureg, 2); + matrow3 = ureg_DECL_constant(ureg, 3); ureg_TEX(ureg, y, TGSI_TEXTURE_2D, pos, y_sampler); ureg_TEX(ureg, u, TGSI_TEXTURE_2D, pos, u_sampler); ureg_TEX(ureg, v, TGSI_TEXTURE_2D, pos, v_sampler); - ureg_SUB(ureg, u, ureg_src(u), ureg_scalar(matrow0, TGSI_SWIZZLE_W)); - ureg_SUB(ureg, v, ureg_src(v), ureg_scalar(matrow0, TGSI_SWIZZLE_W)); - - ureg_MUL(ureg, rgb, ureg_scalar(ureg_src(y), TGSI_SWIZZLE_X), matrow0); + ureg_MOV(ureg, rgb, matrow3); + ureg_MAD(ureg, rgb, + ureg_scalar(ureg_src(y), TGSI_SWIZZLE_X), matrow0, ureg_src(rgb)); ureg_MAD(ureg, rgb, ureg_scalar(ureg_src(u), TGSI_SWIZZLE_X), matrow1, ureg_src(rgb)); ureg_MAD(ureg, rgb, ureg_scalar(ureg_src(v), TGSI_SWIZZLE_X), matrow2, ureg_src(rgb)); - /* rgb.a = 1; */ - ureg_MOV(ureg, ureg_writemask(rgb, TGSI_WRITEMASK_W), - ureg_scalar(matrow0, TGSI_SWIZZLE_X)); - ureg_MOV(ureg, out, ureg_src(rgb)); ureg_release_temporary(ureg, rgb); |