Skip to content

Commit

Permalink
Vulkan Examples: Fix Clang warnings about initialization of VkClearCo…
Browse files Browse the repository at this point in the history
…lorValue

hellovulkanwindow.cpp(97,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.0f, m_green, 0.0f, 1.0f };
hellovulkantexture.cpp(771,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
..\shared\trianglerenderer.cpp(455,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
renderer.cpp(896,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.67f, 0.84f, 0.9f, 1.0f };

Change-Id: I3c2403699059dac2f88541f2a2102b774db0c887
Reviewed-by: Laszlo Agocs <[email protected]>
  • Loading branch information
FriedemannKleint committed Apr 30, 2018
1 parent fe670fc commit 2677ad7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/vulkan/hellovulkancubes/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ void Renderer::buildFrame()
VkCommandBuffer cb = m_window->currentCommandBuffer();
const QSize sz = m_window->swapChainImageSize();

VkClearColorValue clearColor = { 0.67f, 0.84f, 0.9f, 1.0f };
VkClearColorValue clearColor = {{ 0.67f, 0.84f, 0.9f, 1.0f }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[3];
memset(clearValues, 0, sizeof(clearValues));
Expand Down
2 changes: 1 addition & 1 deletion examples/vulkan/hellovulkantexture/hellovulkantexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ void VulkanRenderer::startNextFrame()
// Add the necessary barriers and do the host-linear -> device-optimal copy, if not yet done.
ensureTexture();

VkClearColorValue clearColor = { 0, 0, 0, 1 };
VkClearColorValue clearColor = {{ 0, 0, 0, 1 }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[2];
memset(clearValues, 0, sizeof(clearValues));
Expand Down
2 changes: 1 addition & 1 deletion examples/vulkan/hellovulkanwindow/hellovulkanwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void VulkanRenderer::startNextFrame()
if (m_green > 1.0f)
m_green = 0.0f;

VkClearColorValue clearColor = { 0.0f, m_green, 0.0f, 1.0f };
VkClearColorValue clearColor = {{ 0.0f, m_green, 0.0f, 1.0f }};
VkClearDepthStencilValue clearDS = { 1.0f, 0 };
VkClearValue clearValues[2];
memset(clearValues, 0, sizeof(clearValues));
Expand Down
2 changes: 1 addition & 1 deletion examples/vulkan/shared/trianglerenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ void TriangleRenderer::startNextFrame()
VkCommandBuffer cb = m_window->currentCommandBuffer();
const QSize sz = m_window->swapChainImageSize();

VkClearColorValue clearColor = { 0, 0, 0, 1 };
VkClearColorValue clearColor = {{ 0, 0, 0, 1 }};
VkClearDepthStencilValue clearDS = { 1, 0 };
VkClearValue clearValues[3];
memset(clearValues, 0, sizeof(clearValues));
Expand Down

0 comments on commit 2677ad7

Please sign in to comment.