From 556c0d3434799db87d1db8cc0544249b1047461a Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Thu, 24 Nov 2022 08:59:50 +0100 Subject: [PATCH] Introduce additional constructor for unions holding a fixed size array of data. --- .../13_InitVertexBuffer.cpp | 2 +- RAII_Samples/15_DrawCube/15_DrawCube.cpp | 2 +- .../DrawTexturedCube/DrawTexturedCube.cpp | 2 +- .../DynamicUniform/DynamicUniform.cpp | 2 +- .../ImmutableSampler/ImmutableSampler.cpp | 2 +- .../InputAttachment/InputAttachment.cpp | 2 +- RAII_Samples/MultipleSets/MultipleSets.cpp | 2 +- .../OcclusionQuery/OcclusionQuery.cpp | 2 +- RAII_Samples/PipelineCache/PipelineCache.cpp | 2 +- .../PipelineDerivative/PipelineDerivative.cpp | 2 +- RAII_Samples/PushConstants/PushConstants.cpp | 2 +- .../PushDescriptors/PushDescriptors.cpp | 2 +- RAII_Samples/RayTracing/RayTracing.cpp | 2 +- .../SecondaryCommandBuffer.cpp | 2 +- .../SeparateImageSampler.cpp | 2 +- RAII_Samples/Template/Template.cpp | 2 +- RAII_Samples/TexelBuffer/TexelBuffer.cpp | 2 +- VulkanHppGenerator.cpp | 33 +++++++++++++++++++ .../13_InitVertexBuffer.cpp | 2 +- samples/15_DrawCube/15_DrawCube.cpp | 2 +- samples/DrawTexturedCube/DrawTexturedCube.cpp | 2 +- samples/DynamicUniform/DynamicUniform.cpp | 2 +- samples/ImmutableSampler/ImmutableSampler.cpp | 2 +- samples/InputAttachment/InputAttachment.cpp | 4 +-- samples/MultipleSets/MultipleSets.cpp | 2 +- samples/OcclusionQuery/OcclusionQuery.cpp | 2 +- samples/PipelineCache/PipelineCache.cpp | 2 +- .../PipelineDerivative/PipelineDerivative.cpp | 2 +- samples/PushConstants/PushConstants.cpp | 2 +- samples/PushDescriptors/PushDescriptors.cpp | 2 +- samples/RayTracing/RayTracing.cpp | 2 +- .../SecondaryCommandBuffer.cpp | 2 +- .../SeparateImageSampler.cpp | 2 +- samples/Template/Template.cpp | 2 +- samples/TexelBuffer/TexelBuffer.cpp | 2 +- vulkan/vulkan_enums.hpp | 6 ++-- vulkan/vulkan_structs.hpp | 32 +++++++++++++----- 37 files changed, 94 insertions(+), 47 deletions(-) diff --git a/RAII_Samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp b/RAII_Samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp index d53bcc3..5c59d0b 100644 --- a/RAII_Samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp +++ b/RAII_Samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp @@ -103,7 +103,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.begin( {} ); diff --git a/RAII_Samples/15_DrawCube/15_DrawCube.cpp b/RAII_Samples/15_DrawCube/15_DrawCube.cpp index 361df96..108c743 100644 --- a/RAII_Samples/15_DrawCube/15_DrawCube.cpp +++ b/RAII_Samples/15_DrawCube/15_DrawCube.cpp @@ -128,7 +128,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.begin( {} ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/RAII_Samples/DrawTexturedCube/DrawTexturedCube.cpp b/RAII_Samples/DrawTexturedCube/DrawTexturedCube.cpp index 62c9b7b..460bd20 100644 --- a/RAII_Samples/DrawTexturedCube/DrawTexturedCube.cpp +++ b/RAII_Samples/DrawTexturedCube/DrawTexturedCube.cpp @@ -125,7 +125,7 @@ int main( int /*argc*/, char ** /*argv*/ ) // commandBuffer.begin() has already been called above! std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/RAII_Samples/DynamicUniform/DynamicUniform.cpp b/RAII_Samples/DynamicUniform/DynamicUniform.cpp index 9d60d4b..19340c5 100644 --- a/RAII_Samples/DynamicUniform/DynamicUniform.cpp +++ b/RAII_Samples/DynamicUniform/DynamicUniform.cpp @@ -150,7 +150,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.begin( {} ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/RAII_Samples/ImmutableSampler/ImmutableSampler.cpp b/RAII_Samples/ImmutableSampler/ImmutableSampler.cpp index 8b8b723..2994c47 100644 --- a/RAII_Samples/ImmutableSampler/ImmutableSampler.cpp +++ b/RAII_Samples/ImmutableSampler/ImmutableSampler.cpp @@ -152,7 +152,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/RAII_Samples/InputAttachment/InputAttachment.cpp b/RAII_Samples/InputAttachment/InputAttachment.cpp index 5604653..8324fec 100644 --- a/RAII_Samples/InputAttachment/InputAttachment.cpp +++ b/RAII_Samples/InputAttachment/InputAttachment.cpp @@ -216,7 +216,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); vk::ClearValue clearValue; - clearValue.color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValue.color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValue ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); commandBuffer.bindPipeline( vk::PipelineBindPoint::eGraphics, *graphicsPipeline ); diff --git a/RAII_Samples/MultipleSets/MultipleSets.cpp b/RAII_Samples/MultipleSets/MultipleSets.cpp index 08a070d..bcd0a52 100644 --- a/RAII_Samples/MultipleSets/MultipleSets.cpp +++ b/RAII_Samples/MultipleSets/MultipleSets.cpp @@ -215,7 +215,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/RAII_Samples/OcclusionQuery/OcclusionQuery.cpp b/RAII_Samples/OcclusionQuery/OcclusionQuery.cpp index 32c8bfa..4e3c1ea 100644 --- a/RAII_Samples/OcclusionQuery/OcclusionQuery.cpp +++ b/RAII_Samples/OcclusionQuery/OcclusionQuery.cpp @@ -142,7 +142,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.resetQueryPool( *queryPool, 0, 2 ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( vk::RenderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D(), surfaceData.extent ), clearValues ), diff --git a/RAII_Samples/PipelineCache/PipelineCache.cpp b/RAII_Samples/PipelineCache/PipelineCache.cpp index 2e85a37..7339a91 100644 --- a/RAII_Samples/PipelineCache/PipelineCache.cpp +++ b/RAII_Samples/PipelineCache/PipelineCache.cpp @@ -306,7 +306,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( diff --git a/RAII_Samples/PipelineDerivative/PipelineDerivative.cpp b/RAII_Samples/PipelineDerivative/PipelineDerivative.cpp index fdcc7cf..62ccc12 100644 --- a/RAII_Samples/PipelineDerivative/PipelineDerivative.cpp +++ b/RAII_Samples/PipelineDerivative/PipelineDerivative.cpp @@ -229,7 +229,7 @@ void main() assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( diff --git a/RAII_Samples/PushConstants/PushConstants.cpp b/RAII_Samples/PushConstants/PushConstants.cpp index 5ab43f5..5ba8dae 100644 --- a/RAII_Samples/PushConstants/PushConstants.cpp +++ b/RAII_Samples/PushConstants/PushConstants.cpp @@ -189,7 +189,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/RAII_Samples/PushDescriptors/PushDescriptors.cpp b/RAII_Samples/PushDescriptors/PushDescriptors.cpp index 2974ac6..4e27230 100644 --- a/RAII_Samples/PushDescriptors/PushDescriptors.cpp +++ b/RAII_Samples/PushDescriptors/PushDescriptors.cpp @@ -149,7 +149,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/RAII_Samples/RayTracing/RayTracing.cpp b/RAII_Samples/RayTracing/RayTracing.cpp index c620d46..b89b305 100644 --- a/RAII_Samples/RayTracing/RayTracing.cpp +++ b/RAII_Samples/RayTracing/RayTracing.cpp @@ -1092,7 +1092,7 @@ int main( int /*argc*/, char ** /*argv*/ ) shaderBindingTableBufferData.upload( shaderHandleStorage ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); // Main loop diff --git a/RAII_Samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp b/RAII_Samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp index 4adbd79..16c2e40 100644 --- a/RAII_Samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp +++ b/RAII_Samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp @@ -180,7 +180,7 @@ int main( int /*argc*/, char ** /*argv*/ ) } std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/RAII_Samples/SeparateImageSampler/SeparateImageSampler.cpp b/RAII_Samples/SeparateImageSampler/SeparateImageSampler.cpp index a97c6d2..73a74ed 100644 --- a/RAII_Samples/SeparateImageSampler/SeparateImageSampler.cpp +++ b/RAII_Samples/SeparateImageSampler/SeparateImageSampler.cpp @@ -205,7 +205,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/RAII_Samples/Template/Template.cpp b/RAII_Samples/Template/Template.cpp index bba8149..b5a7e50 100644 --- a/RAII_Samples/Template/Template.cpp +++ b/RAII_Samples/Template/Template.cpp @@ -120,7 +120,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( imageIndex < swapChainData.images.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/RAII_Samples/TexelBuffer/TexelBuffer.cpp b/RAII_Samples/TexelBuffer/TexelBuffer.cpp index c459476..4e1ed38 100644 --- a/RAII_Samples/TexelBuffer/TexelBuffer.cpp +++ b/RAII_Samples/TexelBuffer/TexelBuffer.cpp @@ -146,7 +146,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( 0.2f, 0.2f, 0.2f, 0.2f ); vk::RenderPassBeginInfo renderPassBeginInfo( *renderPass, *framebuffers[imageIndex], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValue ); commandBuffer.beginRenderPass( renderPassBeginInfo, vk::SubpassContents::eInline ); diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 663f15c..e4cd29c 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -10131,6 +10131,39 @@ std::string VulkanHppGenerator::generateUnion( std::pairarraySizes.empty() ) + { + assert( !multipleType ); + assert( memberIt->arraySizes.size() == 1 ); + int size = std::stoi( memberIt->arraySizes[0] ); + assert( std::to_string( size ) == memberIt->arraySizes[0] ); + std::string arguments, callArguments; + bool firstArgument = true; + for ( int i = 0; i < size; i++ ) + { + if ( !firstArgument ) + { + arguments += ", "; + callArguments += ", "; + } + std::string argumentIndex = std::to_string( i ); + arguments += memberIt->type.type + " " + memberIt->name + "_" + argumentIndex; + callArguments += memberIt->name + "_" + argumentIndex; + firstArgument = false; + } + + static const std::string constructorBySequenceTemplate = R"( + VULKAN_HPP_CONSTEXPR ${unionName}( ${arguments} ) + : ${memberName}( { ${callArguments} } ) + {})"; + + constructors += "\n" + replaceWithMap( constructorBySequenceTemplate, + { { "arguments", arguments }, + { "callArguments", callArguments }, + { "memberName", memberIt->name }, + { "unionName", stripPrefix( structure.first, "Vk" ) } } ); + } } } diff --git a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp index c12ec13..cfc4989 100644 --- a/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp +++ b/samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp @@ -88,7 +88,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 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 5a2ed5a..3cf30b6 100644 --- a/samples/15_DrawCube/15_DrawCube.cpp +++ b/samples/15_DrawCube/15_DrawCube.cpp @@ -112,7 +112,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/DrawTexturedCube/DrawTexturedCube.cpp b/samples/DrawTexturedCube/DrawTexturedCube.cpp index 880c33e..5989fd6 100644 --- a/samples/DrawTexturedCube/DrawTexturedCube.cpp +++ b/samples/DrawTexturedCube/DrawTexturedCube.cpp @@ -119,7 +119,7 @@ int main( int /*argc*/, char ** /*argv*/ ) // commandBuffer.begin() has already been called above! std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/DynamicUniform/DynamicUniform.cpp b/samples/DynamicUniform/DynamicUniform.cpp index 868a4d4..1c11630 100644 --- a/samples/DynamicUniform/DynamicUniform.cpp +++ b/samples/DynamicUniform/DynamicUniform.cpp @@ -151,7 +151,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/ImmutableSampler/ImmutableSampler.cpp b/samples/ImmutableSampler/ImmutableSampler.cpp index a0e208d..6d1bcd7 100644 --- a/samples/ImmutableSampler/ImmutableSampler.cpp +++ b/samples/ImmutableSampler/ImmutableSampler.cpp @@ -143,7 +143,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/InputAttachment/InputAttachment.cpp b/samples/InputAttachment/InputAttachment.cpp index c499e9b..260db21 100644 --- a/samples/InputAttachment/InputAttachment.cpp +++ b/samples/InputAttachment/InputAttachment.cpp @@ -134,7 +134,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.clearColorImage( inputImage, vk::ImageLayout::eTransferDstOptimal, - vk::ClearColorValue( std::array( { { 1.0f, 1.0f, 0.0f, 0.0f } } ) ), + vk::ClearColorValue( 1.0f, 1.0f, 0.0f, 0.0f ), vk::ImageSubresourceRange( vk::ImageAspectFlagBits::eColor, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS ) ); // Set the image layout to SHADER_READONLY_OPTIMAL for use by the shaders @@ -220,7 +220,7 @@ int main( int /*argc*/, char ** /*argv*/ ) uint32_t currentBuffer = nexImage.value; vk::ClearValue clearValue; - clearValue.color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValue.color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); commandBuffer.beginRenderPass( vk::RenderPassBeginInfo( renderPass, framebuffers[currentBuffer], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValue ), vk::SubpassContents::eInline ); diff --git a/samples/MultipleSets/MultipleSets.cpp b/samples/MultipleSets/MultipleSets.cpp index 415d8bf..b8a98a6 100644 --- a/samples/MultipleSets/MultipleSets.cpp +++ b/samples/MultipleSets/MultipleSets.cpp @@ -199,7 +199,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/OcclusionQuery/OcclusionQuery.cpp b/samples/OcclusionQuery/OcclusionQuery.cpp index d873a81..8d33500 100644 --- a/samples/OcclusionQuery/OcclusionQuery.cpp +++ b/samples/OcclusionQuery/OcclusionQuery.cpp @@ -129,7 +129,7 @@ int main( int /*argc*/, char ** /*argv*/ ) commandBuffer.resetQueryPool( queryPool, 0, 2 ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( vk::RenderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D(), surfaceData.extent ), clearValues ), diff --git a/samples/PipelineCache/PipelineCache.cpp b/samples/PipelineCache/PipelineCache.cpp index 4e68696..349b187 100644 --- a/samples/PipelineCache/PipelineCache.cpp +++ b/samples/PipelineCache/PipelineCache.cpp @@ -300,7 +300,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( diff --git a/samples/PipelineDerivative/PipelineDerivative.cpp b/samples/PipelineDerivative/PipelineDerivative.cpp index bde6479..185fadb 100644 --- a/samples/PipelineDerivative/PipelineDerivative.cpp +++ b/samples/PipelineDerivative/PipelineDerivative.cpp @@ -239,7 +239,7 @@ void main() assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); commandBuffer.beginRenderPass( diff --git a/samples/PushConstants/PushConstants.cpp b/samples/PushConstants/PushConstants.cpp index 3fd8430..1fd3e12 100644 --- a/samples/PushConstants/PushConstants.cpp +++ b/samples/PushConstants/PushConstants.cpp @@ -184,7 +184,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( diff --git a/samples/PushDescriptors/PushDescriptors.cpp b/samples/PushDescriptors/PushDescriptors.cpp index e694907..ed6cb25 100644 --- a/samples/PushDescriptors/PushDescriptors.cpp +++ b/samples/PushDescriptors/PushDescriptors.cpp @@ -148,7 +148,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/RayTracing/RayTracing.cpp b/samples/RayTracing/RayTracing.cpp index cce78f5..38fae69 100644 --- a/samples/RayTracing/RayTracing.cpp +++ b/samples/RayTracing/RayTracing.cpp @@ -1084,7 +1084,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( 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 69a8fbb..f5674b0 100644 --- a/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp +++ b/samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp @@ -176,7 +176,7 @@ int main( int /*argc*/, char ** /*argv*/ ) } std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( diff --git a/samples/SeparateImageSampler/SeparateImageSampler.cpp b/samples/SeparateImageSampler/SeparateImageSampler.cpp index dff6e23..fe20f46 100644 --- a/samples/SeparateImageSampler/SeparateImageSampler.cpp +++ b/samples/SeparateImageSampler/SeparateImageSampler.cpp @@ -201,7 +201,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( diff --git a/samples/Template/Template.cpp b/samples/Template/Template.cpp index d44a3d4..6d35f35 100644 --- a/samples/Template/Template.cpp +++ b/samples/Template/Template.cpp @@ -116,7 +116,7 @@ int main( int /*argc*/, char ** /*argv*/ ) assert( currentBuffer.value < framebuffers.size() ); std::array clearValues; - clearValues[0].color = vk::ClearColorValue( std::array( { { 0.2f, 0.2f, 0.2f, 0.2f } } ) ); + clearValues[0].color = vk::ClearColorValue( 0.2f, 0.2f, 0.2f, 0.2f ); clearValues[1].depthStencil = vk::ClearDepthStencilValue( 1.0f, 0 ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValues ); diff --git a/samples/TexelBuffer/TexelBuffer.cpp b/samples/TexelBuffer/TexelBuffer.cpp index 04067ee..52ec559 100644 --- a/samples/TexelBuffer/TexelBuffer.cpp +++ b/samples/TexelBuffer/TexelBuffer.cpp @@ -149,7 +149,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( 0.2f, 0.2f, 0.2f, 0.2f ); vk::RenderPassBeginInfo renderPassBeginInfo( renderPass, framebuffers[currentBuffer.value], vk::Rect2D( vk::Offset2D( 0, 0 ), surfaceData.extent ), clearValue ); diff --git a/vulkan/vulkan_enums.hpp b/vulkan/vulkan_enums.hpp index 187129e..98c5de7 100644 --- a/vulkan/vulkan_enums.hpp +++ b/vulkan/vulkan_enums.hpp @@ -1708,9 +1708,9 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR QueueFlags allFlags = QueueFlagBits::eGraphics | QueueFlagBits::eCompute | QueueFlagBits::eTransfer | QueueFlagBits::eSparseBinding | QueueFlagBits::eProtected #if defined( VK_ENABLE_BETA_EXTENSIONS ) - | QueueFlagBits::eVideoDecodeKHR | QueueFlagBits::eVideoEncodeKHR + | QueueFlagBits::eVideoDecodeKHR | QueueFlagBits::eVideoEncodeKHR #endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | QueueFlagBits::eOpticalFlowNV; + | QueueFlagBits::eOpticalFlowNV; }; enum class SampleCountFlagBits : VkSampleCountFlags @@ -1984,7 +1984,7 @@ namespace VULKAN_HPP_NAMESPACE static VULKAN_HPP_CONST_OR_CONSTEXPR QueryResultFlags allFlags = QueryResultFlagBits::e64 | QueryResultFlagBits::eWait | QueryResultFlagBits::eWithAvailability | QueryResultFlagBits::ePartial #if defined( VK_ENABLE_BETA_EXTENSIONS ) - | QueryResultFlagBits::eWithStatusKHR + | QueryResultFlagBits::eWithStatusKHR #endif /*VK_ENABLE_BETA_EXTENSIONS*/ ; }; diff --git a/vulkan/vulkan_structs.hpp b/vulkan/vulkan_structs.hpp index 8e7ac9b..438e733 100644 --- a/vulkan/vulkan_structs.hpp +++ b/vulkan/vulkan_structs.hpp @@ -2630,10 +2630,10 @@ namespace VULKAN_HPP_NAMESPACE public: VULKAN_HPP_NAMESPACE::TransformMatrixKHR transform = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; + uint32_t instanceCustomIndex : 24; + uint32_t mask : 8; uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; + VkGeometryInstanceFlagsKHR flags : 8; uint64_t accelerationStructureReference = {}; }; using AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR; @@ -2776,10 +2776,10 @@ namespace VULKAN_HPP_NAMESPACE public: VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT0 = {}; VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT1 = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; + uint32_t instanceCustomIndex : 24; + uint32_t mask : 8; uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; + VkGeometryInstanceFlagsKHR flags : 8; uint64_t accelerationStructureReference = {}; }; @@ -3370,10 +3370,10 @@ namespace VULKAN_HPP_NAMESPACE public: VULKAN_HPP_NAMESPACE::SRTDataNV transformT0 = {}; VULKAN_HPP_NAMESPACE::SRTDataNV transformT1 = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; + uint32_t instanceCustomIndex : 24; + uint32_t mask : 8; uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; + VkGeometryInstanceFlagsKHR flags : 8; uint64_t accelerationStructureReference = {}; }; @@ -12509,9 +12509,23 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & float32_ = {} ) : float32( float32_ ) {} + VULKAN_HPP_CONSTEXPR ClearColorValue( float float32_0, float float32_1, float float32_2, float float32_3 ) + : float32( { float32_0, float32_1, float32_2, float32_3 } ) + { + } + VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & int32_ ) : int32( int32_ ) {} + VULKAN_HPP_CONSTEXPR ClearColorValue( int32_t int32_0, int32_t int32_1, int32_t int32_2, int32_t int32_3 ) : int32( { int32_0, int32_1, int32_2, int32_3 } ) + { + } + VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & uint32_ ) : uint32( uint32_ ) {} + + VULKAN_HPP_CONSTEXPR ClearColorValue( uint32_t uint32_0, uint32_t uint32_1, uint32_t uint32_2, uint32_t uint32_3 ) + : uint32( { uint32_0, uint32_1, uint32_2, uint32_3 } ) + { + } #endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ #if !defined( VULKAN_HPP_NO_UNION_SETTERS )