2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/graphics/vulkan/vulkan-command-pool.h>
20 #include <dali/graphics/vulkan/vulkan-command-buffer.h>
21 #include <dali/graphics/vulkan/vulkan-graphics.h>
30 CommandPool::CommandPool(Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo)
33 mPool = VkAssert(graphics.GetDevice().createCommandPool(createInfo, graphics.GetAllocator()));
36 CommandPool::~CommandPool()
40 mGraphics.GetDevice().destroyCommandPool(mPool, mGraphics.GetAllocator());
44 std::unique_ptr< CommandBuffer > CommandPool::AllocateCommandBuffer(
45 const vk::CommandBufferAllocateInfo& info)
48 copyInfo.setCommandPool(mPool);
49 return MakeUnique<CommandBuffer>(mGraphics, *this, copyInfo);
52 std::unique_ptr< CommandBuffer > CommandPool::AllocateCommandBuffer(vk::CommandBufferLevel level)
55 vk::CommandBufferAllocateInfo{}.setCommandBufferCount(1).setLevel(level).setCommandPool(
57 return MakeUnique<CommandBuffer>(mGraphics, *this, info);
60 vk::CommandPool CommandPool::GetPool() const
66 } // namespace Graphics