mesa: Round the argument to PixelStoref instead of truncating.
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. Note: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -2486,6 +2486,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_GenerateMipmapEXT(GLenum target)
|
_mesa_GenerateMipmapEXT(GLenum target)
|
||||||
{
|
{
|
||||||
|
struct gl_texture_image *srcImage;
|
||||||
struct gl_texture_object *texObj;
|
struct gl_texture_object *texObj;
|
||||||
GLboolean error;
|
GLboolean error;
|
||||||
|
|
||||||
@@ -2532,6 +2533,13 @@ _mesa_GenerateMipmapEXT(GLenum target)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_mesa_lock_texture(ctx, texObj);
|
_mesa_lock_texture(ctx, texObj);
|
||||||
|
|
||||||
|
srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
|
||||||
|
if (!srcImage) {
|
||||||
|
_mesa_unlock_texture(ctx, texObj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (target == GL_TEXTURE_CUBE_MAP) {
|
if (target == GL_TEXTURE_CUBE_MAP) {
|
||||||
GLuint face;
|
GLuint face;
|
||||||
for (face = 0; face < 6; face++)
|
for (face = 0; face < 6; face++)
|
||||||
|
@@ -214,7 +214,7 @@ _mesa_PixelStorei( GLenum pname, GLint param )
|
|||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_PixelStoref( GLenum pname, GLfloat param )
|
_mesa_PixelStoref( GLenum pname, GLfloat param )
|
||||||
{
|
{
|
||||||
_mesa_PixelStorei( pname, (GLint) param );
|
_mesa_PixelStorei( pname, IROUND(param) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user