assert(sctx->chip_class == GFX8);
custom_blend = sctx->custom_blend_dcc_decompress;
- assert(tex->surface.dcc_offset);
+ assert(vi_dcc_enabled(tex, first_level));
/* disable levels without DCC */
for (int i = first_level; i <= last_level; i++) {
bool need_fmask_expand)
{
/* CMASK or DCC can be discarded and we can still end up here. */
- if (!tex->cmask_buffer && !tex->surface.fmask_size && !tex->surface.dcc_offset)
+ if (!tex->cmask_buffer && !tex->surface.fmask_size &&
+ !vi_dcc_enabled(tex, first_level))
return;
si_blit_decompress_color(sctx, tex, first_level, last_level, 0,
{
bool render_feedback = false;
- if (!tex->surface.dcc_offset)
+ if (!vi_dcc_enabled(tex, first_level))
return;
for (unsigned j = 0; j < sctx->framebuffer.state.nr_cbufs; ++j) {
si_update_fb_dirtiness_after_rendering(sctx);
si_decompress_depth(sctx, stex, planes, level, level, first_layer, last_layer);
- } else if (stex->surface.fmask_size || stex->cmask_buffer || stex->surface.dcc_offset) {
+ } else if (stex->surface.fmask_size || stex->cmask_buffer ||
+ vi_dcc_enabled(stex, level)) {
/* If we've rendered into the framebuffer and it's a blitting
* source, make sure the decompression pass is invoked
* by dirtying the framebuffer.
if (!util_format_is_compressed(src->format) && !util_format_is_compressed(dst->format) &&
!util_format_is_depth_or_stencil(src->format) && src->nr_samples <= 1 &&
- !sdst->surface.dcc_offset &&
+ !vi_dcc_enabled(sdst, dst_level) &&
!(dst->target != src->target &&
(src->target == PIPE_TEXTURE_1D_ARRAY || dst->target == PIPE_TEXTURE_1D_ARRAY))) {
si_compute_copy_image(sctx, dst, dst_level, src, src_level, dstx, dsty, dstz,
if (tex->dcc_separate_buffer && !tex->separate_dcc_dirty)
return;
- if (!tex->is_depth && (tex->cmask_buffer || tex->surface.dcc_offset)) {
+ if (!tex->is_depth && (tex->cmask_buffer || vi_dcc_enabled(tex, 0))) {
si_blit_decompress_color(sctx, tex, 0, res->last_level, 0, util_max_layer(res, 0),
tex->dcc_separate_buffer != NULL, false);
samplers->needs_color_decompress_mask &= ~(1u << slot);
}
- if (tex->surface.dcc_offset && p_atomic_read(&tex->framebuffers_bound))
+ if (vi_dcc_enabled(tex, view->u.tex.first_level) &&
+ p_atomic_read(&tex->framebuffers_bound))
sctx->need_check_render_feedback = true;
}
struct si_texture_handle *, tex_handle);
}
- if (tex->surface.dcc_offset && p_atomic_read(&tex->framebuffers_bound))
+ if (vi_dcc_enabled(tex, sview->base.u.tex.first_level) &&
+ p_atomic_read(&tex->framebuffers_bound))
sctx->need_check_render_feedback = true;
si_update_bindless_texture_descriptor(sctx, tex_handle);
state[6] = 0;
state[7] = 0;
- if (tex->surface.dcc_offset) {
+ if (vi_dcc_enabled(tex, first_level)) {
state[6] |= S_00A018_MAX_UNCOMPRESSED_BLOCK_SIZE(V_028C78_MAX_BLOCK_SIZE_256B) |
S_00A018_MAX_COMPRESSED_BLOCK_SIZE(tex->surface.u.gfx9.dcc.max_compressed_block_size) |
S_00A018_ALPHA_IS_ON_MSB(vi_alpha_is_on_msb(screen, pipe_format));
state[5] |= S_008F24_LAST_ARRAY(last_layer);
}
- if (tex->surface.dcc_offset) {
+ if (vi_dcc_enabled(tex, first_level)) {
state[6] = S_008F28_ALPHA_IS_ON_MSB(vi_alpha_is_on_msb(screen, pipe_format));
} else {
/* The last dword is unused by hw. The shader uses it to clear