Mesa (mesa_7_6_branch): Improve implementation of GL_POINT_SPRITE_COORD_ORIGIN errors
Ian Romanick
idr at kemper.freedesktop.org
Mon Nov 30 01:44:22 UTC 2009
Module: Mesa
Branch: mesa_7_6_branch
Commit: 0528f40e3b8ca3e59d3a641c4504d34cf9364578
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0528f40e3b8ca3e59d3a641c4504d34cf9364578
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Wed Nov 25 16:31:28 2009 -0800
Improve implementation of GL_POINT_SPRITE_COORD_ORIGIN errors
This enum is only supported for OpenGL 2.0. If a driver supports
OpenGL 1.4 and GL_ARB_point_sprite, using this enum should generate an
error. This is important because, for example, i915 and i830 can
support GL_ARB_point_sprite, but they cannot support
GL_POINT_SPRITE_COORD_ORIGIN.
This commit just removes the check for NV_point_sprite, which is
completely wrong, and add some comments describing what the code
should do. I don't see an easy way to check for version >= 2.0 from
inside Mesa. Perhaps we should add an extension
GL_MESA_point_sprite_20 (like Intel's old GL_EXT_packed_pixels_12) to
indicate that this added bit of functionality is available.
Also note that glean's pointSprite test only checks for
GL_ARB_point_sprite before trying to use
GL_POINT_SPRITE_COORD_ORIGIN. Naturally, that fails on
non-2.0 implementations (i.e., Mac OS X on GMA 950).
---
src/mesa/main/points.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 4c8fc1f..b330544 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -200,7 +200,12 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
}
break;
case GL_POINT_SPRITE_COORD_ORIGIN:
- if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) {
+ /* This is not completely correct. GL_POINT_SPRITE_COORD_ORIGIN was
+ * added to point sprites when the extension was merged into OpenGL
+ * 2.0. It is expected that an implementation supporting OpenGL 1.4
+ * and GL_ARB_point_sprite will generate an error here.
+ */
+ if (ctx->Extensions.ARB_point_sprite) {
GLenum value = (GLenum) params[0];
if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) {
_mesa_error(ctx, GL_INVALID_VALUE,
More information about the mesa-commit
mailing list