Mesa (master): meta: Restore API at the end of _mesa_meta_end(), not the start.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Feb 27 18:24:00 UTC 2014


Module: Mesa
Branch: master
Commit: cf719a0204effd787fab6f285d72af9c1c144544
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cf719a0204effd787fab6f285d72af9c1c144544

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Feb 26 22:19:33 2014 -0800

meta: Restore API at the end of _mesa_meta_end(), not the start.

In _mesa_meta_begin(), we switch to API_OPENGL_COMPAT, then munge a lot
of state (including some that doesn't exist in the actual API - like
PolygonStipple in API_OPENGL_CORE).

It seems reasonable that in _mesa_meta_end(), we should restore it,
then switch back to the original API.  This at least makes it symmetric.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/common/meta.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index d415e61..19600e6 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -768,8 +768,6 @@ _mesa_meta_end(struct gl_context *ctx)
    const GLbitfield state = save->SavedState;
    int i;
 
-   ctx->API = save->API;
-
    /* After starting a new occlusion query, initialize the results to the
     * values saved previously. The driver will then continue to increment
     * these values.
@@ -1117,6 +1115,8 @@ _mesa_meta_end(struct gl_context *ctx)
       _mesa_ResumeTransformFeedback();
 
    ctx->Meta->SaveStackDepth--;
+
+   ctx->API = save->API;
 }
 
 




More information about the mesa-commit mailing list