aboutsummaryrefslogtreecommitdiffstats
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:55:59 -0600
commit8f5fffe75d2f8ae7c7ee706b53379a25bc673ae4 (patch)
tree03874713de5f5f611a8d6f7569b658a5ce3f9700 /src/mesa/drivers/dri/intel
parent3a62e8bcac75ca296619adb7fe4ea806a98beef9 (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/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c60
1 files changed, 7 insertions, 53 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index abd75c51d29..6e7e7018182 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -203,13 +203,12 @@ try_pbo_upload(struct gl_context *ctx,
static void
intelTexImage(struct gl_context * ctx,
- GLint dims,
+ GLuint dims,
struct gl_texture_image *texImage,
GLint internalFormat,
- GLint width, GLint height, GLint depth,
+ GLint width, GLint height, GLint depth, GLint border,
GLenum format, GLenum type, const void *pixels,
- const struct gl_pixelstore_attrib *unpack,
- GLsizei imageSize)
+ const struct gl_pixelstore_attrib *unpack)
{
DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(texImage->TexObject->Target),
@@ -226,52 +225,9 @@ intelTexImage(struct gl_context * ctx,
DBG("%s: upload image %dx%dx%d pixels %p\n",
__FUNCTION__, width, height, depth, pixels);
- _mesa_store_teximage3d(ctx, texImage, internalFormat,
- width, height, depth, 0,
- format, type, pixels, unpack);
-}
-
-
-static void
-intelTexImage3D(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)
-{
- intelTexImage(ctx, 3, texImage,
- internalFormat, width, height, depth,
- format, type, pixels, unpack, 0);
-}
-
-
-static void
-intelTexImage2D(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)
-{
- intelTexImage(ctx, 2, texImage,
- internalFormat, width, height, 1,
- format, type, pixels, unpack, 0);
-}
-
-
-static void
-intelTexImage1D(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)
-{
- intelTexImage(ctx, 1, texImage,
- internalFormat, width, 1, 1,
- format, type, pixels, unpack, 0);
+ _mesa_store_teximage(ctx, dims, texImage, internalFormat,
+ width, height, depth, 0,
+ format, type, pixels, unpack);
}
@@ -398,9 +354,7 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
void
intelInitTextureImageFuncs(struct dd_function_table *functions)
{
- functions->TexImage1D = intelTexImage1D;
- functions->TexImage2D = intelTexImage2D;
- functions->TexImage3D = intelTexImage3D;
+ functions->TexImage = intelTexImage;
#if FEATURE_OES_EGL_image
functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;