Mesa (mesa_7_7_branch): meta: set viewport and projection matrix in _mesa_meta_GenerateMipmap
Brian Paul
brianp at kemper.freedesktop.org
Thu Jan 7 01:20:30 UTC 2010
Module: Mesa
Branch: mesa_7_7_branch
Commit: 06970b2ccb6add0696710f01a07ebf9ec3922c80
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=06970b2ccb6add0696710f01a07ebf9ec3922c80
Author: Brian Paul <brianp at vmware.com>
Date: Wed Jan 6 18:12:42 2010 -0700
meta: set viewport and projection matrix in _mesa_meta_GenerateMipmap
This fixes mipmap levels being clipped to the last viewport.
Based on a patch submitted by Pierre Willenbrock <pierre at pirsoft.de>
---
src/mesa/drivers/common/meta.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index cd9075b..adc9864 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2408,6 +2408,15 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target,
break;
}
+ assert(dstWidth == ctx->DrawBuffer->Width);
+ assert(dstHeight == ctx->DrawBuffer->Height);
+
+ /* setup viewport and matching projection matrix */
+ _mesa_set_viewport(ctx, 0, 0, dstWidth, dstHeight);
+ _mesa_MatrixMode(GL_PROJECTION);
+ _mesa_LoadIdentity();
+ _mesa_Ortho(0.0F, dstWidth, 0.0F, dstHeight, -1.0F, 1.0F);
+
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
More information about the mesa-commit
mailing list