unsigned level, unsigned clear_value)
{
struct pipe_resource *dcc_buffer;
- uint64_t dcc_offset;
+ uint64_t dcc_offset, clear_size;
assert(rtex->dcc_offset && level < rtex->surface.num_dcc_levels);
dcc_offset = rtex->dcc_offset;
}
- dcc_offset += rtex->surface.u.legacy.level[level].dcc_offset;
+ if (rctx->chip_class >= GFX9) {
+ /* Mipmap level clears aren't implemented. */
+ assert(rtex->resource.b.b.last_level == 0);
+ /* MSAA needs a different clear size. */
+ assert(rtex->resource.b.b.nr_samples <= 1);
+ clear_size = rtex->surface.dcc_size;
+ } else {
+ dcc_offset += rtex->surface.u.legacy.level[level].dcc_offset;
+ clear_size = rtex->surface.u.legacy.level[level].dcc_fast_clear_size;
+ }
- rctx->clear_buffer(&rctx->b, dcc_buffer, dcc_offset,
- rtex->surface.u.legacy.level[level].dcc_fast_clear_size,
+ rctx->clear_buffer(&rctx->b, dcc_buffer, dcc_offset, clear_size,
clear_value, R600_COHERENCY_CB_META);
}
*/
if (dst->dcc_offset &&
info->dst.level < dst->surface.num_dcc_levels) {
+ /* TODO: Implement per-level DCC clears for GFX9. */
+ if (sctx->b.chip_class >= GFX9 &&
+ info->dst.resource->last_level != 0)
+ goto resolve_to_temp;
+
vi_dcc_clear_level(&sctx->b, dst, info->dst.level,
0xFFFFFFFF);
dst->dirty_level_mask &= ~(1 << info->dst.level);