mesa: Enable GL_MAX_VERTEX_ATTRIBS in ES2.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Aug 2010 19:27:07 +0000 (12:27 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 8 Sep 2010 00:30:38 +0000 (17:30 -0700)
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/get.c

index a3cb5ec168ff78d0fa43557440c2ec60831826d8..2062134a390639f663742988cf58d08269681fac 100644 (file)
@@ -128,6 +128,7 @@ enum value_extra {
    EXTRA_VERSION_30,
    EXTRA_VERSION_31,
    EXTRA_VERSION_32,
+   EXTRA_VERSION_ES2,
    EXTRA_NEW_BUFFERS, 
    EXTRA_VALID_DRAW_BUFFER,
    EXTRA_VALID_TEXTURE_UNIT,
@@ -326,6 +327,13 @@ static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END };
 static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END };
 static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END };
 
+static const int
+extra_ARB_vertex_program_version_es2[] = {
+   EXT(ARB_vertex_program),
+   EXTRA_VERSION_ES2,
+   EXTRA_END
+};
+
 #define API_OPENGL_BIT (1 << API_OPENGL)
 #define API_OPENGLES_BIT (1 << API_OPENGLES)
 #define API_OPENGLES2_BIT (1 << API_OPENGLES2)
@@ -661,7 +669,8 @@ static const struct value_desc values[] = {
    { GL_STENCIL_BACK_PASS_DEPTH_PASS, CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA },
 
    { GL_MAX_VERTEX_ATTRIBS_ARB,
-     CONTEXT_INT(Const.VertexProgram.MaxAttribs), extra_ARB_vertex_program },
+     CONTEXT_INT(Const.VertexProgram.MaxAttribs),
+     extra_ARB_vertex_program_version_es2 },
 
    /* OES_texture_3D */
    { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA },
@@ -1678,6 +1687,12 @@ check_extra(GLcontext *ctx, const char *func, const struct value_desc *d)
            enabled++;
         }
         break;
+      case EXTRA_VERSION_ES2:
+        if (ctx->API == API_OPENGLES2) {
+           total++;
+           enabled++;
+        }
+        break;
       case EXTRA_NEW_BUFFERS:
         if (ctx->NewState & _NEW_BUFFERS)
            _mesa_update_state(ctx);