On 10/06/2012 06:44 PM, Mario Kleiner wrote:
The GL_POINT_BIT state attribute GL_POINT_SPRITE_COORD_ORIGIN
is only supported on OpenGL-2.0 or later. Prevent glPopAttrib()
from trying to restore it on OpenGL-1.4 implementations which
support GL_ARB_POINT_SPRITE, as otherwise the sequence...

glPushAttrib(GL_POINT_BIT);
glPopAttrib();

throws an GL_INVALID_ENUM error in glPopAttrib().

See also commit f778174ea1e431a7113f12c12beb4aba9e825a9f

Signed-off-by: Mario Kleiner <mario.klei...@tuebingen.mpg.de>
---
  src/mesa/main/attrib.c |    7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index b92c465..03a7e2d 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1159,8 +1159,11 @@ _mesa_PopAttrib(void)
                    if (ctx->Extensions.NV_point_sprite)
                       _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV,
                                             ctx->Point.SpriteRMode);
-                  _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
-                                        (GLfloat)ctx->Point.SpriteOrigin);
+
+                  if ((ctx->API == API_OPENGL && ctx->Version >= 20)
+                      || ctx->API == API_OPENGL_CORE)
+                     _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
+                                           (GLfloat)ctx->Point.SpriteOrigin);
                 }
              }
              break;

Nice catch!

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to