[Mesa-dev] [PATCH 2/5] mesa: make _mesa_tex_target_to_face() an inline function
Timothy Arceri
t_arceri at yahoo.com.au
Fri Feb 12 21:52:25 UTC 2016
On Thu, 2016-02-11 at 08:35 -0700, Brian Paul wrote:
> ---
> src/mesa/main/teximage.c | 14 --------------
> src/mesa/main/teximage.h | 15 +++++++++++++++
> 2 files changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 68a9752..57765d7 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -116,20 +116,6 @@ adjust_for_oes_float_texture(GLenum format,
> GLenum type)
> return format;
> }
>
> -/**
> - * For cube map faces, return a face index in [0,5].
> - * For other targets return 0;
> - */
> -GLuint
> -_mesa_tex_target_to_face(GLenum target)
> -{
> - if (_mesa_is_cube_face(target))
> - return (GLuint) target - (GLuint)
> GL_TEXTURE_CUBE_MAP_POSITIVE_X;
> - else
> - return 0;
> -}
> -
> -
Series Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com> if
you also remove the:
extern GLuint
_mesa_tex_target_to_face(GLenum target);
>
> /**
> * Install gl_texture_image in a gl_texture_object according to the
> target
> diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
> index fe5b485..39ff8ea 100644
> --- a/src/mesa/main/teximage.h
> +++ b/src/mesa/main/teximage.h
> @@ -47,6 +47,21 @@ _mesa_is_cube_face(GLenum target)
> target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);
> }
>
> +
> +/**
> + * For cube map faces, return a face index in [0,5].
> + * For other targets return 0;
> + */
> +static inline GLuint
> +_mesa_tex_target_to_face(GLenum target)
> +{
> + if (_mesa_is_cube_face(target))
> + return (GLuint) target - (GLuint)
> GL_TEXTURE_CUBE_MAP_POSITIVE_X;
> + else
> + return 0;
> +}
> +
> +
> /** Are any of the dimensions of given texture equal to zero? */
> static inline GLboolean
> _mesa_is_zero_size_texture(const struct gl_texture_image *texImage)
More information about the mesa-dev
mailing list