[Mesa-dev] [PATCH] softpipe: fix incorrect front-facing value.

Brian Paul brianp at vmware.com
Thu Nov 10 13:35:35 PST 2011


On 11/10/2011 02:17 PM, Morgan Armand wrote:
> Because the type of the facing attribute is unsigned, the whole computation was
> done in the unsigned range.
>
> Fixes fbo-fragcoord2, glsl1-gl_FrontFacing var (2) and glsl-fs-frontfacing tests.
>
> ---
>   src/gallium/drivers/softpipe/sp_fs_exec.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c
> index 779b8c4..cf19696 100644
> --- a/src/gallium/drivers/softpipe/sp_fs_exec.c
> +++ b/src/gallium/drivers/softpipe/sp_fs_exec.c
> @@ -128,7 +128,7 @@ exec_run( const struct sp_fragment_shader_variant *var,
>                       &machine->QuadPos);
>
>      /* convert 0 to 1.0 and 1 to -1.0 */
> -   machine->Face = (float) (quad->input.facing * -2 + 1);
> +   machine->Face = (float) ((signed)quad->input.facing * -2 + 1);
>
>      quad->inout.mask&= tgsi_exec_machine_run( machine );
>      if (quad->inout.mask == 0)

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list