[Mesa-dev] [PATCH] mesa: move assertion in _mesa_cube_face_target()

Roland Scheidegger sroland at vmware.com
Sun Feb 14 16:22:57 UTC 2016


Am 14.02.2016 um 15:18 schrieb Brian Paul:
> Fixes piglit arb_texture_view-sampling-2d-array-as-2d-layer regression.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94134
> ---
>  src/mesa/main/teximage.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
> index a7e54f7..17f2c90 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;
> +   }
>  }
>  
>  
> 

Reviewed-by: Roland Scheidegger <sroland at vmware.com>


More information about the mesa-dev mailing list