1 #ifndef DALI_GRAPHICS_VULKAN_QUEUE_H
2 #define DALI_GRAPHICS_VULKAN_QUEUE_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/graphics/vulkan/vulkan-types.h>
35 Submission(Fence& fence);
37 bool WaitForFence(uint32_t timeout = 0u);
40 // todo: possibly resources locks stored here?
48 Queue(Graphics& graphics, vk::Queue queue, uint32_t queueFamilyIndex, uint32_t queueIndex,
49 vk::QueueFlags queueFlags);
50 ~Queue(); // queues are non-destructible
52 /** Submits command buffers */
53 std::unique_ptr< Submission > Submit(const std::vector< CommandBufferRef >& commandBuffers,
56 /** Helper function to submit single command buffer */
57 std::unique_ptr< Submission > Submit(CommandBuffer& commandBuffer, Fence& fence);
59 void WaitIdle() const;
66 vk::Result Present( const vk::PresentInfoKHR& presentInfo );
73 vk::Result Present( vk::SwapchainKHR swapchain, uint32_t imageIndex );
76 /** Prepares command buffers for submission */
77 std::vector< vk::CommandBuffer > PrepareBuffers(
78 const std::vector< CommandBufferRef >& commandBuffers) const;
85 vk::QueueFlags mFlags;
86 std::vector< vk::Fence > mFences;
87 uint32_t mQueueFamilyIndex;
92 } // namespace Graphics
95 #endif // DALI_GRAPHICS_VULKAN_QUEUE_H