diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2023-04-05 10:24:51 +0200 |
---|---|---|
committer | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2023-04-17 08:55:39 +0200 |
commit | fe387c97e11efff45eb21895199421ad2825e3e3 (patch) | |
tree | 806f0b5871ed0d4a4a38efeb59fa9bef426ed8b0 | |
parent | 46caf1d9410de4e79287cfab08d05d60d3b5568a (diff) | |
download | mesa-demos-fe387c97e11efff45eb21895199421ad2825e3e3.tar.gz |
vkgears: follow best-practices
While I'm not convinced this should have been considered a best practice
in the first place, the benefits from not having noise like this when
running with validation layers is enough to convince me that it's better
to do this than not to.
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
-rw-r--r-- | src/vulkan/vkgears.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vulkan/vkgears.c b/src/vulkan/vkgears.c index 55ca4d73..d598e12b 100644 --- a/src/vulkan/vkgears.c +++ b/src/vulkan/vkgears.c @@ -1478,6 +1478,7 @@ main(int argc, char *argv[]) if (!check_sample_count_support(sample_count)) error("Sample count not supported"); + int attachment_count = sample_count != VK_SAMPLE_COUNT_1_BIT ? 3 : 2; image_format = VK_FORMAT_B8G8R8A8_SRGB; if (printInfo) @@ -1574,7 +1575,7 @@ main(int argc, char *argv[]) .renderPass = render_pass, .framebuffer = swap_chain_data[index].framebuffer, .renderArea = { { 0, 0 }, { width, height } }, - .clearValueCount = 3, + .clearValueCount = attachment_count, .pClearValues = (VkClearValue []) { { .color = { .float32 = { 0.0f, 0.0f, 0.0f, 1.0f } } }, { .depthStencil.depth = 1.0f }, |