diff options
author | Jason Ekstrand <[email protected]> | 2017-05-31 10:06:31 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-06-07 22:18:53 -0700 |
commit | 0607ca42da5fdb79b64445e34c642925e94354de (patch) | |
tree | 8c187dcda2f4c9eea0729ac08888a6417911f99c /src/mesa | |
parent | 3b65f9499c36d7b4ce7e4661299c23bc9d3816e6 (diff) |
i965: Be a bit more conservative about certain resolves
There are several places where we were resolving the entire miptree
when we really only needed to resolve a single slice. Let's avoid the
unneeded resolving.
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_pixel_read.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex_image.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex_subimage.c | 7 |
4 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c index 4522d28a4e1..f79863e3493 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c @@ -256,7 +256,8 @@ do_blit_bitmap( struct gl_context *ctx, /* The blitter has no idea about fast color clears, so we need to resolve * the miptree before we do anything. */ - intel_miptree_all_slices_resolve_color(brw, irb->mt, 0); + intel_miptree_resolve_color(brw, irb->mt, irb->mt_level, 1, + irb->mt_layer, 1, 0); /* Chop it all into chunks that can be digested by hardware: */ for (py = 0; py < height; py += DY) { diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c index 7074d7db9a2..7892b37a077 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c @@ -147,7 +147,8 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx, /* Since we are going to read raw data to the miptree, we need to resolve * any pending fast color clears before we start. */ - intel_miptree_all_slices_resolve_color(brw, irb->mt, 0); + intel_miptree_resolve_color(brw, irb->mt, irb->mt_level, 1, + irb->mt_layer, 1, 0); bo = irb->mt->bo; diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c index 77e09e83a58..8cd1eae296b 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_image.c +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c @@ -533,10 +533,13 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx, if (brw->gen < 5 && brw->has_swizzling) return false; + int level = texImage->Level + texImage->TexObject->MinLevel; + /* Since we are going to write raw data to the miptree, we need to resolve * any pending fast color clears before we start. */ - intel_miptree_all_slices_resolve_color(brw, image->mt, 0); + assert(image->mt->logical_depth0 == 1); + intel_miptree_resolve_color(brw, image->mt, level, 1, 0, 1, 0); bo = image->mt->bo; @@ -561,8 +564,6 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx, packing->Alignment, packing->RowLength, packing->SkipPixels, packing->SkipRows); - int level = texImage->Level + texImage->TexObject->MinLevel; - /* Adjust x and y offset based on miplevel */ xoffset += image->mt->level[level].level_x; yoffset += image->mt->level[level].level_y; diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c index e9c7b802b11..caa673001fd 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c @@ -145,10 +145,13 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx, if (brw->gen < 5 && brw->has_swizzling) return false; + int level = texImage->Level + texImage->TexObject->MinLevel; + /* Since we are going to write raw data to the miptree, we need to resolve * any pending fast color clears before we start. */ - intel_miptree_all_slices_resolve_color(brw, image->mt, 0); + assert(image->mt->logical_depth0 == 1); + intel_miptree_resolve_color(brw, image->mt, level, 1, 0, 1, 0); bo = image->mt->bo; @@ -177,8 +180,6 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx, packing->Alignment, packing->RowLength, packing->SkipPixels, packing->SkipRows, for_glTexImage); - int level = texImage->Level + texImage->TexObject->MinLevel; - /* Adjust x and y offset based on miplevel */ xoffset += image->mt->level[level].level_x; yoffset += image->mt->level[level].level_y; |