summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authorMario Kleiner <[email protected]>2012-10-07 03:44:14 +0200
committerKenneth Graunke <[email protected]>2012-11-08 22:53:54 -0800
commiteabbe5c45f5d05822c5f841628afa4008398d553 (patch)
tree029aa90207e8b83f4e0147771c0ea57045244ad9 /src/mesa/main/attrib.c
parentc299f44782d7d7d6719fce622a121aad58856139 (diff)
mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0
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 NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r--src/mesa/main/attrib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 49a3ab5b43d..0997e5407fa 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1149,8 +1149,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;