mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES...
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 27 Jul 2012 14:22:41 +0000 (07:22 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Aug 2012 22:09:34 +0000 (15:09 -0700)
v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/APIspec.xml
src/mesa/main/fbobject.c

index 3121226ca35a9f6efd271292d37a42046e2805fb..9aa38187e598dd5e5d255875c1f5bf3cdaf87cd8 100644 (file)
                <param name="texture" type="GLuint"/>
                <param name="level" type="GLint"/>
        </proto>
-
-       <desc name="textarget" error="GL_INVALID_OPERATION">
-               <value name="GL_TEXTURE_2D"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" category="GLES2.0"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES" category="OES_texture_cube_map"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES" category="OES_texture_cube_map"/>
-               <value name="GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES" category="OES_texture_cube_map"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES" category="OES_texture_cube_map"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" category="OES_texture_cube_map"/>
-               <value name="GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" category="OES_texture_cube_map"/>
-       </desc>
        <!-- According to the base specification, "level" must be 0.  But
             extension GL_OES_fbo_render_mipmap lifts that restriction,
             so no restriction is placed here. -->
index 792a92da35c5c4d31fa0791caa810077286813a2..5fba3a16387ae23c649155e7147997f52af66873 100644 (file)
@@ -2137,7 +2137,8 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
          error = GL_FALSE;
          break;
       case GL_TEXTURE_RECTANGLE:
-         error = !ctx->Extensions.NV_texture_rectangle;
+         error = _mesa_is_gles(ctx)
+            || !ctx->Extensions.NV_texture_rectangle;
          break;
       case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
       case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
@@ -2148,7 +2149,8 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
          error = !ctx->Extensions.ARB_texture_cube_map;
          break;
       case GL_TEXTURE_2D_ARRAY:
-         error = !ctx->Extensions.EXT_texture_array;
+         error = (_mesa_is_gles(ctx) && ctx->Version < 30)
+            || !ctx->Extensions.EXT_texture_array;
          break;
       default:
          error = GL_TRUE;