diff options
author | Eric Anholt <[email protected]> | 2011-09-21 15:56:04 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-09-26 15:33:42 -0700 |
commit | 2ef77d1c74be936f7597d4f289c732c0db9e8687 (patch) | |
tree | 731492c94d68a26937bea249e011ca9e37eb09a2 /src/mesa/drivers/dri/intel | |
parent | d6b5e32f5f3ee7dcdfb525f378344c7a9be78a5f (diff) |
intel: Rely on AllocTextureImageBuffer for our teximage fallbacks.
It will do a more reliable job at getting the image size for
_mesa_texstore right than us.
Acked-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 06e58e496c2..be328d1aa30 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -352,7 +352,7 @@ intelTexImage(struct gl_context * ctx, struct intel_context *intel = intel_context(ctx); struct intel_texture_object *intelObj = intel_texture_object(texObj); struct intel_texture_image *intelImage = intel_texture_image(texImage); - GLint texelBytes, sizeInBytes; + GLint texelBytes; GLuint dstRowStride = 0; DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__, @@ -389,6 +389,10 @@ intelTexImage(struct gl_context * ctx, * before, and any lower levels would fit into our miptree. */ intel_miptree_reference(&intelObj->mt, intelImage->mt); + } else { + /* Allocate fallback texImage->Data storage through swrast. */ + ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat, + width, height, depth); } /* Attempt to use the blitter for PBO image uploads. @@ -424,24 +428,6 @@ intelTexImage(struct gl_context * ctx, texImage->RowStride = dstRowStride / intelImage->mt->cpp; } - else { - /* Allocate regular memory and store the image there temporarily. */ - if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - texImage->Height, - texImage->Depth); - dstRowStride = - _mesa_format_row_stride(texImage->TexFormat, width); - assert(dims != 3); - } - else { - dstRowStride = width * texelBytes; - sizeInBytes = depth * dstRowStride * height; - } - - texImage->Data = _mesa_alloc_texmemory(sizeInBytes); - } DBG("Upload image %dx%dx%d row_len %d pitch %d pixels %d\n", width, height, depth, width * texelBytes, dstRowStride, |