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 | e42d00b3f4503a0840575c8e5f4517a66c8af613 (patch) | |
tree | c8248d3f0b7bd95fec33d405ce25dc566df8c8b7 /src/mesa/drivers/common | |
parent | 8f5fffe75d2f8ae7c7ee706b53379a25bc673ae4 (diff) |
mesa: consolidate internal glTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r-- | src/mesa/drivers/common/driverfuncs.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/common/meta.c | 21 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 54e5221b28b..a9ccbd565da 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -92,9 +92,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* Texture functions */ driver->ChooseTextureFormat = _mesa_choose_tex_format; driver->TexImage = _mesa_store_teximage; - driver->TexSubImage1D = _mesa_store_texsubimage1d; - driver->TexSubImage2D = _mesa_store_texsubimage2d; - driver->TexSubImage3D = _mesa_store_texsubimage3d; + driver->TexSubImage = _mesa_store_texsubimage; driver->GetTexImage = _mesa_meta_GetTexImage; driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 7978b08cbfe..af21d3b0697 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3127,7 +3127,6 @@ copy_tex_sub_image(struct gl_context *ctx, GLsizei width, GLsizei height) { struct gl_texture_object *texObj = texImage->TexObject; - const GLenum target = texObj->Target; GLenum format, type; GLint bpp; void *buf; @@ -3181,21 +3180,11 @@ copy_tex_sub_image(struct gl_context *ctx, * Store texture data (with pixel transfer ops) */ _mesa_meta_begin(ctx, MESA_META_PIXEL_STORE); - if (target == GL_TEXTURE_1D) { - ctx->Driver.TexSubImage1D(ctx, texImage, - xoffset, width, - format, type, buf, &ctx->Unpack); - } - else if (target == GL_TEXTURE_3D) { - ctx->Driver.TexSubImage3D(ctx, texImage, - xoffset, yoffset, zoffset, width, height, 1, - format, type, buf, &ctx->Unpack); - } - else { - ctx->Driver.TexSubImage2D(ctx, texImage, - xoffset, yoffset, width, height, - format, type, buf, &ctx->Unpack); - } + + ctx->Driver.TexSubImage(ctx, dims, texImage, + xoffset, yoffset, zoffset, width, height, 1, + format, type, buf, &ctx->Unpack); + _mesa_meta_end(ctx); _mesa_lock_texture(ctx, texObj); /* re-lock */ |