summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-03-24 02:58:54 +0100
committerMarek Olšák <[email protected]>2017-03-30 16:09:37 +0200
commita955ee788f2757c346fef5950cae8eefd311880f (patch)
treeda53380b645bcd3610717e32feac2717512de028 /src/gallium/drivers/radeonsi
parentf7bd51626eae4bf3ac3cc42a0ed5d31c0e660f6e (diff)
gallium/radeon: add and use a new helper vi_dcc_enabled
Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c6
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c5
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index cdc9cafa280..a94804d6c25 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -427,8 +427,7 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
/* disable levels without DCC */
for (int i = first_level; i <= last_level; i++) {
- if (!rtex->dcc_offset ||
- i >= rtex->surface.num_dcc_levels)
+ if (!vi_dcc_enabled(rtex, i))
level_mask &= ~(1 << i);
}
} else if (rtex->fmask.size) {
@@ -1039,8 +1038,7 @@ static bool do_hardware_msaa_resolve(struct pipe_context *ctx,
* it's being overwritten anyway, clear it to uncompressed.
* This is still the fastest codepath even with this clear.
*/
- if (dst->dcc_offset &&
- info->dst.level < dst->surface.num_dcc_levels) {
+ if (vi_dcc_enabled(dst, info->dst.level)) {
/* TODO: Implement per-level DCC clears for GFX9. */
if (sctx->b.chip_class >= GFX9 &&
info->dst.resource->last_level != 0)
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 5450dbe0dd8..f28202f20a8 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -404,7 +404,7 @@ void si_set_mutable_tex_desc_fields(struct si_screen *sscreen,
va += base_level_info->offset;
}
- if (tex->dcc_offset && first_level < tex->surface.num_dcc_levels) {
+ if (vi_dcc_enabled(tex, first_level)) {
meta_va = (!tex->dcc_separate_buffer ? tex->resource.gpu_address : 0) +
tex->dcc_offset;
@@ -750,8 +750,7 @@ static void si_set_shader_image(struct si_context *ctx,
struct r600_texture *tex = (struct r600_texture *)res;
unsigned level = view->u.tex.level;
unsigned width, height, depth;
- bool uses_dcc = tex->dcc_offset &&
- level < tex->surface.num_dcc_levels;
+ bool uses_dcc = vi_dcc_enabled(tex, level);
assert(!tex->is_depth);
assert(tex->fmask.size == 0);
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index d2a1f4bf85c..14138fbd982 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2638,7 +2638,7 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom
cb_color_fmask = (tex->resource.gpu_address + tex->fmask.offset) >> 8;
/* Set up DCC. */
- if (tex->dcc_offset && cb->base.u.tex.level < tex->surface.num_dcc_levels) {
+ if (vi_dcc_enabled(tex, cb->base.u.tex.level)) {
bool is_msaa_resolve_dst = state->cbufs[0] &&
state->cbufs[0]->texture->nr_samples > 1 &&
state->cbufs[1] == &cb->base &&