From 57555edfb220ca1f32dbdabe211a97eacc1f35aa Mon Sep 17 00:00:00 2001 From: Markus Tavenrath Date: Mon, 18 May 2020 14:02:37 +0200 Subject: [PATCH] Fix warnings and errors on clang-3.9 --- .../13_InitVertexBuffer/13_InitVertexBuffer.cpp | 2 +- samples/15_DrawCube/15_DrawCube.cpp | 4 ++-- samples/DrawTexturedCube/DrawTexturedCube.cpp | 4 ++-- samples/DynamicUniform/DynamicUniform.cpp | 4 ++-- samples/ImmutableSampler/ImmutableSampler.cpp | 2 +- samples/InputAttachment/InputAttachment.cpp | 2 +- samples/MultipleSets/MultipleSets.cpp | 8 ++++---- samples/OcclusionQuery/OcclusionQuery.cpp | 4 ++-- samples/PipelineCache/PipelineCache.cpp | 4 ++-- samples/PipelineDerivative/PipelineDerivative.cpp | 4 ++-- samples/PushConstants/PushConstants.cpp | 4 ++-- samples/PushDescriptors/PushDescriptors.cpp | 2 +- samples/RayTracing/CameraManipulator.cpp | 2 ++ samples/RayTracing/RayTracing.cpp | 14 +++++++------- .../SecondaryCommandBuffer.cpp | 6 +++--- .../SeparateImageSampler/SeparateImageSampler.cpp | 15 ++++++++------- samples/Template/Template.cpp | 4 ++-- samples/TexelBuffer/TexelBuffer.cpp | 2 +- samples/utils/math.hpp | 4 ++++ samples/utils/utils.hpp | 4 ++-- 20 files changed, 51 insertions(+), 44 deletions(-) diff --git a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp index 65a72ff..d333d38 100644 --- a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp +++ b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp @@ -99,7 +99,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer->begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) ); diff --git a/samples/15_DrawCube/15_DrawCube.cpp b/samples/15_DrawCube/15_DrawCube.cpp index 89aefa1..1bf09b1 100644 --- a/samples/15_DrawCube/15_DrawCube.cpp +++ b/samples/15_DrawCube/15_DrawCube.cpp @@ -108,7 +108,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, {} ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -135,7 +135,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer->begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/DrawTexturedCube/DrawTexturedCube.cpp b/samples/DrawTexturedCube/DrawTexturedCube.cpp index 02812e4..9409f3f 100644 --- a/samples/DrawTexturedCube/DrawTexturedCube.cpp +++ b/samples/DrawTexturedCube/DrawTexturedCube.cpp @@ -115,7 +115,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, textureData ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -142,7 +142,7 @@ int main( int /*argc*/, char ** /*argv*/ ) // commandBuffer->begin() has already been called above! vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/DynamicUniform/DynamicUniform.cpp b/samples/DynamicUniform/DynamicUniform.cpp index c77e427..f41c818 100644 --- a/samples/DynamicUniform/DynamicUniform.cpp +++ b/samples/DynamicUniform/DynamicUniform.cpp @@ -152,7 +152,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBufferDynamic, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBufferDynamic, uniformBufferData.buffer, {} } }, {} ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -177,7 +177,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer->begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/ImmutableSampler/ImmutableSampler.cpp b/samples/ImmutableSampler/ImmutableSampler.cpp index 082573d..45a6aeb 100644 --- a/samples/ImmutableSampler/ImmutableSampler.cpp +++ b/samples/ImmutableSampler/ImmutableSampler.cpp @@ -159,7 +159,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/InputAttachment/InputAttachment.cpp b/samples/InputAttachment/InputAttachment.cpp index eed246e..8b45c1a 100644 --- a/samples/InputAttachment/InputAttachment.cpp +++ b/samples/InputAttachment/InputAttachment.cpp @@ -244,7 +244,7 @@ int main( int /*argc*/, char ** /*argv*/ ) uint32_t currentBuffer = result.value; vk::ClearValue clearValue; - clearValue.color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValue.color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); commandBuffer->beginRenderPass( vk::RenderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer].get(), vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), diff --git a/samples/MultipleSets/MultipleSets.cpp b/samples/MultipleSets/MultipleSets.cpp index ece642f..20f75ea 100644 --- a/samples/MultipleSets/MultipleSets.cpp +++ b/samples/MultipleSets/MultipleSets.cpp @@ -164,7 +164,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::DescriptorSetLayoutCreateInfo( vk::DescriptorSetLayoutCreateFlags(), 1, &sampler2DBinding ) ); // Create pipeline layout with multiple descriptor sets - std::array descriptorSetLayouts = { uniformLayout.get(), samplerLayout.get() }; + std::array descriptorSetLayouts = { { uniformLayout.get(), samplerLayout.get() } }; vk::UniquePipelineLayout pipelineLayout = device->createPipelineLayoutUnique( vk::PipelineLayoutCreateInfo( vk::PipelineLayoutCreateFlags(), 2, descriptorSetLayouts.data() ) ); @@ -183,12 +183,12 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::DescriptorImageInfo textureImageInfo( textureData.textureSampler.get(), textureData.imageData->imageView.get(), vk::ImageLayout::eShaderReadOnlyOptimal ); - std::array writeDescriptorSets = { + std::array writeDescriptorSets = { { vk::WriteDescriptorSet( descriptorSets[0].get(), 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &uniformBufferInfo ), vk::WriteDescriptorSet( descriptorSets[1].get(), 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &textureImageInfo ) - }; + } }; device->updateDescriptorSets( writeDescriptorSets, nullptr ); /* VULKAN_KEY_END */ @@ -214,7 +214,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/OcclusionQuery/OcclusionQuery.cpp b/samples/OcclusionQuery/OcclusionQuery.cpp index 18c669b..2af696e 100644 --- a/samples/OcclusionQuery/OcclusionQuery.cpp +++ b/samples/OcclusionQuery/OcclusionQuery.cpp @@ -108,7 +108,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, {} ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -158,7 +158,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer->resetQueryPool( queryPool.get(), 0, 2 ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer->beginRenderPass( vk::RenderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/PipelineCache/PipelineCache.cpp b/samples/PipelineCache/PipelineCache.cpp index 24d5360..da3723e 100644 --- a/samples/PipelineCache/PipelineCache.cpp +++ b/samples/PipelineCache/PipelineCache.cpp @@ -146,7 +146,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, textureData ); /* VULKAN_KEY_START */ @@ -315,7 +315,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer->beginRenderPass( vk::RenderPassBeginInfo( renderPass.get(), diff --git a/samples/PipelineDerivative/PipelineDerivative.cpp b/samples/PipelineDerivative/PipelineDerivative.cpp index 133e077..d8a8ecf 100644 --- a/samples/PipelineDerivative/PipelineDerivative.cpp +++ b/samples/PipelineDerivative/PipelineDerivative.cpp @@ -113,7 +113,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, textureData ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -260,7 +260,7 @@ void main() assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer->beginRenderPass( vk::RenderPassBeginInfo( renderPass.get(), diff --git a/samples/PushConstants/PushConstants.cpp b/samples/PushConstants/PushConstants.cpp index bddbbdc..abd6f57 100644 --- a/samples/PushConstants/PushConstants.cpp +++ b/samples/PushConstants/PushConstants.cpp @@ -164,7 +164,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::WriteDescriptorSet( *descriptorSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfo ), {} ); // Create our push constant data, which matches shader expectations - std::array pushConstants = { (unsigned)2, (unsigned)0x3F800000 }; + std::array pushConstants = { { (unsigned)2, (unsigned)0x3F800000 } }; // Ensure we have enough room for push constant data assert( ( sizeof( pushConstants ) <= physicalDevice.getProperties().limits.maxPushConstantsSize ) && @@ -195,7 +195,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), diff --git a/samples/PushDescriptors/PushDescriptors.cpp b/samples/PushDescriptors/PushDescriptors.cpp index b9a84c2..b0bf6b6 100644 --- a/samples/PushDescriptors/PushDescriptors.cpp +++ b/samples/PushDescriptors/PushDescriptors.cpp @@ -164,7 +164,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/RayTracing/CameraManipulator.cpp b/samples/RayTracing/CameraManipulator.cpp index 9a9952b..dbb2cf0 100644 --- a/samples/RayTracing/CameraManipulator.cpp +++ b/samples/RayTracing/CameraManipulator.cpp @@ -265,6 +265,8 @@ namespace vk orbit( glm::vec2( delta[0], -delta[1] ), true ); } break; + default: + break; } update(); diff --git a/samples/RayTracing/RayTracing.cpp b/samples/RayTracing/RayTracing.cpp index be51e3a..163b397 100644 --- a/samples/RayTracing/RayTracing.cpp +++ b/samples/RayTracing/RayTracing.cpp @@ -904,8 +904,8 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() }, - { vk::DescriptorType::eStorageBuffer, materialBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} }, + { vk::DescriptorType::eStorageBuffer, materialBufferData.buffer, {} } }, textures ); // RayTracing specific stuff @@ -1030,10 +1030,10 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, rayTracingDescriptorSets[i], - { { bindings[2].descriptorType, uniformBufferData.buffer, vk::UniqueBufferView() }, - { bindings[3].descriptorType, vertexBufferData.buffer, vk::UniqueBufferView() }, - { bindings[4].descriptorType, indexBufferData.buffer, vk::UniqueBufferView() }, - { bindings[5].descriptorType, materialBufferData.buffer, vk::UniqueBufferView() } }, + { { bindings[2].descriptorType, uniformBufferData.buffer, {} }, + { bindings[3].descriptorType, vertexBufferData.buffer, {} }, + { bindings[4].descriptorType, indexBufferData.buffer, {} }, + { bindings[5].descriptorType, materialBufferData.buffer, {} } }, textures, 2 ); } @@ -1131,7 +1131,7 @@ int main( int /*argc*/, char ** /*argv*/ ) shaderBindingTableBufferData.upload( device, shaderHandleStorage ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); // Main loop diff --git a/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp b/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp index a5c75f9..0d933a3 100644 --- a/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp +++ b/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp @@ -137,12 +137,12 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSets[0], - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, greenTextureData ); vk::su::updateDescriptorSets( device, descriptorSets[1], - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, checkeredTextureData ); /* VULKAN_KEY_START */ @@ -192,7 +192,7 @@ int main( int /*argc*/, char ** /*argv*/ ) } vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), diff --git a/samples/SeparateImageSampler/SeparateImageSampler.cpp b/samples/SeparateImageSampler/SeparateImageSampler.cpp index 142b7ff..8ad1145 100644 --- a/samples/SeparateImageSampler/SeparateImageSampler.cpp +++ b/samples/SeparateImageSampler/SeparateImageSampler.cpp @@ -154,10 +154,11 @@ int main( int /*argc*/, char ** /*argv*/ ) // binding 0 = uniform buffer (MVP) // binding 1 = texture2D // binding 2 = sampler - std::array resourceBindings = { + std::array resourceBindings = { { vk::DescriptorSetLayoutBinding( 0, vk::DescriptorType::eUniformBuffer, 1, vk::ShaderStageFlagBits::eVertex ), vk::DescriptorSetLayoutBinding( 1, vk::DescriptorType::eSampledImage, 1, vk::ShaderStageFlagBits::eFragment ), vk::DescriptorSetLayoutBinding( 2, vk::DescriptorType::eSampler, 1, vk::ShaderStageFlagBits::eFragment ) + } }; vk::UniqueDescriptorSetLayout descriptorSetLayout = device->createDescriptorSetLayoutUnique( vk::DescriptorSetLayoutCreateInfo( vk::DescriptorSetLayoutCreateFlags(), @@ -169,9 +170,9 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::PipelineLayoutCreateInfo( vk::PipelineLayoutCreateFlags(), 1, &( *descriptorSetLayout ) ) ); // Create a single pool to contain data for the descriptor set - std::array poolSizes = { vk::DescriptorPoolSize( vk::DescriptorType::eUniformBuffer, 1 ), - vk::DescriptorPoolSize( vk::DescriptorType::eSampledImage, 1 ), - vk::DescriptorPoolSize( vk::DescriptorType::eSampler, 1 ) }; + std::array poolSizes = { { vk::DescriptorPoolSize( vk::DescriptorType::eUniformBuffer, 1 ), + vk::DescriptorPoolSize( vk::DescriptorType::eSampledImage, 1 ), + vk::DescriptorPoolSize( vk::DescriptorType::eSampler, 1 ) } }; vk::UniqueDescriptorPool descriptorPool = device->createDescriptorPoolUnique( vk::DescriptorPoolCreateInfo( vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet, 1, @@ -188,11 +189,11 @@ int main( int /*argc*/, char ** /*argv*/ ) textureData.imageData->imageView.get(), vk::ImageLayout::eShaderReadOnlyOptimal ); vk::DescriptorImageInfo samplerInfo( sampler.get(), {}, {} ); - std::array descriptorWrites = { + std::array descriptorWrites = { { vk::WriteDescriptorSet( *descriptorSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfo ), vk::WriteDescriptorSet( *descriptorSet, 1, 0, 1, vk::DescriptorType::eSampledImage, &imageInfo ), vk::WriteDescriptorSet( *descriptorSet, 2, 0, 1, vk::DescriptorType::eSampler, &samplerInfo ) - }; + } }; device->updateDescriptorSets( descriptorWrites, nullptr ); /* VULKAN_KEY_END */ @@ -219,7 +220,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), diff --git a/samples/Template/Template.cpp b/samples/Template/Template.cpp index e168664..47c20f7 100644 --- a/samples/Template/Template.cpp +++ b/samples/Template/Template.cpp @@ -114,7 +114,7 @@ int main( int /*argc*/, char ** /*argv*/ ) vk::su::updateDescriptorSets( device, descriptorSet, - { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, vk::UniqueBufferView() } }, + { { vk::DescriptorType::eUniformBuffer, uniformBufferData.buffer, {} } }, textureData ); vk::UniquePipelineCache pipelineCache = device->createPipelineCacheUnique( vk::PipelineCacheCreateInfo() ); @@ -138,7 +138,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); vk::ClearValue clearValues[2]; - clearValues[0].color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), diff --git a/samples/TexelBuffer/TexelBuffer.cpp b/samples/TexelBuffer/TexelBuffer.cpp index a356531..b0ac3c8 100644 --- a/samples/TexelBuffer/TexelBuffer.cpp +++ b/samples/TexelBuffer/TexelBuffer.cpp @@ -170,7 +170,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer->begin( vk::CommandBufferBeginInfo() ); vk::ClearValue clearValue; - clearValue.color = vk::ClearColorValue( std::array( { 0.2f, 0.2f, 0.2f, 0.2f } ) ); + clearValue.color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass.get(), framebuffers[currentBuffer.value].get(), vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), diff --git a/samples/utils/math.hpp b/samples/utils/math.hpp index ac701f8..6045bec 100644 --- a/samples/utils/math.hpp +++ b/samples/utils/math.hpp @@ -15,8 +15,12 @@ #include #define GLM_FORCE_RADIANS + +#if defined(_MSC_VER) #pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed // to get glm/detail/type_vec?.hpp without warnings +#endif + #include namespace vk diff --git a/samples/utils/utils.hpp b/samples/utils/utils.hpp index 5b227c1..20a0e38 100644 --- a/samples/utils/utils.hpp +++ b/samples/utils/utils.hpp @@ -230,8 +230,8 @@ namespace vk class CheckerboardImageGenerator { public: - CheckerboardImageGenerator( std::array const & rgb0 = { 0, 0, 0 }, - std::array const & rgb1 = { 255, 255, 255 } ); + CheckerboardImageGenerator( std::array const & rgb0 = { { 0, 0, 0 } }, + std::array const & rgb1 = { { 255, 255, 255 } } ); void operator()( void * data, vk::Extent2D & extent ) const;