aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <[email protected]>2013-12-13 12:12:53 -0700
committerChad Versace <[email protected]>2013-12-30 14:57:49 -0800
commit5a51c1b01a16d3256f9769a76d8293fea5853b1f (patch)
tree7e42b4cedcddcc197acb6d6c8f1d6f789ad19744
parent85784fd832f34c9a8ab48a162dc82eb50f9c6d12 (diff)
i965: Enhance intel_texsubimage_tiled_memcpy() to support all levels
Support all levels of a supported texture format. Using 1024x1024, RGBA 8888 source, mipmap internal-format Before (MB/sec) mipmap (MB/sec) GL_RGBA 627.15 615.90 GL_RGB 456.35 611.53 512x512 GL_RGBA 597.00 619.95 GL_RGB 440.62 611.28 256x256 GL_RGBA 487.80 587.42 GL_RGB 376.63 585.00 Benchmark has been sent to mesa-dev list: teximage_enh Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Chad Versace <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_subimage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index f7adfef1a86..202ab6676cd 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -549,7 +549,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
uint32_t cpp;
mem_copy_fn mem_copy = NULL;
- /* This fastpath is restricted to specific texture types: level 0 of
+ /* This fastpath is restricted to specific texture types:
* a 2D BGRA, RGBA, L8 or A8 texture. It could be generalized to support
* more types.
*
@@ -561,7 +561,6 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
if (!brw->has_llc ||
type != GL_UNSIGNED_BYTE ||
texImage->TexObject->Target != GL_TEXTURE_2D ||
- texImage->Level != 0 ||
pixels == NULL ||
_mesa_is_bufferobj(packing->BufferObj) ||
packing->Alignment > 4 ||
@@ -637,6 +636,10 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
packing->Alignment, packing->RowLength, packing->SkipPixels,
packing->SkipRows, for_glTexImage);
+ /* Adjust x and y offset based on miplevel */
+ xoffset += image->mt->level[texImage->Level].level_x;
+ yoffset += image->mt->level[texImage->Level].level_y;
+
linear_to_tiled(
xoffset * cpp, (xoffset + width) * cpp,
yoffset, yoffset + height,