[Mesa-dev] [PATCH] svga: fix incorrect round-down arithmetic

Roland Scheidegger sroland at vmware.com
Mon Oct 19 07:45:33 PDT 2015


Reviewed-by: Roland Scheidegger <sroland at vmware.com>

Am 19.10.2015 um 16:42 schrieb Brian Paul:
> Spotted by Roland.  Luckily, this code should never really be hit
> since the const buffer size and offset should already be multiples
> of 16.  I could probably add more assertions to that effect, but
> let's just fix the arithmetic for now.
> ---
>  src/gallium/drivers/svga/svga_state_constants.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c
> index 75592d3..c93d2a5 100644
> --- a/src/gallium/drivers/svga/svga_state_constants.c
> +++ b/src/gallium/drivers/svga/svga_state_constants.c
> @@ -718,7 +718,7 @@ emit_consts_vgpu10(struct svga_context *svga, unsigned shader)
>              /* round down to mulitple of 16 (this may cause rendering problems
>               * but should avoid a device error).
>               */
> -            size &= ~16;
> +            size &= ~15;
>           }
>        }
>  
> 



More information about the mesa-dev mailing list