mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 27 Jul 2012 01:46:23 +0000 (18:46 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 23 Aug 2012 17:15:31 +0000 (10:15 -0700)
Also validate glCopyTexImage border.  This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/main/APIspec.xml
src/mesa/main/teximage.c

index 09ba424609b15a6bd59f184b81481518a090b28a..1c5be8c2ebad76a97538f16a2b1f499772c3ff36 100644 (file)
                </desc>
        </desc>
 
-       <desc name="border" error="GL_INVALID_VALUE">
-               <value name="0"/>
-       </desc>
-
        <desc name="format">
                <value name="GL_ALPHA"/>
 
                <value name="GL_LUMINANCE"/>
                <value name="GL_LUMINANCE_ALPHA"/>
        </desc>
-
-       <desc name="border" error="GL_INVALID_VALUE">
-               <value name="0"/>
-       </desc>
 </template>
 
 <template name="CopyTexSubImage2D">
index 879a24e88aa79a7d70b729acd059f9dc34ffcfe9..d9f0c7d84b5e3f3ba851a3deb421c45cdaa47292 100644 (file)
@@ -1605,7 +1605,8 @@ texture_error_check( struct gl_context *ctx,
 
    /* Check border */
    if (border < 0 || border > 1 ||
-       ((target == GL_TEXTURE_RECTANGLE_NV ||
+       ((ctx->API != API_OPENGL ||
+         target == GL_TEXTURE_RECTANGLE_NV ||
          target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
       if (!isProxy) {
          _mesa_error(ctx, GL_INVALID_VALUE,
@@ -2007,7 +2008,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
 
    /* Check border */
    if (border < 0 || border > 1 ||
-       ((target == GL_TEXTURE_RECTANGLE_NV ||
+       ((ctx->API != API_OPENGL ||
+         target == GL_TEXTURE_RECTANGLE_NV ||
          target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
       _mesa_error(ctx, GL_INVALID_VALUE,
                   "glCopyTexImage%dD(border=%d)", dimensions, border);