summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_texture.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-06-05 16:32:23 -0600
committerBrian Paul <[email protected]>2012-06-06 07:55:59 -0600
commit8f5fffe75d2f8ae7c7ee706b53379a25bc673ae4 (patch)
tree03874713de5f5f611a8d6f7569b658a5ce3f9700 /src/mesa/drivers/dri/radeon/radeon_texture.c
parent3a62e8bcac75ca296619adb7fe4ea806a98beef9 (diff)
mesa: consolidate internal glTexImage1/2/3D code
The functions for handling 1D, 2D and 3D texture images were nearly identical. This folds them all together. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_texture.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index ccb9956a8e6..8df5484f557 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -586,39 +586,14 @@ static void radeon_teximage(
const struct gl_pixelstore_attrib *packing,
int compressed)
{
- _mesa_store_teximage3d(ctx, texImage, internalFormat,
- width, height, depth, 0,
- format, type, pixels,
- packing);
+ _mesa_store_teximage(ctx, dims, texImage, internalFormat,
+ width, height, depth, 0,
+ format, type, pixels,
+ packing);
}
static void
-radeonTexImage1D(struct gl_context * ctx,
- struct gl_texture_image *texImage,
- GLint internalFormat,
- GLint width, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing)
-{
- radeon_teximage(ctx, 1, texImage, internalFormat, width, 1, 1,
- 0, format, type, pixels, packing, 0);
-}
-
-static void
-radeonTexImage2D(struct gl_context * ctx,
- struct gl_texture_image *texImage,
- GLint internalFormat,
- GLint width, GLint height, GLint border,
- GLenum format, GLenum type, const GLvoid * pixels,
- const struct gl_pixelstore_attrib *packing)
-
-{
- radeon_teximage(ctx, 2, texImage, internalFormat, width, height, 1,
- 0, format, type, pixels, packing, 0);
-}
-
-static void
-radeonTexImage3D(struct gl_context * ctx,
+radeonTexImage(struct gl_context * ctx, GLuint dims,
struct gl_texture_image *texImage,
GLint internalFormat,
GLint width, GLint height, GLint depth,
@@ -626,7 +601,7 @@ radeonTexImage3D(struct gl_context * ctx,
GLenum format, GLenum type, const GLvoid * pixels,
const struct gl_pixelstore_attrib *packing)
{
- radeon_teximage(ctx, 3, texImage, internalFormat, width, height, depth,
+ radeon_teximage(ctx, dims, texImage, internalFormat, width, height, depth,
0, format, type, pixels, packing, 0);
}
@@ -750,9 +725,7 @@ radeon_init_common_texture_funcs(radeonContextPtr radeon,
functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
- functions->TexImage1D = radeonTexImage1D;
- functions->TexImage2D = radeonTexImage2D;
- functions->TexImage3D = radeonTexImage3D;
+ functions->TexImage = radeonTexImage;
functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;