mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #737 from asuessenbach/asTuple
Introduce helper function ResultValue<UniqueHandle<Type, Dispatch>>::asTuple()
This commit is contained in:
commit
dd6eb12aef
@ -9436,8 +9436,10 @@ namespace std
|
||||
, value(std::move(v))
|
||||
{}
|
||||
|
||||
Result result;
|
||||
UniqueHandle<Type, Dispatch> value;
|
||||
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple()
|
||||
{
|
||||
return std::make_tuple( result, std::move( value ) );
|
||||
}
|
||||
|
||||
# if !defined(VULKAN_HPP_DISABLE_IMPLICIT_RESULT_VALUE_CAST)
|
||||
VULKAN_HPP_DEPRECATED("Implicit-cast operators on vk::ResultValue are deprecated. Explicitly access the value as member of ResultValue.")
|
||||
@ -9452,6 +9454,9 @@ namespace std
|
||||
return std::move(value);
|
||||
}
|
||||
# endif
|
||||
|
||||
Result result;
|
||||
UniqueHandle<Type, Dispatch> value;
|
||||
};
|
||||
|
||||
template <typename Type, typename Dispatch>
|
||||
|
@ -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:
|
||||
|
@ -16369,8 +16369,10 @@ namespace VULKAN_HPP_NAMESPACE
|
||||
, value( std::move( v ) )
|
||||
{}
|
||||
|
||||
Result result;
|
||||
UniqueHandle<Type, Dispatch> value;
|
||||
std::tuple<Result, UniqueHandle<Type, Dispatch>> asTuple()
|
||||
{
|
||||
return std::make_tuple( result, std::move( value ) );
|
||||
}
|
||||
|
||||
# if !defined( VULKAN_HPP_DISABLE_IMPLICIT_RESULT_VALUE_CAST )
|
||||
VULKAN_HPP_DEPRECATED(
|
||||
@ -16387,6 +16389,9 @@ namespace VULKAN_HPP_NAMESPACE
|
||||
return std::move( value );
|
||||
}
|
||||
# endif
|
||||
|
||||
Result result;
|
||||
UniqueHandle<Type, Dispatch> value;
|
||||
};
|
||||
|
||||
template <typename Type, typename Dispatch>
|
||||
|
Loading…
Reference in New Issue
Block a user