[Mesa-dev] [PATCH 01/35] mesa: Make target_enum_to_index available outside texobj.c

Brian Paul brian.e.paul at gmail.com
Wed Jan 29 16:53:24 PST 2014


On Wed, Jan 29, 2014 at 2:52 PM, Ian Romanick <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> The next patch will use this function in another file.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/main/texobj.c | 6 +++---
>  src/mesa/main/texobj.h | 3 +++
>  2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 24ffc89..f6fe09d 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -1198,8 +1198,8 @@ _mesa_DeleteTextures( GLsizei n, const GLuint
> *textures)
>   * Note that proxy targets are not valid here.
>   * \return TEXTURE_x_INDEX or -1 if target is invalid
>   */
> -static GLint
> -target_enum_to_index(const struct gl_context *ctx, GLenum target)
> +int
> +_mesa_target_enum_to_index(const struct gl_context *ctx, GLenum target)
>  {
>     switch (target) {
>     case GL_TEXTURE_1D:
> @@ -1270,7 +1270,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
>        _mesa_debug(ctx, "glBindTexture %s %d\n",
>                    _mesa_lookup_enum_by_nr(target), (GLint) texName);
>
> -   targetIndex = target_enum_to_index(ctx, target);
> +   targetIndex = _mesa_target_enum_to_index(ctx, target);
>     if (targetIndex < 0) {
>        _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
>        return;
> diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
> index 55091a6..525585a 100644
> --- a/src/mesa/main/texobj.h
> +++ b/src/mesa/main/texobj.h
> @@ -54,6 +54,9 @@ _mesa_initialize_texture_object( struct gl_context *ctx,
>                                   struct gl_texture_object *obj,
>                                   GLuint name, GLenum target );
>
> +extern int
> +_mesa_target_enum_to_index(const struct gl_context *ctx, GLenum target);
> +
>  extern void
>  _mesa_delete_texture_object( struct gl_context *ctx,
>                               struct gl_texture_object *obj );
>
>
Calling it _mesa_tex_target_to_index() might be better. 'target' is an
overloaded term in GL.

-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140129/f1970e74/attachment.html>


More information about the mesa-dev mailing list