Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.06k stars 511 forks source link

Add extra braces when setting VkClearValue #247

Closed TestingPlant closed 2 years ago

TestingPlant commented 2 years ago

clang++ -Wall emits the warning "suggest braces around initialization of subobject [-Wmissing-braces]" with code like

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};

Since this is trying to fill out clearColor.color.float32, 3 braces are needed like

VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};

to avoid the warning.