Add missing allocator template argument in createResultValue helper functions working on std::vector<UniqueHandle> types.

This commit is contained in:
asuessenbach
2022-04-04 10:00:13 +02:00
parent e05bbdc555
commit dd6deccf52
3 changed files with 38 additions and 29 deletions

View File

@@ -25,6 +25,11 @@
static std::string AppName = "UniqueHandle";
static std::string EngineName = "Vulkan.hpp";
template <typename T>
class MyAllocator : public std::allocator<T>
{
};
vk::UniqueDescriptorSetLayout createDescriptorSetLayoutUnique( vk::Device const & device,
std::vector<std::tuple<vk::DescriptorType, uint32_t, vk::ShaderStageFlags>> const & bindingData,
vk::DescriptorSetLayoutCreateFlags flags = {} )
@@ -260,6 +265,13 @@ int main( int /*argc*/, char ** /*argv*/ )
// create a GraphicsPipeline
vk::UniquePipeline graphicsPipeline = device->createGraphicsPipelineUnique( *pipelineCache, graphicsPipelineCreateInfo ).value;
vk::UniquePipeline graphicsPipeline2 =
std::move( device->createGraphicsPipelinesUnique<vk::DispatchLoaderDynamic, MyAllocator<vk::UniquePipeline>>( *pipelineCache, graphicsPipelineCreateInfo )
.value[0] );
vk::UniquePipeline graphicsPipeline3 =
std::move( device->createGraphicsPipelinesUnique<vk::DispatchLoaderDynamic>( *pipelineCache, graphicsPipelineCreateInfo ).value[0] );
// destroy the non-Unique surface used here
instance->destroySurfaceKHR( surfaceData.surface );
}