summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-27 23:48:44 +0200
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit272b50a6f43adc6aa49da778119af9b219c170ae (patch)
treec86618b3c1aa015f95ff378321d62e5bd2a2fae5 /src/gallium/drivers/radeon/r600_texture.c
parentaba8e0ea68c18804b448b0ba19b5d8e0f877205f (diff)
radeonsi/gfx9: do DCC clears on non-mipmapped textures only
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_texture.c')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 1838de4f4d4..5b1f941521b 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -2417,7 +2417,7 @@ void vi_dcc_clear_level(struct r600_common_context *rctx,
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);
@@ -2429,10 +2429,18 @@ void vi_dcc_clear_level(struct r600_common_context *rctx,
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);
}