mesa: fix error checking for getting zero-sized texture images
Commit17f714836(mesa: rearrange texture error checking order) moved the width/height/depth == 0 allowance before checking if the image was there. This was in part due to depth having to be == 1 for 2D images and width having to be == 1 for 1D images. Instead relax the height/depth checks to also accept 0 as valid. With this change, bin/arb_direct_state_access-get-textures starts passing again. Fixes:17f714836(mesa: rearrange texture error checking order) Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -928,13 +928,6 @@ dimensions_error_check(struct gl_context *ctx,
|
||||
const struct gl_texture_image *texImage;
|
||||
int i;
|
||||
|
||||
if (width == 0 || height == 0 || depth == 0) {
|
||||
/* Not an error, but nothing to do. Return 'true' so that the
|
||||
* caller simply returns.
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
if (xoffset < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(xoffset = %d)", caller, xoffset);
|
||||
return true;
|
||||
@@ -973,7 +966,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;
|
||||
@@ -987,7 +980,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;
|
||||
@@ -1086,6 +1079,13 @@ dimensions_error_check(struct gl_context *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
if (width == 0 || height == 0 || depth == 0) {
|
||||
/* Not an error, but nothing to do. Return 'true' so that the
|
||||
* caller simply returns.
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user