Discussion:
[PATCH 1/2] radv/gfx9: don't allocate cmask for single sampled surfaces.
(too old to reply)
Dave Airlie
2017-12-27 00:44:29 UTC
Permalink
From: Dave Airlie <***@redhat.com>

From AMDVLK fast clears don't work with cmask on gfx9, only with
dcc, so we don't need to allocate cmask for single sampled surfaces.

Signed-off-by: Dave Airlie <***@redhat.com>
---
src/amd/vulkan/radv_image.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index efd17e4889..612fb1d791 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -834,7 +834,7 @@ radv_image_can_enable_dcc(struct radv_image *image)
}

static inline bool
-radv_image_can_enable_cmask(struct radv_image *image)
+radv_image_can_enable_cmask(struct radv_image *image, bool is_gfx9)
{
if (image->surface.bpe > 8 && image->info.samples == 1) {
/* Do not enable CMASK for non-MSAA images (fast color clear)
@@ -844,6 +844,12 @@ radv_image_can_enable_cmask(struct radv_image *image)
return false;
}

+ if (is_gfx9 && image->info.samples == 1) {
+ /* amdvlk - GFX9 only supports fast color clears using DCC memory; having cMask does nothing for fast-clears.
+ - we just enable it for multisample cases then. */
+ return false;
+ }
+
return radv_image_can_enable_dcc_or_cmask(image) &&
image->info.levels == 1 &&
image->info.depth == 1 &&
@@ -926,7 +932,7 @@ radv_image_create(VkDevice _device,
} else {
/* When DCC cannot be enabled, try CMASK. */
image->surface.dcc_size = 0;
- if (radv_image_can_enable_cmask(image)) {
+ if (radv_image_can_enable_cmask(image, device->physical_device->rad_info.chip_class >= GFX9)) {
radv_image_alloc_cmask(device, image);
}
}
--
2.14.3
Dave Airlie
2017-12-27 00:44:30 UTC
Permalink
From: Dave Airlie <***@redhat.com>

AMDVLK says that these don't work, so disable them.

Signed-off-by: Dave Airlie <***@redhat.com>
---
src/gallium/drivers/radeonsi/si_clear.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c
index ba95ed51f1..2b2ac79908 100644
--- a/src/gallium/drivers/radeonsi/si_clear.c
+++ b/src/gallium/drivers/radeonsi/si_clear.c
@@ -480,7 +480,11 @@ static void si_do_fast_color_clear(struct si_context *sctx,
continue;
}

- /* RB+ doesn't work with CMASK fast clear on Stoney. */
+ /* amdvlk doesn't enable cmask fast clears on single sample */
+ if (sctx->b.chip_class >= GFX9 && tex->resource.b.b.nr_samples <= 1)
+ continue;
+
+ /* RB+ doesn't work with CMASK fast clear on Stoney */
if (sctx->b.family == CHIP_STONEY)
continue;
--
2.14.3
Marek Olšák
2017-12-27 21:19:21 UTC
Permalink
CMASK fast clears work on gfx9 just fine. I can't accept this patch.

Marek
Post by Dave Airlie
AMDVLK says that these don't work, so disable them.
---
src/gallium/drivers/radeonsi/si_clear.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c
index ba95ed51f1..2b2ac79908 100644
--- a/src/gallium/drivers/radeonsi/si_clear.c
+++ b/src/gallium/drivers/radeonsi/si_clear.c
@@ -480,7 +480,11 @@ static void si_do_fast_color_clear(struct si_context *sctx,
continue;
}
- /* RB+ doesn't work with CMASK fast clear on Stoney. */
+ /* amdvlk doesn't enable cmask fast clears on single sample */
+ if (sctx->b.chip_class >= GFX9 && tex->resource.b.b.nr_samples <= 1)
+ continue;
+
+ /* RB+ doesn't work with CMASK fast clear on Stoney */
if (sctx->b.family == CHIP_STONEY)
continue;
--
2.14.3
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Loading...