This is effectively a revert of 8037c0b69 (i965: Always allocate
validated miptrees from level 0). Unfortunately the first level's images
may not be set, and there is no way to know what their size is. We were
retrieving the size of the base level's image, but using that to build a
miptree of that size for level 0.

This meant that intel_miptree_match_image would fail since the first_level
of the miptree was set to 0 but the local_width/height/depth0 were set
for the base level's dimensions.

This fixes a number of assertion failures in dEQP of the form

dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8.base_level.*

For some reason the plain 2D case didn't hit the assertions in question.

Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
Cc: Eric Anholt <e...@anholt.net>
---
 src/mesa/drivers/dri/i965/intel_tex_validate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c 
b/src/mesa/drivers/dri/i965/intel_tex_validate.c
index 2cf9c13..f2975c6 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c
@@ -140,7 +140,7 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint 
unit)
       intelObj->mt = intel_miptree_create(brw,
                                           intelObj->base.Target,
                                          firstImage->base.Base.TexFormat,
-                                          0, /* first_level */
+                                          validate_first_level,
                                           validate_last_level,
                                           width,
                                           height,
-- 
2.4.10

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

Reply via email to