diff options
author | Brian Paul <[email protected]> | 2011-07-29 17:14:34 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-09-27 12:12:07 -0700 |
commit | 8df7ca71125ee0ad74260378ff7e185dcf66f3bc (patch) | |
tree | 9c03dfa2eb16d6cf2e3319c726ad0fd4c6cde620 /src/mesa/drivers/dri | |
parent | 9f61e43b4903c6cf0ac03a479ec9ed7b15fd6ccf (diff) |
mesa: Convert GetCompressedTexImage to using MapTextureImage().
This changes drivers to not map the texture on their own before
calling _mesa_get_compressed_teximage().
Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 48 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_tex_getimage.c | 45 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.h | 4 |
4 files changed, 15 insertions, 83 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index ecccb47cee2..96717d31717 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -510,16 +510,11 @@ intelTexImage1D(struct gl_context * ctx, format, type, pixels, unpack, texObj, texImage, 0); } - -/** - * Need to map texture image into memory before copying image data, - * then unmap it. - */ static void -intel_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, GLboolean compressed) +intelGetTexImage(struct gl_context * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) { struct intel_context *intel = intel_context(ctx); struct intel_texture_image *intelImage = intel_texture_image(texImage); @@ -565,15 +560,8 @@ intel_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, intel_tex_image_s8z24_gather(intel, intelImage); } - if (compressed) { - _mesa_get_compressed_teximage(ctx, target, level, pixels, - texObj, texImage); - } - else { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); - } - + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); /* Unmap */ if (intelImage->mt) { @@ -582,28 +570,6 @@ intel_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, } } - -static void -intelGetTexImage(struct gl_context * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - intel_get_tex_image(ctx, target, level, format, type, pixels, - texObj, texImage, GL_FALSE); -} - - -static void -intelGetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level, - GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - intel_get_tex_image(ctx, target, level, 0, 0, pixels, - texObj, texImage, GL_TRUE); -} - /** * Binds a region to a texture image, like it was uploaded by glTexImage2D(). * @@ -722,8 +688,6 @@ intelInitTextureImageFuncs(struct dd_function_table *functions) functions->TexImage3D = intelTexImage3D; functions->GetTexImage = intelGetTexImage; - functions->GetCompressedTexImage = intelGetCompressedTexImage; - #if FEATURE_OES_EGL_image functions->EGLImageTargetTexture2D = intel_image_target_texture_2d; #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c index 6e9772e2f1a..a72c2da971f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c @@ -39,17 +39,17 @@ * Need to map texture image into memory before copying image data, * then unmap it. */ -static void -radeon_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, int compressed) +void +radeonGetTexImage(struct gl_context * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) { radeon_texture_image *image = get_radeon_texture_image(texImage); radeon_print(RADEON_TEXTURE, RADEON_NORMAL, - "%s(%p, tex %p, image %p) compressed %d.\n", - __func__, ctx, texObj, image, compressed); + "%s(%p, tex %p, image %p).\n", + __func__, ctx, texObj, image); if (image->mt) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); @@ -67,37 +67,10 @@ radeon_get_tex_image(struct gl_context * ctx, GLenum target, GLint level, assert(image->base.Base.Data); } - if (compressed) { - /* FIXME: this can't work for small textures (mips) which - use different hw stride */ - _mesa_get_compressed_teximage(ctx, target, level, pixels, - texObj, texImage); - } else { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); - } + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); if (image->mt) { radeon_teximage_unmap(image); } } - -void -radeonGetTexImage(struct gl_context * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - radeon_get_tex_image(ctx, target, level, format, type, pixels, - texObj, texImage, 0); -} - -void -radeonGetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level, - GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - radeon_get_tex_image(ctx, target, level, 0, 0, pixels, - texObj, texImage, 1); -} diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index bb276299497..d7636ca7289 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -1191,7 +1191,6 @@ radeon_init_common_texture_funcs(radeonContextPtr radeon, functions->TexSubImage3D = radeonTexSubImage3D; functions->CompressedTexImage2D = radeonCompressedTexImage2D; functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D; - functions->GetCompressedTexImage = radeonGetCompressedTexImage; functions->GetTexImage = radeonGetTexImage; functions->GenerateMipmap = radeonGenerateMipmap; diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index c02aa30c789..3d096b1b1e4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -121,10 +121,6 @@ void radeonGetTexImage(struct gl_context * ctx, GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels, struct gl_texture_object *texObj, struct gl_texture_image *texImage); -void radeonGetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level, - GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); void radeonCopyTexSubImage2D(struct gl_context *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, |