Skip to content

Commit

Permalink
Merge pull request #1457 from asuessenbach/ClearColorValue
Browse files Browse the repository at this point in the history
Introduce additional constructor for unions holding a fixed size array of data.
  • Loading branch information
asuessenbach authored Nov 24, 2022
2 parents fc0568e + 556c0d3 commit a577b39
Show file tree
Hide file tree
Showing 37 changed files with 94 additions and 47 deletions.
2 changes: 1 addition & 1 deletion RAII_Samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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( {} );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/15_DrawCube/15_DrawCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.begin( {} );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/DrawTexturedCube/DrawTexturedCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int main( int /*argc*/, char ** /*argv*/ )
// commandBuffer.begin() has already been called above!

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );

Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/DynamicUniform/DynamicUniform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.begin( {} );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/ImmutableSampler/ImmutableSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/InputAttachment/InputAttachment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

vk::ClearValue clearValue;
clearValue.color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/MultipleSets/MultipleSets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/OcclusionQuery/OcclusionQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.resetQueryPool( *queryPool, 0, 2 );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 ),
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/PipelineCache/PipelineCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/PipelineDerivative/PipelineDerivative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void main()
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/PushConstants/PushConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/PushDescriptors/PushDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/RayTracing/RayTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ int main( int /*argc*/, char ** /*argv*/ )
shaderBindingTableBufferData.upload( shaderHandleStorage );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main( int /*argc*/, char ** /*argv*/ )
}

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/SeparateImageSampler/SeparateImageSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/Template/Template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( imageIndex < swapChainData.images.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );

Expand Down
2 changes: 1 addition & 1 deletion RAII_Samples/TexelBuffer/TexelBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.begin( vk::CommandBufferBeginInfo() );

vk::ClearValue clearValue;
clearValue.color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
33 changes: 33 additions & 0 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10131,6 +10131,39 @@ std::string VulkanHppGenerator::generateUnion( std::pair<std::string, StructureD
{ "memberType", memberType },
{ "unionName", stripPrefix( structure.first, "Vk" ) } } );
firstMember = false;

if ( !memberIt->arraySizes.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" ) } } );
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion samples/13_InitVertexBuffer/13_InitVertexBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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() ) );
Expand Down
2 changes: 1 addition & 1 deletion samples/15_DrawCube/15_DrawCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/DrawTexturedCube/DrawTexturedCube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main( int /*argc*/, char ** /*argv*/ )
// commandBuffer.begin() has already been called above!

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/DynamicUniform/DynamicUniform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlags() ) );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/ImmutableSampler/ImmutableSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
4 changes: 2 additions & 2 deletions samples/InputAttachment/InputAttachment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int main( int /*argc*/, char ** /*argv*/ )

commandBuffer.clearColorImage( inputImage,
vk::ImageLayout::eTransferDstOptimal,
vk::ClearColorValue( std::array<float, 4>( { { 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
Expand Down Expand Up @@ -220,7 +220,7 @@ int main( int /*argc*/, char ** /*argv*/ )
uint32_t currentBuffer = nexImage.value;

vk::ClearValue clearValue;
clearValue.color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/MultipleSets/MultipleSets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/OcclusionQuery/OcclusionQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int main( int /*argc*/, char ** /*argv*/ )
commandBuffer.resetQueryPool( queryPool, 0, 2 );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 ),
Expand Down
2 changes: 1 addition & 1 deletion samples/PipelineCache/PipelineCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
2 changes: 1 addition & 1 deletion samples/PipelineDerivative/PipelineDerivative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void main()
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
2 changes: 1 addition & 1 deletion samples/PushConstants/PushConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
2 changes: 1 addition & 1 deletion samples/PushDescriptors/PushDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int main( int /*argc*/, char ** /*argv*/ )
assert( currentBuffer.value < framebuffers.size() );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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 );
Expand Down
2 changes: 1 addition & 1 deletion samples/RayTracing/RayTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ int main( int /*argc*/, char ** /*argv*/ )
shaderBindingTableBufferData.upload( device, shaderHandleStorage );

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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
Expand Down
2 changes: 1 addition & 1 deletion samples/SecondaryCommandBuffer/SecondaryCommandBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int main( int /*argc*/, char ** /*argv*/ )
}

std::array<vk::ClearValue, 2> clearValues;
clearValues[0].color = vk::ClearColorValue( std::array<float, 4>( { { 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(
Expand Down
Loading

0 comments on commit a577b39

Please sign in to comment.