Mesa (7.11): mesa: fix error handling for some glGet* functions

Ian Romanick idr at kemper.freedesktop.org
Mon Oct 24 15:54:48 PDT 2011


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

Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date:   Mon Sep 19 15:02:59 2011 +0800

mesa: fix error handling for some glGet* functions

According to the man page, it should trigger a GL_INVALID_OPERATION
while calling some glGet* functions inside glBegin and glEnd.

This patch dose handle the following functions:
 glGetBooleanv
 glGetFloatv
 glGetIntegerv
 glGetInteger64v
 glGetDoublev

Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Signed-off-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit f1ddde5c16ef61a6c08af012af3e5f34aebaf7a0)

---

 src/mesa/main/get.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index d32c68a..13f416a 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1922,6 +1922,9 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params)
    GLmatrix *m;
    int shift, i;
    void *p;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    d = find_value("glGetBooleanv", pname, &p, &v);
    switch (d->type) {
@@ -2006,6 +2009,9 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
    GLmatrix *m;
    int shift, i;
    void *p;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    d = find_value("glGetFloatv", pname, &p, &v);
    switch (d->type) {
@@ -2090,6 +2096,9 @@ _mesa_GetIntegerv(GLenum pname, GLint *params)
    GLmatrix *m;
    int shift, i;
    void *p;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    d = find_value("glGetIntegerv", pname, &p, &v);
    switch (d->type) {
@@ -2181,6 +2190,9 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params)
    GLmatrix *m;
    int shift, i;
    void *p;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    d = find_value("glGetInteger64v", pname, &p, &v);
    switch (d->type) {
@@ -2272,6 +2284,9 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params)
    GLmatrix *m;
    int shift, i;
    void *p;
+   GET_CURRENT_CONTEXT(ctx);
+
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    d = find_value("glGetDoublev", pname, &p, &v);
    switch (d->type) {



More information about the mesa-commit mailing list