diff options
author | Ian Romanick <[email protected]> | 2013-08-08 12:33:04 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-08-13 17:54:17 -0700 |
commit | 0c405cd0e827eaa4c5d6ec3f533616208c73baf5 (patch) | |
tree | e81520b50759a043ca6a77893f247a6929ad0227 /src | |
parent | b76ff3dbcdb8ccbbd3426a6fef7688fbdb9ba46d (diff) |
meta: Don't call _mesa_Ortho with width or height of 0
Fixes failures in oglconform fbo mipmap.manual.color,
mipmap.manual.colorAndDepth, mipmap.automatic, and
mipmap.manualIterateTexTargets subtests.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Cc: "9.2" <[email protected]>
(cherry picked from commit 341fb93c162052e0b1eff7f5e53c49aba498ee9a)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 4a3497c9aa7..286f32ef325 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -704,9 +704,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_LoadIdentity(); _mesa_MatrixMode(GL_PROJECTION); _mesa_LoadIdentity(); - _mesa_Ortho(0.0, ctx->DrawBuffer->Width, - 0.0, ctx->DrawBuffer->Height, - -1.0, 1.0); + + /* glOrtho with width = 0 or height = 0 generates GL_INVALID_VALUE. + * This can occur when there is no draw buffer. + */ + if (ctx->DrawBuffer->Width != 0 && ctx->DrawBuffer->Height != 0) + _mesa_Ortho(0.0, ctx->DrawBuffer->Width, + 0.0, ctx->DrawBuffer->Height, + -1.0, 1.0); } if (state & MESA_META_CLIP) { |