vl/zscan: fix "Fix trivial sign compare warnings"
authorChristian König <christian.koenig@amd.com>
Wed, 14 Dec 2016 14:03:35 +0000 (15:03 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 3 Jan 2017 11:18:14 +0000 (12:18 +0100)
The variable actually needs to be signed, otherwise converting it to a
float doesn't work as expected.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98914
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Fixes: 1fb4179f927 ("vl: Fix trivial sign compare warnings")
src/gallium/auxiliary/vl/vl_zscan.c

index ef05af463f32fa3c67997540905e076009d45bfa..24d64525b763672b72584b55f50dce19c649783e 100644 (file)
@@ -152,7 +152,7 @@ create_vert_shader(struct vl_zscan *zscan)
    for (i = 0; i < zscan->num_channels; ++i) {
       ureg_ADD(shader, ureg_writemask(tmp, TGSI_WRITEMASK_X), ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_Y),
                ureg_imm1f(shader, 1.0f / (zscan->blocks_per_line * VL_BLOCK_WIDTH)
-                * (i - (signed)zscan->num_channels / 2)));
+                * ((signed)i - (signed)zscan->num_channels / 2)));
 
       ureg_MAD(shader, ureg_writemask(o_vtex[i], TGSI_WRITEMASK_X), vrect,
                ureg_imm1f(shader, 1.0f / zscan->blocks_per_line), ureg_src(tmp));