From e42d00b3f4503a0840575c8e5f4517a66c8af613 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 5 Jun 2012 16:32:23 -0600 Subject: mesa: consolidate internal glTexSubImage1/2/3D code Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/mesa/drivers/dri/intel') diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index eb8b9839a2b..ae4b3bca305 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -149,27 +149,29 @@ intel_blit_texsubimage(struct gl_context * ctx, } static void -intelTexSubImage2D(struct gl_context * ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing) +intelTexSubImage(struct gl_context * ctx, + GLuint dims, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing) { - if (!intel_blit_texsubimage(ctx, texImage, + /* The intel_blit_texsubimage() function only handles 2D images */ + if (dims != 2 || !intel_blit_texsubimage(ctx, texImage, xoffset, yoffset, width, height, format, type, pixels, packing)) { - _mesa_store_texsubimage2d(ctx, texImage, - xoffset, yoffset, - width, height, - format, type, pixels, packing); + _mesa_store_texsubimage(ctx, dims, texImage, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, packing); } } void intelInitTextureSubImageFuncs(struct dd_function_table *functions) { - functions->TexSubImage2D = intelTexSubImage2D; + functions->TexSubImage = intelTexSubImage; } -- cgit v1.2.3