summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-04-17 16:05:15 +0200
committerSamuel Pitoiset <[email protected]>2018-04-19 09:10:48 +0200
commit373fa0b599ca3b2904433e413fd6e24fc37292b7 (patch)
tree0040673d26d849172647de085b05757257e49e4a /src/amd
parent255506c4e04bfa5490d98a748aa248189a213ad6 (diff)
radv: allocate CMASK for DCC fast clear with MSAA
CMASK is required because it should be cleared to 0xCCCCCCCC for MSAA textures. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_image.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index a14e7c18b29..ba8f14d91bd 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -997,6 +997,13 @@ radv_image_create(VkDevice _device,
/* Try to enable DCC first. */
if (radv_image_can_enable_dcc(image)) {
radv_image_alloc_dcc(image);
+ if (image->info.samples > 1) {
+ /* CMASK should be enabled because DCC fast
+ * clear with MSAA needs it.
+ */
+ assert(radv_image_can_enable_cmask(image));
+ radv_image_alloc_cmask(device, image);
+ }
} else {
/* When DCC cannot be enabled, try CMASK. */
image->surface.dcc_size = 0;