diff options
author | Brian Paul <[email protected]> | 2012-06-05 16:32:23 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-06-06 07:55:59 -0600 |
commit | 8f5fffe75d2f8ae7c7ee706b53379a25bc673ae4 (patch) | |
tree | 03874713de5f5f611a8d6f7569b658a5ce3f9700 /src/mesa/state_tracker | |
parent | 3a62e8bcac75ca296619adb7fe4ea806a98beef9 (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/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b24f9a1ceff..3ab14a1bbd9 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -530,48 +530,17 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage, static void -st_TexImage3D(struct gl_context * ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack) +st_TexImage(struct gl_context * ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint internalFormat, + GLint width, GLint height, GLint depth, GLint border, + GLenum format, GLenum type, const void *pixels, + const struct gl_pixelstore_attrib *unpack) { prep_teximage(ctx, texImage, internalFormat, width, height, depth, border, format, type); - _mesa_store_teximage3d(ctx, texImage, internalFormat, width, height, depth, - border, format, type, pixels, unpack); -} - - -static void -st_TexImage2D(struct gl_context * ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack) -{ - prep_teximage(ctx, texImage, internalFormat, width, height, 1, border, - format, type); - _mesa_store_teximage2d(ctx, texImage, internalFormat, width, height, - border, format, type, pixels, unpack); -} - - -static void -st_TexImage1D(struct gl_context * ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack) -{ - prep_teximage(ctx, texImage, internalFormat, width, 1, 1, border, - format, type); - _mesa_store_teximage1d(ctx, texImage, internalFormat, width, - border, format, type, pixels, unpack); + _mesa_store_teximage(ctx, dims, texImage, internalFormat, width, height, depth, + border, format, type, pixels, unpack); } @@ -1427,9 +1396,7 @@ void st_init_texture_functions(struct dd_function_table *functions) { functions->ChooseTextureFormat = st_ChooseTextureFormat; - functions->TexImage1D = st_TexImage1D; - functions->TexImage2D = st_TexImage2D; - functions->TexImage3D = st_TexImage3D; + functions->TexImage = st_TexImage; functions->TexSubImage1D = _mesa_store_texsubimage1d; functions->TexSubImage2D = _mesa_store_texsubimage2d; functions->TexSubImage3D = _mesa_store_texsubimage3d; |