Introduce helper function ResultValue<UniqueHandle<Type, Dispatch>>::asTuple()

Allows coding like this:

    vk::Result         result;
    vk::UniquePipeline pipeline;
    std::tie( result, pipeline ) =
      device->createGraphicsPipelineUnique( nullptr, graphicsPipelineCreateInfo ).asTuple();
This commit is contained in:
asuessenbach
2020-09-16 09:36:37 +02:00
parent 0bacbdd449
commit 0b8e4cb938
3 changed files with 19 additions and 7 deletions

View File

@@ -161,9 +161,11 @@ int main( int /*argc*/, char ** /*argv*/ )
renderPass.get() // renderPass
);
vk::ResultValue<vk::UniquePipeline> pipeline =
device->createGraphicsPipelineUnique( nullptr, graphicsPipelineCreateInfo );
switch ( pipeline.result )
vk::Result result;
vk::UniquePipeline pipeline;
std::tie( result, pipeline ) =
device->createGraphicsPipelineUnique( nullptr, graphicsPipelineCreateInfo ).asTuple();
switch ( result )
{
case vk::Result::eSuccess: break;
case vk::Result::ePipelineCompileRequiredEXT: