summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-05-09 13:36:39 +0200
committerMarek Olšák <[email protected]>2016-06-01 17:35:30 +0200
commit9d881cc0ac8f08f839dd86f6aeaf6c7bca97ccb1 (patch)
treef6cc4b3e1a7735fabca4c4d0c352744ff81fbe36 /src/gallium/drivers/radeon
parentca135a26126edfbcbf19feb6cf6c00eaba3372b9 (diff)
gallium/util: add util_texrange_covers_whole_level from radeon
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index e2955aa8956..db63bebc676 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -38,17 +38,6 @@ static void r600_texture_discard_cmask(struct r600_common_screen *rscreen,
struct r600_texture *rtex);
-static bool range_covers_whole_texture(struct pipe_resource *tex,
- unsigned level, unsigned x, unsigned y,
- unsigned z, unsigned width,
- unsigned height, unsigned depth)
-{
- return x == 0 && y == 0 && z == 0 &&
- width == u_minify(tex->width0, level) &&
- height == u_minify(tex->height0, level) &&
- depth == util_max_layer(tex, level) + 1;
-}
-
bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
struct r600_texture *rdst,
unsigned dst_level, unsigned dstx,
@@ -87,9 +76,9 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
if (rdst->dcc_offset) {
/* We can't discard DCC if the texture has been exported. */
if (rdst->resource.is_shared ||
- !range_covers_whole_texture(&rdst->resource.b.b, dst_level,
- dstx, dsty, dstz, src_box->width,
- src_box->height, src_box->depth))
+ !util_texrange_covers_whole_level(&rdst->resource.b.b, dst_level,
+ dstx, dsty, dstz, src_box->width,
+ src_box->height, src_box->depth))
return false;
r600_texture_discard_dcc(rctx->screen, rdst);
@@ -101,9 +90,9 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
* SDMA. Otherwise, use the 3D path.
*/
if (rdst->cmask.size && rdst->dirty_level_mask & (1 << dst_level)) {
- if (!range_covers_whole_texture(&rdst->resource.b.b, dst_level,
- dstx, dsty, dstz, src_box->width,
- src_box->height, src_box->depth))
+ if (!util_texrange_covers_whole_level(&rdst->resource.b.b, dst_level,
+ dstx, dsty, dstz, src_box->width,
+ src_box->height, src_box->depth))
return false;
r600_texture_discard_cmask(rctx->screen, rdst);