LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::CommandQueue Class Referenceabstract

Command queue interface. More...

#include <CommandQueue.h>

Inheritance diagram for LLGL::CommandQueue:
LLGL::RenderSystemChild LLGL::Interface LLGL::NonCopyable

Public Member Functions

virtual void Submit (CommandBuffer &commandBuffer)=0
 Submits the specified command buffer to the command queue.
virtual bool QueryResult (QueryHeap &queryHeap, std::uint32_t firstQuery, std::uint32_t numQueries, void *data, std::size_t dataSize)=0
 Retrieves the result of the specified query objects.
virtual void Submit (Fence &fence)=0
 Submits the specified fence to the command queue for CPU/GPU synchronization.
virtual bool WaitFence (Fence &fence, std::uint64_t timeout)=0
 Blocks the CPU execution until the specified fence has been signaled.
virtual void WaitIdle ()=0
 Blocks the CPU execution until the entire GPU command queue has been completed.
Public Member Functions inherited from LLGL::RenderSystemChild
virtual void SetDebugName (const char *name)
 Sets the name of this class instance for debugging purposes.
Public Member Functions inherited from LLGL::Interface
virtual bool IsInstanceOf (int id) const
 Returns true if this object is an instance of the specified interface.
Public Member Functions inherited from LLGL::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete
virtual ~NonCopyable ()=default

Protected Member Functions

 CommandQueue ()=default
Protected Member Functions inherited from LLGL::NonCopyable
 NonCopyable ()=default

Detailed Description

Command queue interface.

Remarks
This class is used to submit one or more command buffers (aka. command lists) into the command queue as well as CPU/GPU synchronization objects (aka. fences). For immediate command buffers, the CommandQueue::Submit function has no effect.

Constructor & Destructor Documentation

◆ CommandQueue()

LLGL::CommandQueue::CommandQueue ( )
protecteddefault

Member Function Documentation

◆ QueryResult()

virtual bool LLGL::CommandQueue::QueryResult ( QueryHeap & queryHeap,
std::uint32_t firstQuery,
std::uint32_t numQueries,
void * data,
std::size_t dataSize )
pure virtual

Retrieves the result of the specified query objects.

Parameters
[in]queryHeapSpecifies the query heap.
[in]firstQuerySpecifies the zero-based index of the first query within the heap. This must be in the half-open range [0, QueryHeapDescriptor::numQueries).
[in]numQueriesSpecifies the number of queries to retrieve the result from. This must be less than or equal to (QueryHeapDescriptor::numQueries - firstQuery) and it must not be zero.
[out]dataSpecifies the pointer to the output data. This must be a valid pointer to an array of numQueries entries. The array entries must have one of the following types:
  • std::uint32_t
  • std::uint64_t
  • QueryPipelineStatistics If the function return false, the content of this array is undefined.
[in]dataSizeSpecifies the size (in bytes) of the output data. This must be equal to numQueries * sizeof(T) where T is the type of the query entries described above.
Returns
True, if all results are available. Otherwise, the results are (partially) unavailable and the content of the output data is undefined.
Remarks
Here is a usage example:
// Get results of 10 occlusion queries
std::uint64_t occlusionQueryResults[10] = {};
myCmdQueue->QueryResult(*myOcclusionQuery, 0, 10, occlusionQueryResults, sizeof(occlusionQueryResults));
// Get result of a pipeline statistics query
myCmdQueue->QueryResult(*myPipelineStatsQuery, 0, 1, &stats, sizeof(stats));
Query data structure for pipeline statistics.
Definition QueryHeapFlags.h:76

◆ Submit() [1/2]

virtual void LLGL::CommandQueue::Submit ( CommandBuffer & commandBuffer)
pure virtual

Submits the specified command buffer to the command queue.

Parameters
[in]commandBufferSpecifies the command buffer that is to be submitted. If the command buffer was created with the CommandBufferFlags::ImmediateSubmit flag, this function has no effect.
Remarks
This must only be called with a command buffer that has already been encoded via the Begin and End functions:
myCmdBuffer->Begin();
// Encode/record command buffer ...
myCmdBuffer->End();
myCmdQueue->Submit(*myCmdBuffer);
See also
CommandBuffer::Begin
CommandBuffer::End
Submit(std::uint32_t, CommandBuffer* const *)

◆ Submit() [2/2]

virtual void LLGL::CommandQueue::Submit ( Fence & fence)
pure virtual

Submits the specified fence to the command queue for CPU/GPU synchronization.

◆ WaitFence()

virtual bool LLGL::CommandQueue::WaitFence ( Fence & fence,
std::uint64_t timeout )
pure virtual

Blocks the CPU execution until the specified fence has been signaled.

Parameters
[in]fenceSpecifies the fence for which the CPU needs to wait to be signaled.
[in]timeoutSpecifies the waiting timeout (in nanoseconds).
Returns
True on success, or false if the fence has a timeout (in nanoseconds) or the device is lost.
Remarks
To wait for the completion of the entire GPU command queue, use 'WaitIdle'.
See also
WaitIdle

◆ WaitIdle()

virtual void LLGL::CommandQueue::WaitIdle ( )
pure virtual

Blocks the CPU execution until the entire GPU command queue has been completed.

Remarks
To wait for a specific point in the command queue, use fences. Waiting for the queue to be become idle is equivalent to submitting a fence and waiting for that fence to be signaled:
myCmdQueue->Submit(myFence);
myCmdQueue->WaitFence(myFence, ~0);
See also
WaitFence

The documentation for this class was generated from the following file: