VPP  0.8
A high-level modern C++ API for Vulkan
vppQueue.hpp
1 /*
2  Copyright 2016-2018 SOFT-ERG, Przemek Kuczmierczyk (www.softerg.com)
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification,
6  are permitted provided that the following conditions are met:
7 
8  1. Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 // -----------------------------------------------------------------------------
28 namespace vpp {
29 // -----------------------------------------------------------------------------
30 
65 class Queue
66 {
67 public:
69  Queue();
70 
78  explicit Queue (
79  const Device& hDevice,
80  unsigned int iQueue = 0,
81  EQueueType eQueue = Q_GRAPHICS );
82 
94  Queue (
95  unsigned int iFamily,
96  const Device& hDevice,
97  unsigned int iQueue );
98 
102  VkQueue handle() const;
103 
107  const Device& device() const;
108 
112  EQueueType type() const;
113 
117  operator bool() const;
118 
145  void submit (
146  const CommandBuffer& singleBuffer,
147  const Semaphore& waitOnBegin = Semaphore(),
148  const Semaphore& signalOnEnd = Semaphore(),
149  const Fence& signalFenceOnEnd = Fence() );
150 
157  void submit (
158  const std::vector< CommandBuffer > buffers,
159  const Semaphore& waitOnBegin = Semaphore(),
160  const Semaphore& signalOnEnd = Semaphore(),
161  const Fence& signalFenceOnEnd = Fence() );
162 
171  VkResult waitForIdle();
172 };
173 
174 // -----------------------------------------------------------------------------
175 } // namespace vpp
176 // -----------------------------------------------------------------------------
Represents logical rendering device.
Definition: vppDevice.hpp:49
EQueueType type() const
Retrieves the type of the queue.
const Device & device() const
Retrieves the parent device for the queue.
The VPP namespace.
Definition: main.hpp:1
Represents a sequence of Vulkan commands.
Definition: vppCommandBuffer.hpp:68
Allows the GPU to wait for another GPU operation to finish.
Definition: vppSynchronization.hpp:127
VkQueue handle() const
Retrieves Vulkan handle to the queue object.
Allows the CPU to wait for GPU operation to finish.
Definition: vppSynchronization.hpp:41
VkResult waitForIdle()
Waits until all operations on current queue are finished.
void submit(const CommandBuffer &singleBuffer, const Semaphore &waitOnBegin=Semaphore(), const Semaphore &signalOnEnd=Semaphore(), const Fence &signalFenceOnEnd=Fence())
Submits a command buffer (CommandBuffer object) for execution.
Command queue for execution of commands.
Definition: vppQueue.hpp:65
Queue()
Constructs null reference.