summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-06-05 16:32:23 -0600
committerBrian Paul <[email protected]>2012-06-06 07:56:00 -0600
commitcd9ab2584f5e2a5eb0e96a948e6aedc9a33c886d (patch)
treee3614aaca8f5d746d932ca99544f8773b22dad13 /src/mesa/drivers/dri/intel
parente42d00b3f4503a0840575c8e5f4517a66c8af613 (diff)
mesa: consolidate internal glCopyTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c40
1 files changed, 11 insertions, 29 deletions
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;
}