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 Change-Id: I0b38c6b3e30792dd6f770d4dea8cb4c7789961d1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit c90cc8c900b81eb75ba443e2be7a01d4a946fe70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
95fa5e33d0
commit
5cf68eb150
@ -448,7 +448,7 @@ void QVulkanWindow::setPreferredColorFormats(const QList<VkFormat> &formats)
|
|||||||
static struct {
|
static struct {
|
||||||
VkSampleCountFlagBits mask;
|
VkSampleCountFlagBits mask;
|
||||||
int count;
|
int count;
|
||||||
} qvk_sampleCounts[] = {
|
} q_vk_sampleCounts[] = {
|
||||||
// keep this sorted by 'count'
|
// keep this sorted by 'count'
|
||||||
{ VK_SAMPLE_COUNT_1_BIT, 1 },
|
{ VK_SAMPLE_COUNT_1_BIT, 1 },
|
||||||
{ VK_SAMPLE_COUNT_2_BIT, 2 },
|
{ VK_SAMPLE_COUNT_2_BIT, 2 },
|
||||||
@ -488,7 +488,7 @@ QList<int> QVulkanWindow::supportedSampleCounts()
|
|||||||
VkSampleCountFlags depth = limits->framebufferDepthSampleCounts;
|
VkSampleCountFlags depth = limits->framebufferDepthSampleCounts;
|
||||||
VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts;
|
VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts;
|
||||||
|
|
||||||
for (const auto &qvk_sampleCount : qvk_sampleCounts) {
|
for (const auto &qvk_sampleCount : q_vk_sampleCounts) {
|
||||||
if ((color & qvk_sampleCount.mask)
|
if ((color & qvk_sampleCount.mask)
|
||||||
&& (depth & qvk_sampleCount.mask)
|
&& (depth & qvk_sampleCount.mask)
|
||||||
&& (stencil & qvk_sampleCount.mask))
|
&& (stencil & qvk_sampleCount.mask))
|
||||||
@ -537,7 +537,7 @@ void QVulkanWindow::setSampleCount(int sampleCount)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &qvk_sampleCount : qvk_sampleCounts) {
|
for (const auto &qvk_sampleCount : q_vk_sampleCounts) {
|
||||||
if (qvk_sampleCount.count == sampleCount) {
|
if (qvk_sampleCount.count == sampleCount) {
|
||||||
d->sampleCount = qvk_sampleCount.mask;
|
d->sampleCount = qvk_sampleCount.mask;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user