Mesa (mesa_7_7_branch): mesa/meta: move BindTexture() call in _mesa_meta_GenerateMipmap()

Brian Paul brianp at kemper.freedesktop.org
Mon Dec 14 12:40:35 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 69346c56a17ba9a74b7f2226c0b4d5ce0bbb1f15
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=69346c56a17ba9a74b7f2226c0b4d5ce0bbb1f15

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Dec 14 13:35:56 2009 -0700

mesa/meta: move BindTexture() call in _mesa_meta_GenerateMipmap()

This is a follow-up to commit e3fa700c178e11e6735430119232919176ab7b42.

The call to _mesa_BindTexture() must be before we set any other texture
object state, namely the _mesa_TexParameteri() calls.

This fixes bug 25601 (piglit gen-nonzero-unit failure).

---

 src/mesa/drivers/common/meta.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 39b0ab1..cd9075b 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2170,6 +2170,9 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target,
 
    _mesa_meta_begin(ctx, META_ALL);
 
+   if (original_active_unit != 0)
+      _mesa_BindTexture(target, texObj->Name);
+
    if (mipmap->ArrayObj == 0) {
       /* one-time setup */
 
@@ -2289,9 +2292,6 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target,
    /* texture is already locked, unlock now */
    _mesa_unlock_texture(ctx, texObj);
 
-   if (original_active_unit != 0)
-      _mesa_BindTexture(target, texObj->Name);
-
    for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) {
       const struct gl_texture_image *srcImage;
       const GLuint srcLevel = dstLevel - 1;



More information about the mesa-commit mailing list