From: Brian Paul Date: Sun, 14 Feb 2016 14:16:25 +0000 (-0700) Subject: mesa: move assertion in _mesa_cube_face_target() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=816c987b67e3c65e17687b84f4575aaf61e9580a;p=mesa.git mesa: move assertion in _mesa_cube_face_target() Fixes piglit arb_texture_view-sampling-2d-array-as-2d-layer regression. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94134 Reviewed-by: Jose Fonseca --- diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index a7e54f78cfe..17f2c908ecc 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -76,11 +76,13 @@ _mesa_num_tex_faces(GLenum target) static inline GLenum _mesa_cube_face_target(GLenum target, unsigned face) { - assert(face < 6); - if (target == GL_TEXTURE_CUBE_MAP) + if (target == GL_TEXTURE_CUBE_MAP) { + assert(face < 6); return GL_TEXTURE_CUBE_MAP_POSITIVE_X + face; - else + } + else { return target; + } }