vl: add half pixel to v_tex before adding offsets
authorNayan Deshmukh <nayan26deshmukh@gmail.com>
Tue, 5 Jul 2016 18:17:56 +0000 (23:47 +0530)
committerChristian König <christian.koenig@amd.com>
Fri, 8 Jul 2016 18:51:12 +0000 (20:51 +0200)
Since pixel center lies at 0.5, add half_pixel to vtex
before adding offsets to it.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/auxiliary/vl/vl_bicubic_filter.c

index ca9f8820e3bc1a14801fe6d6d882b64466e23e6a..25bc58c38069c2e783b3078d4cbfbd44824a228d 100644 (file)
@@ -197,6 +197,8 @@ create_frag_shader(struct vl_bicubic_filter *filter, unsigned video_width,
             ureg_src(t_array[22]));
    ureg_DIV(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
             ureg_src(t_array[22]), ureg_imm2f(shader, video_width, video_height));
+   ureg_ADD(shader, ureg_writemask(t_array[22], TGSI_WRITEMASK_XY),
+            ureg_src(t_array[22]), half_pixel);
 
    /*
     * t_array[0..*] = vtex + offset[0..*]