OGRE
14.2
Object-Oriented Graphics Rendering Engine
|
#include <OgreVulkanQueue.h>
Classes | |
struct | PerFrameData |
Public Types | |
enum | EncoderState { EncoderGraphicsOpen , EncoderComputeOpen , EncoderCopyOpen , EncoderClosed } |
enum | QueueFamily { Graphics , Compute , Transfer , NumQueueFamilies } |
Public Member Functions | |
VulkanQueue () | |
~VulkanQueue () | |
bool | _isFrameFinished (uint8 frameIdx) |
void | _waitOnFrame (uint8 frameIdx) |
void | addWindowToWaitFor (VkSemaphore imageAcquisitionSemaph) |
When we'll call commitAndNextCommandBuffer, we'll have to wait for this semaphore on to execute STAGE_COLOR_ATTACHMENT_OUTPUT_BIT. More... | |
void | commitAndNextCommandBuffer (SubmissionType::SubmissionType submissionType=SubmissionType::FlushOnly) |
void | destroy (void) |
void | endAllEncoders (bool endRenderPassDesc=true) |
void | endComputeEncoder (void) |
void | endCopyEncoder (void) |
void | endRenderEncoder (const bool endRenderPassDesc=true) |
void | getComputeEncoder (void) |
void | getCopyEncoder (const BufferPacked *buffer, VulkanTextureGpu *texture, const bool bDownload) |
Call this function when you need to start copy/transfer operations. More... | |
void | getCopyEncoderV1Buffer (const bool bDownload) |
EncoderState | getEncoderState (void) const |
uint32 | getFamilyIdx () const |
void | getGraphicsEncoder (void) |
void | init (VkDevice device, VkQueue queue, VulkanRenderSystem *renderSystem) |
void | notifyTextureDestroyed (VulkanTextureGpu *texture) |
void | queueForDeletion (const std::shared_ptr< VulkanDescriptorPool > &descriptorPool) |
void | queueForDeletion (VkBuffer buffer, VmaAllocation allocation) |
void | setQueueData (VulkanDevice *owner, QueueFamily family, uint32 familyIdx, uint32 queueIdx) |
Public Attributes | |
VkCommandBuffer | mCurrentCmdBuffer |
uint8 | mCurrentFrameIdx |
VkDevice | mDevice |
QueueFamily | mFamily |
uint32 | mFamilyIdx |
uint8 | mNumFramesInFlight |
VulkanDevice * | mOwnerDevice |
VkQueue | mQueue |
uint32 | mQueueIdx |
FastArray< VulkanWindow * > | mWindowsPendingSwap |
Ogre::VulkanQueue::VulkanQueue | ( | ) |
Ogre::VulkanQueue::~VulkanQueue | ( | ) |
|
inline |
void Ogre::VulkanQueue::setQueueData | ( | VulkanDevice * | owner, |
QueueFamily | family, | ||
uint32 | familyIdx, | ||
uint32 | queueIdx | ||
) |
void Ogre::VulkanQueue::init | ( | VkDevice | device, |
VkQueue | queue, | ||
VulkanRenderSystem * | renderSystem | ||
) |
void Ogre::VulkanQueue::destroy | ( | void | ) |
void Ogre::VulkanQueue::queueForDeletion | ( | VkBuffer | buffer, |
VmaAllocation | allocation | ||
) |
void Ogre::VulkanQueue::queueForDeletion | ( | const std::shared_ptr< VulkanDescriptorPool > & | descriptorPool | ) |
|
inline |
void Ogre::VulkanQueue::getGraphicsEncoder | ( | void | ) |
void Ogre::VulkanQueue::getComputeEncoder | ( | void | ) |
void Ogre::VulkanQueue::getCopyEncoder | ( | const BufferPacked * | buffer, |
VulkanTextureGpu * | texture, | ||
const bool | bDownload | ||
) |
Call this function when you need to start copy/transfer operations.
buffer and texture pointers cannot be both nullptr at the same time
You don't have to pair every getCopyEncoder call with an endCopyEncoder call. In fact this is discouraged.
Keep calling getCopyEncoder until you're done with all transfer operations
buffer | The buffer we're copying from/to. Can be nullptr |
texture | The texture we're copying from/to. Can be nullptr |
If uploading, the texture will be transitioned to VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL If downloading, the texture will be transitioned to VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
bDownload | True if we plan to do CPU -> GPU transfers False if we plan to do GPU -> CPU transfers |
If you want to perform GPU -> GPU transfers, then you need to call:
void Ogre::VulkanQueue::getCopyEncoderV1Buffer | ( | const bool | bDownload | ) |
void Ogre::VulkanQueue::endCopyEncoder | ( | void | ) |
void Ogre::VulkanQueue::endRenderEncoder | ( | const bool | endRenderPassDesc = true | ) |
void Ogre::VulkanQueue::endComputeEncoder | ( | void | ) |
void Ogre::VulkanQueue::endAllEncoders | ( | bool | endRenderPassDesc = true | ) |
void Ogre::VulkanQueue::notifyTextureDestroyed | ( | VulkanTextureGpu * | texture | ) |
void Ogre::VulkanQueue::addWindowToWaitFor | ( | VkSemaphore | imageAcquisitionSemaph | ) |
When we'll call commitAndNextCommandBuffer, we'll have to wait for this semaphore on to execute STAGE_COLOR_ATTACHMENT_OUTPUT_BIT.
void Ogre::VulkanQueue::_waitOnFrame | ( | uint8 | frameIdx | ) |
bool Ogre::VulkanQueue::_isFrameFinished | ( | uint8 | frameIdx | ) |
void Ogre::VulkanQueue::commitAndNextCommandBuffer | ( | SubmissionType::SubmissionType | submissionType = SubmissionType::FlushOnly | ) |
VkDevice Ogre::VulkanQueue::mDevice |
QueueFamily Ogre::VulkanQueue::mFamily |
uint32 Ogre::VulkanQueue::mFamilyIdx |
uint32 Ogre::VulkanQueue::mQueueIdx |
VkQueue Ogre::VulkanQueue::mQueue |
VkCommandBuffer Ogre::VulkanQueue::mCurrentCmdBuffer |
VulkanDevice* Ogre::VulkanQueue::mOwnerDevice |
uint8 Ogre::VulkanQueue::mNumFramesInFlight |
uint8 Ogre::VulkanQueue::mCurrentFrameIdx |
FastArray<VulkanWindow *> Ogre::VulkanQueue::mWindowsPendingSwap |