From 0528f40e3b8ca3e59d3a641c4504d34cf9364578 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 25 Nov 2009 16:31:28 -0800 Subject: 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 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 4c8fc1f72e..b330544890 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, -- cgit v1.2.3