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 <jfonseca@vmware.com>
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;
+ }
}