Browse Source

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@pirsoft.de>
tags/mesa-7.7-1
Brian Paul 16 years ago
parent
commit
06970b2ccb
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      src/mesa/drivers/common/meta.c

+ 9
- 0
src/mesa/drivers/common/meta.c View File

@@ -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);
}


Loading…
Cancel
Save