diff options
author | Anuj Phogat <[email protected]> | 2014-03-28 17:44:59 -0700 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2014-05-01 10:58:39 -0700 |
commit | 49c71050de1e0df451e29621558b4adfefb7e098 (patch) | |
tree | 74e3aa8852bc084d4ddb335100a9317c6b32291e /src/mesa/main/varray.c | |
parent | dc75479b7a7b9207d9d7c9487085ad14fa5d26cc (diff) |
mesa: Use location VERT_ATTRIB_GENERIC0 for vertex attribute 0
In OpenGL 3.1 attribute 0 becomes non-magic, just like in
OpenGL ES 2.0. Earlier versions of OpenGL used attribute 0
exclusively for vertex position.
V2: Add a utility function _mesa_attr_zero_aliases_vertex() in
varray.h
Fixes 4 Khronos OpenGL CTS failures:
glGetVertexAttrib
depth24_basic
depth24_precision
rgb8_rgba8_rgb
Cc: <[email protected]>
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 66a3ef119af..81f71f8265e 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -784,13 +784,7 @@ static const GLfloat * get_current_attrib(struct gl_context *ctx, GLuint index, const char *function) { if (index == 0) { - /* In OpenGL 3.1 attribute 0 becomes non-magic, just like in OpenGL ES - * 2.0. Note that we cannot just check for API_OPENGL_CORE here because - * that will erroneously allow this usage in a 3.0 forward-compatible - * context too. - */ - if ((ctx->API != API_OPENGL_CORE || ctx->Version < 31) - && ctx->API != API_OPENGLES2) { + if (_mesa_attr_zero_aliases_vertex(ctx)) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s(index==0)", function); return NULL; } |