}
}
+static inline bool
+util_texrange_covers_whole_level(const 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;
+}
+
#ifdef __cplusplus
}
#endif
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,
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);
* 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);