[Mesa-dev] [v2 32/39] i965: Prepare texture validator for isl based miptrees

Topi Pohjolainen topi.pohjolainen at gmail.com
Wed May 3 09:22:45 UTC 2017


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_tex_validate.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c b/src/mesa/drivers/dri/i965/intel_tex_validate.c
index 08cf3bf..d606922 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c
@@ -118,10 +118,14 @@ intel_finalize_mipmap_tree(struct brw_context *brw, GLuint unit)
    /* Check tree can hold all active levels.  Check tree matches
     * target, imageFormat, etc.
     */
+   const unsigned curr_first_level =
+      intelObj->mt->surf.size > 0 ? 0 : intelObj->mt->first_level;
+   const unsigned curr_last_level = intelObj->mt->surf.size > 0 ?
+      intelObj->mt->surf.levels - 1 : intelObj->mt->last_level;
    if (intelObj->mt &&
        (!intel_miptree_match_image(intelObj->mt, &firstImage->base.Base) ||
-	validate_first_level < intelObj->mt->first_level ||
-	validate_last_level > intelObj->mt->last_level)) {
+	validate_first_level < curr_first_level ||
+	validate_last_level > curr_last_level)) {
       intel_miptree_release(&intelObj->mt);
    }
 
-- 
2.9.3



More information about the mesa-dev mailing list