Change samples from resetting command buffers to resetting command pool (#1638)
This commit is contained in:
committed by
GitHub
parent
e2f5348e28
commit
a6b2199409
@@ -59,12 +59,6 @@ namespace vk
|
||||
return ( propertyIterator != extensionProperties.end() );
|
||||
}
|
||||
|
||||
vk::CommandPool createCommandPool( vk::Device const & device, uint32_t queueFamilyIndex )
|
||||
{
|
||||
vk::CommandPoolCreateInfo commandPoolCreateInfo( vk::CommandPoolCreateFlagBits::eResetCommandBuffer, queueFamilyIndex );
|
||||
return device.createCommandPool( commandPoolCreateInfo );
|
||||
}
|
||||
|
||||
vk::DescriptorPool createDescriptorPool( vk::Device const & device, std::vector<vk::DescriptorPoolSize> const & poolSizes )
|
||||
{
|
||||
assert( !poolSizes.empty() );
|
||||
|
||||
@@ -31,8 +31,10 @@ namespace vk
|
||||
const uint64_t FenceTimeout = 100000000;
|
||||
|
||||
template <typename Func>
|
||||
void oneTimeSubmit( vk::CommandBuffer const & commandBuffer, vk::Queue const & queue, Func const & func )
|
||||
void oneTimeSubmit( vk::Device const & device, vk::CommandPool const & commandPool, vk::Queue const & queue, Func const & func )
|
||||
{
|
||||
vk::CommandBuffer commandBuffer =
|
||||
device.allocateCommandBuffers( vk::CommandBufferAllocateInfo( commandPool, vk::CommandBufferLevel::ePrimary, 1 ) ).front();
|
||||
commandBuffer.begin( vk::CommandBufferBeginInfo( vk::CommandBufferUsageFlagBits::eOneTimeSubmit ) );
|
||||
func( commandBuffer );
|
||||
commandBuffer.end();
|
||||
@@ -40,14 +42,6 @@ namespace vk
|
||||
queue.waitIdle();
|
||||
}
|
||||
|
||||
template <typename Func>
|
||||
void oneTimeSubmit( vk::Device const & device, vk::CommandPool const & commandPool, vk::Queue const & queue, Func const & func )
|
||||
{
|
||||
vk::CommandBuffer commandBuffer =
|
||||
device.allocateCommandBuffers( vk::CommandBufferAllocateInfo( commandPool, vk::CommandBufferLevel::ePrimary, 1 ) ).front();
|
||||
oneTimeSubmit( commandBuffer, queue, func );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void copyToDevice( vk::Device const & device, vk::DeviceMemory const & deviceMemory, T const * pData, size_t count, vk::DeviceSize stride = sizeof( T ) )
|
||||
{
|
||||
@@ -360,7 +354,6 @@ namespace vk
|
||||
vk::MemoryRequirements const & memoryRequirements,
|
||||
vk::MemoryPropertyFlags memoryPropertyFlags );
|
||||
bool contains( std::vector<vk::ExtensionProperties> const & extensionProperties, std::string const & extensionName );
|
||||
vk::CommandPool createCommandPool( vk::Device const & device, uint32_t queueFamilyIndex );
|
||||
vk::DescriptorPool createDescriptorPool( vk::Device const & device, std::vector<vk::DescriptorPoolSize> const & poolSizes );
|
||||
vk::DescriptorSetLayout createDescriptorSetLayout( vk::Device const & device,
|
||||
std::vector<std::tuple<vk::DescriptorType, uint32_t, vk::ShaderStageFlags>> const & bindingData,
|
||||
|
||||
Reference in New Issue
Block a user