diff options
author | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-06-29 10:39:02 +0200 |
---|---|---|
committer | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-07-03 17:16:26 +0000 |
commit | c90cc8c900b81eb75ba443e2be7a01d4a946fe70 (patch) | |
tree | 8ceb291737505909c4a0c659acb64bd67c26b2fd | |
parent | be7b748b7e049a4e42611f3e5f920a568348ff15 (diff) |
Unity Build: Resolve a variable redefinition error
The `qvk_sampleCounts` variable is defined in `qrhivulkan.cpp` as well.
This causes an issue when building with unity build. To resolve the
problem, I renamed the variable in `qvulkanwindow.cpp`.
Fixes: QTBUG-114918
Pick-to: 6.5 6.6
Change-Id: I0b38c6b3e30792dd6f770d4dea8cb4c7789961d1
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/gui/vulkan/qvulkanwindow.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp index 5a86b43290..3efc37e7a6 100644 --- a/src/gui/vulkan/qvulkanwindow.cpp +++ b/src/gui/vulkan/qvulkanwindow.cpp @@ -448,7 +448,7 @@ void QVulkanWindow::setPreferredColorFormats(const QList<VkFormat> &formats) static struct { VkSampleCountFlagBits mask; int count; -} qvk_sampleCounts[] = { +} q_vk_sampleCounts[] = { // keep this sorted by 'count' { VK_SAMPLE_COUNT_1_BIT, 1 }, { VK_SAMPLE_COUNT_2_BIT, 2 }, @@ -488,7 +488,7 @@ QList<int> QVulkanWindow::supportedSampleCounts() VkSampleCountFlags depth = limits->framebufferDepthSampleCounts; VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts; - for (const auto &qvk_sampleCount : qvk_sampleCounts) { + for (const auto &qvk_sampleCount : q_vk_sampleCounts) { if ((color & qvk_sampleCount.mask) && (depth & qvk_sampleCount.mask) && (stencil & qvk_sampleCount.mask)) @@ -537,7 +537,7 @@ void QVulkanWindow::setSampleCount(int sampleCount) return; } - for (const auto &qvk_sampleCount : qvk_sampleCounts) { + for (const auto &qvk_sampleCount : q_vk_sampleCounts) { if (qvk_sampleCount.count == sampleCount) { d->sampleCount = qvk_sampleCount.mask; return; |