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

Author: Juan A. Suarez Romero <jasua...@igalia.com>
Date:   Thu Apr  5 08:48:26 2018 +0000

gettextsubimage: verify zoffset and depth are correct

According to OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries"),
relative to errors for GetTextureSubImage() function:

  "An INVALID_VALUE error is generated if the effective target is
   TEXTURE_1D and either yoffset is not zero, or height is not one.

   An INVALID_VALUE error is generated if the effective target is
   TEXTURE_1D, TEXTURE_1D_ARRAY, TEXTURE_2D or TEXTURE_RECTANGLE, and
   either zoffset is not zero, or depth is not one."

The commit fixes the check for height and depth.

This fixes arb_get_texture_sub_image piglit tests.

Signed-off-by: Juan A. Suarez Romero <jasua...@igalia.com>
Reviewed-by: Iago Toral Quiroga <ito...@igalia.com>

---

 src/mesa/main/texgetimage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index c61842e39a..fbdbcd90a7 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -953,7 +953,7 @@ dimensions_error_check(struct gl_context *ctx,
                      "%s(1D, yoffset = %d)", caller, yoffset);
          return true;
       }
-      if (height > 1) {
+      if (height != 1) {
          _mesa_error(ctx, GL_INVALID_VALUE,
                      "%s(1D, height = %d)", caller, height);
          return true;
@@ -967,7 +967,7 @@ dimensions_error_check(struct gl_context *ctx,
                      "%s(zoffset = %d)", caller, zoffset);
          return true;
       }
-      if (depth > 1) {
+      if (depth != 1) {
          _mesa_error(ctx, GL_INVALID_VALUE,
                      "%s(depth = %d)", caller, depth);
          return true;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to