summaryrefslogtreecommitdiff
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-31 08:07:23 -0600
committerBrian Paul <brianp@vmware.com>2009-11-02 19:38:35 -0700
commitb8fdb900fb9b1c8b1e9ec88509624237307a869a (patch)
tree181c78e56fd326a4d8937f23e19304a94daccd11 /src/mesa/main/teximage.c
parent731810f8546174e45c717b0a9aa289a26593dfa0 (diff)
mesa: make _mesa_get_current_tex_objec() public
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 69ef2cca5e..b10076875b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -583,6 +583,17 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
/**
+ * Return pointer to texture object for given target on current texture unit.
+ */
+struct gl_texture_object *
+_mesa_get_current_tex_object(GLcontext *ctx, GLenum target)
+{
+ struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
+ return _mesa_select_tex_object(ctx, texUnit, target);
+}
+
+
+/**
* Get a texture image pointer from a texture object, given a texture
* target and mipmap level. The target and level parameters should
* have already been error-checked.
@@ -964,18 +975,6 @@ _mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage)
/**
- * Return pointer to texture object for given target on current texture unit.
- */
-static struct gl_texture_object *
-get_current_tex_object(GLcontext *ctx, GLenum target)
-{
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
- return _mesa_select_tex_object(ctx, texUnit, target);
-}
-
-
-
-/**
* This is the fallback for Driver.TestProxyTexImage(). Test the texture
* level, width, height and depth against the ctx->Const limits for textures.
*
@@ -2128,7 +2127,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
@@ -2249,7 +2248,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
@@ -2365,7 +2364,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
_mesa_update_state(ctx);
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
@@ -2457,7 +2456,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
{
GLsizei postConvWidth = width;
struct gl_texture_object *texObj;
- struct gl_texture_image *texImage = NULL;
+ struct gl_texture_image *texImage;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -2483,7 +2482,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
assert(texObj);
_mesa_lock_texture(ctx, texObj);
@@ -2549,7 +2548,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
return; /* error was detected */
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2607,7 +2606,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
return; /* error was detected */
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2674,7 +2673,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
postConvWidth, 1, border))
return;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2753,7 +2752,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
postConvWidth, postConvHeight, border))
return;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2825,7 +2824,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
if (copytexsubimage_error_check1(ctx, 1, target, level))
return;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2885,7 +2884,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
if (copytexsubimage_error_check1(ctx, 2, target, level))
return;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -2948,7 +2947,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
if (copytexsubimage_error_check1(ctx, 3, target, level))
return;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3282,7 +3281,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
return;
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3344,7 +3343,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3392,7 +3391,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
return;
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3456,7 +3455,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3500,7 +3499,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
return;
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3564,7 +3563,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{
@@ -3606,7 +3605,7 @@ compressed_tex_sub_image(GLuint dims, GLenum target, GLint level,
return;
}
- texObj = get_current_tex_object(ctx, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
{