[Mesa-dev] [PATCH 1/2] mesa: Round the argument to PixelStoref instead of truncating.
Brian Paul
brianp at vmware.com
Tue Oct 18 12:48:10 PDT 2011
On 10/18/2011 01:31 PM, Eric Anholt wrote:
> From the GL 2.1 specification, page 114 (page 128 of the PDF):
>
> "The version of PixelStore that takes a floating-point value
> may be used to set any type of parameter; if the parameter is
> boolean, then it is set to FALSE if the passed value is 0.0
> and TRUE otherwise, while if the parameter is an integer, then
> the passed value is rounded to the nearest integer."
>
> Fixes piglit roundmode-pixelstore.
> ---
> src/mesa/main/pixelstore.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c
> index d957950..8147449 100644
> --- a/src/mesa/main/pixelstore.c
> +++ b/src/mesa/main/pixelstore.c
> @@ -214,7 +214,7 @@ _mesa_PixelStorei( GLenum pname, GLint param )
> void GLAPIENTRY
> _mesa_PixelStoref( GLenum pname, GLfloat param )
> {
> - _mesa_PixelStorei( pname, (GLint) param );
> + _mesa_PixelStorei( pname, IROUND(param) );
> }
>
>
Maybe tag this as a candidate for the 7.11 branch (though it's pretty
obscure).
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list