mesa: fix incorrect viewport clamping in _mesa_set_viewport()

A 0 by 0 viewport size is legal.  Don't clamp against lower bound of one.
The error checking earlier in the function prevents negative values.
This commit is contained in:
Brian Paul
2009-06-16 09:34:35 -06:00
parent ed7f4b4230
commit 3e48dd0445
+2 -2
View File
@@ -73,8 +73,8 @@ _mesa_set_viewport(GLcontext *ctx, GLint x, GLint y,
}
/* clamp width and height to the implementation dependent range */
width = CLAMP(width, 1, (GLsizei) ctx->Const.MaxViewportWidth);
height = CLAMP(height, 1, (GLsizei) ctx->Const.MaxViewportHeight);
width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);
ctx->Viewport.X = x;
ctx->Viewport.Width = width;