Commit 2208d79d authored by Lionel Landwerlin's avatar Lionel Landwerlin

mesa: don't forget to clear _Layer field on texture unit

On the Android Antutu benchmark we ran into an assert in ISL where the
(base layer + num layers) > total layers. It turns out the core of
mesa forgot to clear the _Layer variable, potentially leaving an
inconsistent value.

v2: Pull setting u->_Layer out of the conditional blocks (Jason)
Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <>
Cc: <>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <>
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <>
parent 563f8974
Pipeline #67785 passed with stages
in 20 minutes and 50 seconds
......@@ -593,11 +593,11 @@ set_image_binding(struct gl_image_unit *u, struct gl_texture_object *texObj,
if (texObj && _mesa_tex_target_is_layered(texObj->Target)) {
u->Layered = layered;
u->Layer = layer;
u->_Layer = (u->Layered ? 0 : u->Layer);
} else {
u->Layered = GL_FALSE;
u->Layer = 0;
u->_Layer = (u->Layered ? 0 : u->Layer);
_mesa_reference_texobj(&u->TexObj, texObj);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment