Mesa (master): mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper

Ian Romanick idr at kemper.freedesktop.org
Thu Aug 23 17:20:51 UTC 2012


Module: Mesa
Branch: master
Commit: 0686ccac950bac1a650400b29c47ddaafea22fa9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0686ccac950bac1a650400b29c47ddaafea22fa9

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu Jul 26 18:46:23 2012 -0700

mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper

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 at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

---

 src/mesa/main/APIspec.xml |    8 --------
 src/mesa/main/teximage.c  |    6 ++++--
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
index 09ba424..1c5be8c 100644
--- a/src/mesa/main/APIspec.xml
+++ b/src/mesa/main/APIspec.xml
@@ -306,10 +306,6 @@
 		</desc>
 	</desc>
 
-	<desc name="border" error="GL_INVALID_VALUE">
-		<value name="0"/>
-	</desc>
-
 	<desc name="format">
 		<value name="GL_ALPHA"/>
 
@@ -1572,10 +1568,6 @@
 		<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">
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 879a24e..d9f0c7d 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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);




More information about the mesa-commit mailing list