From cd9ab2584f5e2a5eb0e96a948e6aedc9a33c886d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 5 Jun 2012 16:32:23 -0600 Subject: mesa: consolidate internal glCopyTexSubImage1/2/3D code Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 40 ++++++++--------------------- 1 file changed, 11 insertions(+), 29 deletions(-) (limited to 'src/mesa/drivers/dri/intel') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 8617302856d..0798cec8f3c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -144,38 +144,21 @@ intel_copy_texsubimage(struct intel_context *intel, static void -intelCopyTexSubImage1D(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, - struct gl_renderbuffer *rb, - GLint x, GLint y, GLsizei width) +intelCopyTexSubImage(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, GLint zoffset, + struct gl_renderbuffer *rb, + GLint x, GLint y, + GLsizei width, GLsizei height) { - if (!intel_copy_texsubimage(intel_context(ctx), - intel_texture_image(texImage), - xoffset, 0, - intel_renderbuffer(rb), x, y, width, 1)) { - fallback_debug("%s - fallback to swrast\n", __FUNCTION__); - _mesa_meta_CopyTexSubImage1D(ctx, texImage, xoffset, - rb, x, y, width); - } -} - - -static void -intelCopyTexSubImage2D(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, - struct gl_renderbuffer *rb, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - if (!intel_copy_texsubimage(intel_context(ctx), + if (dims == 3 || !intel_copy_texsubimage(intel_context(ctx), intel_texture_image(texImage), xoffset, yoffset, intel_renderbuffer(rb), x, y, width, height)) { fallback_debug("%s - fallback to swrast\n", __FUNCTION__); - _mesa_meta_CopyTexSubImage2D(ctx, texImage, - xoffset, yoffset, - rb, x, y, width, height); + _mesa_meta_CopyTexSubImage(ctx, dims, texImage, + xoffset, yoffset, zoffset, + rb, x, y, width, height); } } @@ -183,6 +166,5 @@ intelCopyTexSubImage2D(struct gl_context *ctx, void intelInitTextureCopyImageFuncs(struct dd_function_table *functions) { - functions->CopyTexSubImage1D = intelCopyTexSubImage1D; - functions->CopyTexSubImage2D = intelCopyTexSubImage2D; + functions->CopyTexSubImage = intelCopyTexSubImage; } -- cgit v1.2.3