Mesa (master): mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.

Brian Paul brianp at kemper.freedesktop.org
Tue Apr 1 14:43:12 UTC 2014


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Mon Mar 31 02:04:00 2014 -0600

mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.

Currently, we raise an error when doing this which breaks a conformance
test from the OpenGL samples pack. Even if this is a bit silly it is not
an error.

>From http://www.opengl.org/wiki/Rectangle_Texture:

"Rectangle textures contain exactly one image; they cannot have mipmaps.
Therefore, any texture parameters that depend on LODs are irrelevant
when used with rectangle textures; attempting to set these parameters to
any value other than 0 will result in an error."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76496

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/texparam.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index bfb2e1b..40790ff 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -352,7 +352,8 @@ set_tex_parameteri(struct gl_context *ctx,
       if (texObj->MaxLevel == params[0])
          return GL_FALSE;
 
-      if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
+      if (params[0] < 0 ||
+          (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] > 0)) {
          _mesa_error(ctx, GL_INVALID_VALUE,
                      "glTexParameter(param=%d)", params[0]);
          return GL_FALSE;




More information about the mesa-commit mailing list