ReShade
A generic post-processing injector for games and video software.
Public Member Functions | List of all members
reshade::api::command_queue Struct Referenceabstract

A command queue, used to execute command lists on the GPU. More...

#include <reshade_api_device.hpp>

Inheritance diagram for reshade::api::command_queue:
reshade::api::device_object reshade::api::api_object

Public Member Functions

virtual command_queue_type get_type () const =0
 Gets the type of the command queue, which specifies what commands can be executed on it. More...
 
virtual void wait_idle () const =0
 Waits for all issued GPU operations on this queue to finish before returning. This can be used to ensure that e.g. resources are no longer in use on the GPU before destroying them. More...
 
virtual void flush_immediate_command_list () const =0
 Flushes and executes the special immediate command list returned by get_immediate_command_list immediately. This can be used to force commands to execute right away instead of waiting for the runtime to flush it automatically at some point. More...
 
virtual command_listget_immediate_command_list ()=0
 Gets a special command list, on which all issued commands are executed as soon as possible (or right before the application executes its next command list on this queue). This only exists on command queues that contain the command_queue_type::graphics flag, on other queues nullptr is returned. More...
 
virtual void begin_debug_event (const char *label, const float color[4]=nullptr)=0
 Opens a debug event region in the command queue. More...
 
virtual void end_debug_event ()=0
 Closes the current debug event region (the last one opened with begin_debug_event). More...
 
virtual void insert_debug_marker (const char *label, const float color[4]=nullptr)=0
 Inserts a debug marker into the command queue. More...
 
virtual bool wait (fence fence, uint64_t value)=0
 Queues a GPU-side wait until the specified fence reaches the specified value and returns immediately. More...
 
virtual bool signal (fence fence, uint64_t value)=0
 Queues a GPU-side update of the specified fence to the specified value after previous operations finished executing. More...
 
virtual uint64_t get_timestamp_frequency () const =0
 Queries the GPU timestamp frequency in ticks per second. More...
 
- Public Member Functions inherited from reshade::api::device_object
virtual deviceget_device ()=0
 Gets the parent device for this object. More...
 
- Public Member Functions inherited from reshade::api::api_object
virtual uint64_t get_native () const =0
 Gets the underlying native object for this API object. More...
 
virtual void get_private_data (const uint8_t guid[16], uint64_t *data) const =0
 Gets a user-defined 64-bit value from the object that was previously set via set_private_data, or zero if none associated with the specified guid exists. More...
 
virtual void set_private_data (const uint8_t guid[16], const uint64_t data)=0
 Stores a user-defined 64-bit value in the object and associates it with the specified guid . More...
 
template<typename T >
T & get_private_data () const
 Gets a reference to user-defined data from the object that was previously allocated via create_private_data. More...
 
template<typename T , typename... Args>
T & create_private_data (Args &&... args)
 Allocates user-defined data and stores it in the object. More...
 
template<typename T >
void destroy_private_data ()
 Frees user-defined data that was previously allocated via create_private_data. More...
 

Detailed Description

A command queue, used to execute command lists on the GPU.

Functionally equivalent to the immediate 'ID3D11DeviceContext' or a 'ID3D12CommandQueue' or 'VkQueue'.

This class may NOT be used concurrently from multiple threads!

Member Function Documentation

◆ begin_debug_event()

virtual void reshade::api::command_queue::begin_debug_event ( const char *  label,
const float  color[4] = nullptr 
)
pure virtual

Opens a debug event region in the command queue.

Parameters
labelNull-terminated string containing the label of the event.
colorOptional RGBA color value associated with the event.

◆ end_debug_event()

virtual void reshade::api::command_queue::end_debug_event ( )
pure virtual

Closes the current debug event region (the last one opened with begin_debug_event).

◆ flush_immediate_command_list()

virtual void reshade::api::command_queue::flush_immediate_command_list ( ) const
pure virtual

Flushes and executes the special immediate command list returned by get_immediate_command_list immediately. This can be used to force commands to execute right away instead of waiting for the runtime to flush it automatically at some point.

◆ get_immediate_command_list()

virtual command_list* reshade::api::command_queue::get_immediate_command_list ( )
pure virtual

Gets a special command list, on which all issued commands are executed as soon as possible (or right before the application executes its next command list on this queue). This only exists on command queues that contain the command_queue_type::graphics flag, on other queues nullptr is returned.

◆ get_timestamp_frequency()

virtual uint64_t reshade::api::command_queue::get_timestamp_frequency ( ) const
pure virtual

Queries the GPU timestamp frequency in ticks per second.

Returns
Timestamp frequency in number of ticks per second, or zero if GPU timestamps are not supported on this queue.

◆ get_type()

virtual command_queue_type reshade::api::command_queue::get_type ( ) const
pure virtual

Gets the type of the command queue, which specifies what commands can be executed on it.

◆ insert_debug_marker()

virtual void reshade::api::command_queue::insert_debug_marker ( const char *  label,
const float  color[4] = nullptr 
)
pure virtual

Inserts a debug marker into the command queue.

Parameters
labelNull-terminated string containing the label of the debug marker.
colorOptional RGBA color value associated with the debug marker.

◆ signal()

virtual bool reshade::api::command_queue::signal ( fence  fence,
uint64_t  value 
)
pure virtual

Queues a GPU-side update of the specified fence to the specified value after previous operations finished executing.

Parameters
fenceFence to update.
valueValue the fence should be set to.
Returns
true if the signal operation was successfully enqueued, false otherwise.

◆ wait()

virtual bool reshade::api::command_queue::wait ( fence  fence,
uint64_t  value 
)
pure virtual

Queues a GPU-side wait until the specified fence reaches the specified value and returns immediately.

Parameters
fenceFence to wait on.
valueValue the fence has to reach or exceed.
Returns
true if the wait operation was successfully enqueued, false otherwise.

◆ wait_idle()

virtual void reshade::api::command_queue::wait_idle ( ) const
pure virtual

Waits for all issued GPU operations on this queue to finish before returning. This can be used to ensure that e.g. resources are no longer in use on the GPU before destroying them.


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