i965: don't crash on incorrect texture use

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4995

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11603>
(cherry picked from commit 02dd03ff3c)
This commit is contained in:
Timothy Arceri 2021-06-28 14:26:54 +10:00 committed by Eric Engestrom
parent eb597d2ce1
commit cbe376fa18
2 changed files with 3 additions and 1 deletions

View file

@ -499,7 +499,7 @@
"description": "i965: don't crash on incorrect texture use",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -104,6 +104,8 @@ brw_finalize_mipmap_tree(struct brw_context *brw,
assert(!tObj->Immutable || brw->screen->devinfo.ver < 6);
firstImage = brw_texture_image(tObj->Image[0][tObj->Attrib.BaseLevel]);
if (!firstImage)
return;
/* Check tree can hold all active levels. Check tree matches
* target, imageFormat, etc.