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

A command list, used to enqueue render commands on the CPU, before later executing them in a command queue. More...

#include <reshade_api_device.hpp>

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

Public Member Functions

void barrier (resource resource, resource_usage old_state, resource_usage new_state)
 Adds a barrier for the specified resource to the command stream. Multiple barriers are more efficiently issued using the command_list::barrier overload that takes arrays. When both old_state and new_state are resource_usage::unordered_access, a UAV barrier is added, otherwise a state transition is performed. More...
 
virtual void barrier (uint32_t count, const resource *resources, const resource_usage *old_states, const resource_usage *new_states)=0
 Adds a barrier for the specified resources to the command stream. More...
 
virtual void begin_render_pass (uint32_t count, const render_pass_render_target_desc *rts, const render_pass_depth_stencil_desc *ds=nullptr)=0
 Begins a render pass and binds render target and depth-stencil resource views. More...
 
virtual void end_render_pass ()=0
 Ends a render pass. This must be preceeded by a call to begin_render_pass. Render passes cannot be nested. More...
 
virtual void bind_render_targets_and_depth_stencil (uint32_t count, const resource_view *rtvs, resource_view dsv={ 0 })=0
 Binds individual render target and depth-stencil resource views. This must not be called between begin_render_pass and end_render_pass. More...
 
virtual void bind_pipeline (pipeline_stage stages, pipeline pipeline)=0
 Binds a pipeline state object. More...
 
void bind_pipeline_state (dynamic_state state, uint32_t value)
 Updates the specfified pipeline state to the specified value . This is only valid for states that have been listed in the dynamic states provided at creation of the currently bound pipeline state object (pipeline_subobject_type::dynamic_pipeline_states). More...
 
virtual void bind_pipeline_states (uint32_t count, const dynamic_state *states, const uint32_t *values)=0
 Updates the specfified pipeline states to the specified values . This is only valid for states that have been listed in the dynamic states provided at creation of the currently bound pipeline state object (pipeline_subobject_type::dynamic_pipeline_states). More...
 
virtual void bind_viewports (uint32_t first, uint32_t count, const viewport *viewports)=0
 Binds an array of viewports to the rasterizer stage. More...
 
virtual void bind_scissor_rects (uint32_t first, uint32_t count, const rect *rects)=0
 Binds an array of scissor rectangles to the rasterizer stage. More...
 
virtual void push_constants (shader_stage stages, pipeline_layout layout, uint32_t param, uint32_t first, uint32_t count, const void *values)=0
 Directly updates constant values in the specified shader pipeline stages. More...
 
virtual void push_descriptors (shader_stage stages, pipeline_layout layout, uint32_t param, const descriptor_table_update &update)=0
 Directly binds a temporary descriptor table for the specfified shader pipeline stage and updates with an array of descriptors. More...
 
void bind_descriptor_table (shader_stage stages, pipeline_layout layout, uint32_t param, descriptor_table table)
 Binds a single descriptor table. More...
 
virtual void bind_descriptor_tables (shader_stage stages, pipeline_layout layout, uint32_t first, uint32_t count, const descriptor_table *tables)=0
 Binds an array of descriptor tables. More...
 
virtual void bind_index_buffer (resource buffer, uint64_t offset, uint32_t index_size)=0
 Binds an index buffer to the input-assembler stage. More...
 
void bind_vertex_buffer (uint32_t index, resource buffer, uint64_t offset, uint32_t stride)
 Binds a single vertex buffer to the input-assembler stage. More...
 
virtual void bind_vertex_buffers (uint32_t first, uint32_t count, const resource *buffers, const uint64_t *offsets, const uint32_t *strides)=0
 Binds an array of vertex buffers to the input-assembler stage. More...
 
virtual void bind_stream_output_buffers (uint32_t first, uint32_t count, const api::resource *buffers, const uint64_t *offsets, const uint64_t *max_sizes, const api::resource *counter_buffers, const uint64_t *counter_offsets)=0
 Binds an array of buffers to the stream-output stage. More...
 
virtual void draw (uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance)=0
 Draws non-indexed primitives. More...
 
virtual void draw_indexed (uint32_t index_count, uint32_t instance_count, uint32_t first_index, int32_t vertex_offset, uint32_t first_instance)=0
 Draws indexed primitives. More...
 
virtual void dispatch (uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z)=0
 Performs a compute shader dispatch. More...
 
virtual void draw_or_dispatch_indirect (indirect_command type, resource buffer, uint64_t offset, uint32_t draw_count, uint32_t stride)=0
 Executes indirect draw or dispatch commands. More...
 
virtual void copy_resource (resource source, resource dest)=0
 Copies the entire contents of the source resource to the dest ination resource. Dimensions of the two resources have to match. More...
 
virtual void copy_buffer_region (resource source, uint64_t source_offset, resource dest, uint64_t dest_offset, uint64_t size)=0
 Copies a linear memory region from the source buffer to the dest ination buffer. More...
 
virtual void copy_buffer_to_texture (resource source, uint64_t source_offset, uint32_t row_length, uint32_t slice_height, resource dest, uint32_t dest_subresource, const subresource_box *dest_box=nullptr)=0
 Copies a texture region from the source buffer to the dest ination texture. More...
 
virtual void copy_texture_region (resource source, uint32_t source_subresource, const subresource_box *source_box, resource dest, uint32_t dest_subresource, const subresource_box *dest_box, filter_mode filter=filter_mode::min_mag_mip_point)=0
 Copies or blits a texture region from the source texture to the dest ination texture. More...
 
virtual void copy_texture_to_buffer (resource source, uint32_t source_subresource, const subresource_box *source_box, resource dest, uint64_t dest_offset, uint32_t row_length=0, uint32_t slice_height=0)=0
 Copies a texture region from the source texture to the dest ination buffer. More...
 
virtual void resolve_texture_region (resource source, uint32_t source_subresource, const subresource_box *source_box, resource dest, uint32_t dest_subresource, int32_t dest_x, int32_t dest_y, int32_t dest_z, format format)=0
 Copies a region from the multisampled source texture to the non-multisampled dest ination texture. More...
 
virtual void clear_depth_stencil_view (resource_view dsv, const float *depth, const uint8_t *stencil, uint32_t rect_count=0, const rect *rects=nullptr)=0
 Clears the resource referenced by the depth-stencil view. More...
 
virtual void clear_render_target_view (resource_view rtv, const float color[4], uint32_t rect_count=0, const rect *rects=nullptr)=0
 Clears the resource referenced by the render target view. More...
 
virtual void clear_unordered_access_view_uint (resource_view uav, const uint32_t values[4], uint32_t rect_count=0, const rect *rects=nullptr)=0
 Clears the resource referenced by the unordered access view. More...
 
virtual void clear_unordered_access_view_float (resource_view uav, const float values[4], uint32_t rect_count=0, const rect *rects=nullptr)=0
 Clears the resource referenced by the unordered access view. More...
 
virtual void generate_mipmaps (resource_view srv)=0
 Generates the lower mipmap levels for the specified shader resource view. Uses the largest mipmap level of the view to recursively generate the lower levels of the mipmap chain and stops with the smallest level that is specified by the view. More...
 
virtual void begin_query (query_heap heap, query_type type, uint32_t index)=0
 Begins a query. More...
 
virtual void end_query (query_heap heap, query_type type, uint32_t index)=0
 Ends a query. More...
 
virtual void copy_query_heap_results (query_heap heap, query_type type, uint32_t first, uint32_t count, resource dest, uint64_t dest_offset, uint32_t stride)=0
 Copies the results of queries in a query heap to a buffer resource. More...
 
virtual void begin_debug_event (const char *label, const float color[4]=nullptr)=0
 Opens a debug event region in the command list. 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 list. More...
 
virtual void dispatch_mesh (uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z)=0
 Performs a mesh shader dispatch. More...
 
virtual void dispatch_rays (resource raygen, uint64_t raygen_offset, uint64_t raygen_size, resource miss, uint64_t miss_offset, uint64_t miss_size, uint64_t miss_stride, resource hit_group, uint64_t hit_group_offset, uint64_t hit_group_size, uint64_t hit_group_stride, resource callable, uint64_t callable_offset, uint64_t callable_size, uint64_t callable_stride, uint32_t width, uint32_t height, uint32_t depth)=0
 Performs a ray tracing dispatch. More...
 
virtual void copy_acceleration_structure (resource_view source, resource_view dest, acceleration_structure_copy_mode mode)=0
 Copies or transforms data from the source acceleration structure to the dest ination acceleration structure. More...
 
virtual void build_acceleration_structure (acceleration_structure_type type, acceleration_structure_build_flags flags, uint32_t input_count, const acceleration_structure_build_input *inputs, api::resource scratch, uint64_t scratch_offset, resource_view source, resource_view dest, acceleration_structure_build_mode mode)=0
 Builds or updates an acceleration structure for ray tracing. 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 list, used to enqueue render commands on the CPU, before later executing them in a command queue.

Functionally equivalent to a 'ID3D11CommandList', 'ID3D12CommandList' or 'VkCommandBuffer'.

This class may NOT be used concurrently from multiple threads!

Member Function Documentation

◆ barrier() [1/2]

void reshade::api::command_list::barrier ( resource  resource,
resource_usage  old_state,
resource_usage  new_state 
)
inline

Adds a barrier for the specified resource to the command stream. Multiple barriers are more efficiently issued using the command_list::barrier overload that takes arrays. When both old_state and new_state are resource_usage::unordered_access, a UAV barrier is added, otherwise a state transition is performed.

Parameters
resourceResource to transition.
old_stateUsage flags describing how the resource was used before this barrier.
new_stateUsage flags describing how the resource will be used after this barrier.

◆ barrier() [2/2]

virtual void reshade::api::command_list::barrier ( uint32_t  count,
const resource resources,
const resource_usage old_states,
const resource_usage new_states 
)
pure virtual

Adds a barrier for the specified resources to the command stream.

Parameters
countNumber of resources to transition.
resourcesPointer to the first element of an array of resources to transition.
old_statesPointer to the first element of an array of usage flags describing how the resources were used before this barrier.
new_statesPointer to the first element of an array of usage flags describing how the resources will be used after this barrier.

◆ begin_debug_event()

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

Opens a debug event region in the command list.

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

◆ begin_query()

virtual void reshade::api::command_list::begin_query ( query_heap  heap,
query_type  type,
uint32_t  index 
)
pure virtual

Begins a query.

Parameters
heapQuery heap that will manage the results of the query.
typeType of the query to begin.
indexIndex of the query in the query heap.

◆ begin_render_pass()

virtual void reshade::api::command_list::begin_render_pass ( uint32_t  count,
const render_pass_render_target_desc rts,
const render_pass_depth_stencil_desc ds = nullptr 
)
pure virtual

Begins a render pass and binds render target and depth-stencil resource views.

Parameters
countNumber of render target views to bind.
rtsPointer to the first element of an array of render target descriptions.
dsOptional pointer to a depth-stencil description, or nullptr to bind none.

◆ bind_descriptor_table()

void reshade::api::command_list::bind_descriptor_table ( shader_stage  stages,
pipeline_layout  layout,
uint32_t  param,
descriptor_table  table 
)
inline

Binds a single descriptor table.

Parameters
stagesShader stages that will use the descriptors.
layoutPipeline layout that describes the descriptors.
paramIndex of the pipeline layout parameter that describes the descriptor table (root parameter index in D3D12, descriptor set index in Vulkan).
tableDescriptor table to bind.

◆ bind_descriptor_tables()

virtual void reshade::api::command_list::bind_descriptor_tables ( shader_stage  stages,
pipeline_layout  layout,
uint32_t  first,
uint32_t  count,
const descriptor_table tables 
)
pure virtual

Binds an array of descriptor tables.

Parameters
stagesShader stages that will use the descriptors.
layoutPipeline layout that describes the descriptors.
firstIndex of the first pipeline layout parameter that describes the first descriptor table to bind (root parameter index in D3D12, descriptor set index in Vulkan).
countNumber of descriptor tables to bind.
tablesPointer to the first element of an array of descriptor tables to bind.

◆ bind_index_buffer()

virtual void reshade::api::command_list::bind_index_buffer ( resource  buffer,
uint64_t  offset,
uint32_t  index_size 
)
pure virtual

Binds an index buffer to the input-assembler stage.

Parameters
bufferIndex buffer resource. This resource must have been created with the resource_usage::index_buffer usage.
offsetOffset (in bytes) from the start of the index buffer to the first index to use. In D3D9 this has to be 0.
index_sizeSize (in bytes) of each index. Can typically be 2 (16-bit indices) or 4 (32-bit indices).

◆ bind_pipeline()

virtual void reshade::api::command_list::bind_pipeline ( pipeline_stage  stages,
pipeline  pipeline 
)
pure virtual

Binds a pipeline state object.

Parameters
stagesPipeline stages to update with state from the pipeline state object.
pipelinePipeline state object to bind.

◆ bind_pipeline_state()

void reshade::api::command_list::bind_pipeline_state ( dynamic_state  state,
uint32_t  value 
)
inline

Updates the specfified pipeline state to the specified value . This is only valid for states that have been listed in the dynamic states provided at creation of the currently bound pipeline state object (pipeline_subobject_type::dynamic_pipeline_states).

Parameters
statePipeline state to update.
valueValue to update the pipeline state to.

◆ bind_pipeline_states()

virtual void reshade::api::command_list::bind_pipeline_states ( uint32_t  count,
const dynamic_state states,
const uint32_t *  values 
)
pure virtual

Updates the specfified pipeline states to the specified values . This is only valid for states that have been listed in the dynamic states provided at creation of the currently bound pipeline state object (pipeline_subobject_type::dynamic_pipeline_states).

Parameters
countNumber of pipeline states to update.
statesPointer to the first element of an array of pipeline states to update.
valuesPointer to the first element of an array of values to update the pipeline states to, with one for each state in states .

◆ bind_render_targets_and_depth_stencil()

virtual void reshade::api::command_list::bind_render_targets_and_depth_stencil ( uint32_t  count,
const resource_view rtvs,
resource_view  dsv = { 0 } 
)
pure virtual

Binds individual render target and depth-stencil resource views. This must not be called between begin_render_pass and end_render_pass.

See also
device_caps::bind_render_targets_and_depth_stencil
Parameters
countNumber of render target views to bind.
rtvsPointer to the first element of an array of render target views to bind.
dsvDepth-stencil view to bind, or zero to bind none.

◆ bind_scissor_rects()

virtual void reshade::api::command_list::bind_scissor_rects ( uint32_t  first,
uint32_t  count,
const rect rects 
)
pure virtual

Binds an array of scissor rectangles to the rasterizer stage.

See also
device_caps::multi_viewport
Parameters
firstIndex of the first scissor rectangle to bind. In D3D9, D3D10, D3D11 and D3D12 this has to be 0.
countNumber of scissor rectangles to bind.
rectsPointer to the first element of an array of scissor rectangles.

◆ bind_stream_output_buffers()

virtual void reshade::api::command_list::bind_stream_output_buffers ( uint32_t  first,
uint32_t  count,
const api::resource buffers,
const uint64_t *  offsets,
const uint64_t *  max_sizes,
const api::resource counter_buffers,
const uint64_t *  counter_offsets 
)
pure virtual

Binds an array of buffers to the stream-output stage.

Parameters
firstFirst stream-output slot for binding.
countNumber of stream-output targets to bind.
buffersPointer to the first element of an array of buffer resources. These resources must have been created with the resource_usage::stream_output usage.
offsetsPointer to the first element of an array of offset values, one for each buffer. Each offset is the number of bytes from the start of the buffer to the first element to write to.
max_sizesOptional pointer to an array of size values, one for each buffer. Can be nullptr or have elements set to UINT64_MAX to use the entire buffer.
counter_buffersPointer to the first element of an array of counter buffer resources. These resources must have been created with the resource_usage::stream_output usage.
counter_offsetsPointer to the first element of an array of counter offset values, one for each counter buffer. Each offset is the number of bytes from the start of the counter buffer to the first element to write to.

◆ bind_vertex_buffer()

void reshade::api::command_list::bind_vertex_buffer ( uint32_t  index,
resource  buffer,
uint64_t  offset,
uint32_t  stride 
)
inline

Binds a single vertex buffer to the input-assembler stage.

Parameters
indexInput slot for binding.
bufferVertex buffer resource. This resources must have been created with the resource_usage::vertex_buffer usage.
offsetOffset (in bytes) from the start of the vertex buffer to the first vertex element to use.
strideSize (in bytes) of the vertex element that will be used from the vertex buffer (is added to an element offset to advance to the next).

◆ bind_vertex_buffers()

virtual void reshade::api::command_list::bind_vertex_buffers ( uint32_t  first,
uint32_t  count,
const resource buffers,
const uint64_t *  offsets,
const uint32_t *  strides 
)
pure virtual

Binds an array of vertex buffers to the input-assembler stage.

Parameters
firstFirst input slot for binding.
countNumber of vertex buffers to bind.
buffersPointer to the first element of an array of vertex buffer resources. These resources must have been created with the resource_usage::vertex_buffer usage.
offsetsPointer to the first element of an array of offset values, one for each buffer. Each offset is the number of bytes from the start of the vertex buffer to the first vertex element to use.
stridesPointer to the first element of an array of stride values, one for each buffer. Each stride is the size (in bytes) of the vertex element that will be used from that vertex buffer (is added to an element offset to advance to the next).

◆ bind_viewports()

virtual void reshade::api::command_list::bind_viewports ( uint32_t  first,
uint32_t  count,
const viewport viewports 
)
pure virtual

Binds an array of viewports to the rasterizer stage.

See also
device_caps::multi_viewport
Parameters
firstIndex of the first viewport to bind. In D3D9, D3D10, D3D11 and D3D12 this has to be 0.
countNumber of viewports to bind.
viewportsPointer to the first element of an array of viewports.

◆ build_acceleration_structure()

virtual void reshade::api::command_list::build_acceleration_structure ( acceleration_structure_type  type,
acceleration_structure_build_flags  flags,
uint32_t  input_count,
const acceleration_structure_build_input inputs,
api::resource  scratch,
uint64_t  scratch_offset,
resource_view  source,
resource_view  dest,
acceleration_structure_build_mode  mode 
)
pure virtual

Builds or updates an acceleration structure for ray tracing.

The build input vertex, index and instance buffers have to be in the resource_usage::shader_resource_non_pixel state. The scratch resource has to be in the resource_usage::unordered_access state. The source and dest ination acceleration structure resources have to be in the resource_usage::acceleration_structure state.

See also
device_caps::ray_tracing
Parameters
typeType of the acceleration structure to build.
flagsAcceleration structure build options.
input_countNumber of build inputs.
inputsPointer to the first element of an array of build inputs describing the geometry of the acceleration structure to build.
scratchBuffer resource to use as scratch space during building.
scratch_offsetOffset (in bytes) into the scratch buffer.
sourceAcceleration structure to read data from when mode is acceleration_structure_build_mode::update, otherwise zero.
destAcceleration structure to write data to.
modeChoose between building a new or updating an existing acceleration structure.

◆ clear_depth_stencil_view()

virtual void reshade::api::command_list::clear_depth_stencil_view ( resource_view  dsv,
const float *  depth,
const uint8_t *  stencil,
uint32_t  rect_count = 0,
const rect rects = nullptr 
)
pure virtual

Clears the resource referenced by the depth-stencil view.

The resource the depth-stencil view points to has to be in the resource_usage::depth_stencil_write state.

Parameters
dsvResource view handle of the depth-stencil.
depthOptional value to clear the depth buffer with.
stencilOptional value to clear the stencil buffer with.
rect_countNumber of rectangles to clear in the depth-stencil resource, or zero to clear the whole resource.
rectsPointer to the first element of an array of rectangles.

◆ clear_render_target_view()

virtual void reshade::api::command_list::clear_render_target_view ( resource_view  rtv,
const float  color[4],
uint32_t  rect_count = 0,
const rect rects = nullptr 
)
pure virtual

Clears the resource referenced by the render target view.

The resource the render target view points to has to be in the resource_usage::render_target state.

Parameters
rtvResource view handle of the render target.
colorValue to clear the resource with.
rect_countNumber of rectangles to clear in the render target resource, or zero to clear the whole resource.
rectsPointer to the first element of an array of rectangles.

◆ clear_unordered_access_view_float()

virtual void reshade::api::command_list::clear_unordered_access_view_float ( resource_view  uav,
const float  values[4],
uint32_t  rect_count = 0,
const rect rects = nullptr 
)
pure virtual

Clears the resource referenced by the unordered access view.

The resource the unordered access view points to has to be in the resource_usage::unordered_access state.

Parameters
uavResource view handle of the unordered access view.
valuesValue to clear the resource with.
rect_countNumber of rectangles to clear in the unordered access resource, or zero to clear the whole resource.
rectsPointer to the first element of an array of rectangles.

◆ clear_unordered_access_view_uint()

virtual void reshade::api::command_list::clear_unordered_access_view_uint ( resource_view  uav,
const uint32_t  values[4],
uint32_t  rect_count = 0,
const rect rects = nullptr 
)
pure virtual

Clears the resource referenced by the unordered access view.

The resource the unordered access view points to has to be in the resource_usage::unordered_access state.

Parameters
uavResource view handle of the unordered access view.
valuesValue to clear the resource with.
rect_countNumber of rectangles to clear in the unordered access resource, or zero to clear the whole resource.
rectsPointer to the first element of an array of rectangles.

◆ copy_acceleration_structure()

virtual void reshade::api::command_list::copy_acceleration_structure ( resource_view  source,
resource_view  dest,
acceleration_structure_copy_mode  mode 
)
pure virtual

Copies or transforms data from the source acceleration structure to the dest ination acceleration structure.

The source and dest ination acceleration structure resources have to be in the resource_usage::acceleration_structure state.

See also
device_caps::ray_tracing
Parameters
sourceAcceleration structure to copy from.
destAcceleration structure to copy to.
modeChoose between copying or transforming the data in the acceleration structure.

◆ copy_buffer_region()

virtual void reshade::api::command_list::copy_buffer_region ( resource  source,
uint64_t  source_offset,
resource  dest,
uint64_t  dest_offset,
uint64_t  size 
)
pure virtual

Copies a linear memory region from the source buffer to the dest ination buffer.

The source resource has to be in the resource_usage::copy_source state. The dest ination resource has to be in the resource_usage::copy_dest state.

See also
device_caps::copy_buffer_region
Parameters
sourceBuffer resource to copy from.
source_offsetOffset (in bytes) into the source buffer to start copying at.
destBuffer resource to copy to.
dest_offsetOffset (in bytes) into the dest ination buffer to start copying to.
sizeNumber of bytes to copy.

◆ copy_buffer_to_texture()

virtual void reshade::api::command_list::copy_buffer_to_texture ( resource  source,
uint64_t  source_offset,
uint32_t  row_length,
uint32_t  slice_height,
resource  dest,
uint32_t  dest_subresource,
const subresource_box dest_box = nullptr 
)
pure virtual

Copies a texture region from the source buffer to the dest ination texture.

The source resource has to be in the resource_usage::copy_source state. The dest ination resource has to be in the resource_usage::copy_dest state.

See also
device_caps::copy_buffer_to_texture
Parameters
sourceBuffer resource to copy from.
source_offsetOffset (in bytes) into the source buffer to start copying at.
row_lengthNumber of pixels from one row to the next (in the buffer), or zero if data is tightly packed.
slice_heightNumber of rows from one slice to the next (in the buffer) or zero if data is tightly packed.
destTexture resource to copy to.
dest_subresourceIndex of the subresource of the dest ination texture to copy to.
dest_boxOptional 3D box (or nullptr to reference the entire subresource) that defines the region in the dest ination texture to copy to.

◆ copy_query_heap_results()

virtual void reshade::api::command_list::copy_query_heap_results ( query_heap  heap,
query_type  type,
uint32_t  first,
uint32_t  count,
resource  dest,
uint64_t  dest_offset,
uint32_t  stride 
)
pure virtual

Copies the results of queries in a query heap to a buffer resource.

The dest ination resource has to be in the resource_usage::copy_dest state.

See also
device_caps::copy_query_heap_results
Parameters
heapQuery heap that manages the results of the queries.
typeType of the queries to copy.
firstIndex of the first query in the query heap to copy the result from.
countNumber of query results to copy.
destBuffer resource to copy to.
dest_offsetOffset (in bytes) into the dest ination buffer to start copying to.
strideSize (in bytes) of each result element.

◆ copy_resource()

virtual void reshade::api::command_list::copy_resource ( resource  source,
resource  dest 
)
pure virtual

Copies the entire contents of the source resource to the dest ination resource. Dimensions of the two resources have to match.

The source resource has to be in the resource_usage::copy_source state. The dest ination resource has to be in the resource_usage::copy_dest state.

Parameters
sourceResource to copy from.
destResource to copy to.

◆ copy_texture_region()

virtual void reshade::api::command_list::copy_texture_region ( resource  source,
uint32_t  source_subresource,
const subresource_box source_box,
resource  dest,
uint32_t  dest_subresource,
const subresource_box dest_box,
filter_mode  filter = filter_mode::min_mag_mip_point 
)
pure virtual

Copies or blits a texture region from the source texture to the dest ination texture.

The source resource has to be in the resource_usage::copy_source state. The dest ination resource has to be in the resource_usage::copy_dest state.

See also
device_caps::blit
Parameters
sourceTexture resource to copy from.
source_subresourceIndex of the subresource of the source texture to copy from.
source_boxOptional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to blit from.
destTexture resource to copy to.
dest_subresourceIndex of the subresource of the dest ination texture to copy to.
dest_boxOptional 3D box (or nullptr to reference the entire subresource) that defines the region in the dest ination texture to blit to.
filterFilter to apply when copy requires scaling.

◆ copy_texture_to_buffer()

virtual void reshade::api::command_list::copy_texture_to_buffer ( resource  source,
uint32_t  source_subresource,
const subresource_box source_box,
resource  dest,
uint64_t  dest_offset,
uint32_t  row_length = 0,
uint32_t  slice_height = 0 
)
pure virtual

Copies a texture region from the source texture to the dest ination buffer.

The source resource has to be in the resource_usage::copy_source state. The dest ination resource has to be in the resource_usage::copy_dest state.

See also
device_caps::copy_buffer_to_texture
Parameters
sourceTexture resource to copy from.
source_subresourceIndex of the subresource of the source texture to copy from.
source_boxOptional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to copy from.
destBuffer resource to copy to.
dest_offsetOffset (in bytes) into the dest ination buffer to start copying to.
row_lengthNumber of pixels from one row to the next (in the buffer), or zero if data is tightly packed.
slice_heightNumber of rows from one slice to the next (in the buffer), or zero if data is tightly packed.

◆ dispatch()

virtual void reshade::api::command_list::dispatch ( uint32_t  group_count_x,
uint32_t  group_count_y,
uint32_t  group_count_z 
)
pure virtual

Performs a compute shader dispatch.

See also
device_caps::compute_shader
Parameters
group_count_xNumber of thread groups dispatched in the x direction.
group_count_yNumber of thread groups dispatched in the y direction.
group_count_zNumber of thread groups dispatched in the z direction.

◆ dispatch_mesh()

virtual void reshade::api::command_list::dispatch_mesh ( uint32_t  group_count_x,
uint32_t  group_count_y,
uint32_t  group_count_z 
)
pure virtual

Performs a mesh shader dispatch.

See also
device_caps::amplification_and_mesh_shader
Parameters
group_count_xNumber of thread groups dispatched in the x direction.
group_count_yNumber of thread groups dispatched in the y direction.
group_count_zNumber of thread groups dispatched in the z direction.

◆ dispatch_rays()

virtual void reshade::api::command_list::dispatch_rays ( resource  raygen,
uint64_t  raygen_offset,
uint64_t  raygen_size,
resource  miss,
uint64_t  miss_offset,
uint64_t  miss_size,
uint64_t  miss_stride,
resource  hit_group,
uint64_t  hit_group_offset,
uint64_t  hit_group_size,
uint64_t  hit_group_stride,
resource  callable,
uint64_t  callable_offset,
uint64_t  callable_size,
uint64_t  callable_stride,
uint32_t  width,
uint32_t  height,
uint32_t  depth 
)
pure virtual

Performs a ray tracing dispatch.

The buffer resources have to be in the resource_usage::shader_resource_non_pixel state.

See also
device_caps::ray_tracing
Parameters
raygenBuffer resource containing the ray generation shader handle to use.
missBuffer resource containing the miss shader handles to use.
hit_groupBuffer resource containing the hit group handles to use.
callableBuffer resource containing the callable shader handles to use.
widthWidth of the ray generation shader thread grid.
heightHeight of the ray generation shader thread grid.
depthDepth of the ray generation shader thread grid.

◆ draw()

virtual void reshade::api::command_list::draw ( uint32_t  vertex_count,
uint32_t  instance_count,
uint32_t  first_vertex,
uint32_t  first_instance 
)
pure virtual

Draws non-indexed primitives.

See also
device_caps::draw_instanced
Parameters
vertex_countNumber of vertices to draw.
instance_countNumber of instances to draw. In D3D9 this has to be 1.
first_vertexIndex of the first vertex.
first_instanceValue added to each index before reading per-instance data from a vertex buffer. In D3D9 this has to be 0.

◆ draw_indexed()

virtual void reshade::api::command_list::draw_indexed ( uint32_t  index_count,
uint32_t  instance_count,
uint32_t  first_index,
int32_t  vertex_offset,
uint32_t  first_instance 
)
pure virtual

Draws indexed primitives.

See also
device_caps::draw_instanced
Parameters
index_countNumber of indices read from the index buffer for each instance.
instance_countNumber of instances to draw. In D3D9 this has to be 1.
first_indexLocation of the first index read from the index buffer.
vertex_offsetValue added to each index before reading per-vertex data from a vertex buffer.
first_instanceValue added to each index before reading per-instance data from a vertex buffer. In D3D9 this has to be 0.

◆ draw_or_dispatch_indirect()

virtual void reshade::api::command_list::draw_or_dispatch_indirect ( indirect_command  type,
resource  buffer,
uint64_t  offset,
uint32_t  draw_count,
uint32_t  stride 
)
pure virtual

Executes indirect draw or dispatch commands.

See also
device_caps::draw_or_dispatch_indirect
Parameters
typeSpecifies whether this is an indirect draw, indexed draw or dispatch command.
bufferBuffer resource that contains command arguments.
offsetOffset (in bytes) from the start of the argument buffer to the first argument to use.
draw_countNumber of commands to execute.
strideStride (in bytes) between commands in the argument buffer.

◆ end_debug_event()

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

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

◆ end_query()

virtual void reshade::api::command_list::end_query ( query_heap  heap,
query_type  type,
uint32_t  index 
)
pure virtual

Ends a query.

Parameters
heapQuery heap that will manage the results of the query.
typeType of the query end.
indexIndex of the query in the query heap.

◆ end_render_pass()

virtual void reshade::api::command_list::end_render_pass ( )
pure virtual

Ends a render pass. This must be preceeded by a call to begin_render_pass. Render passes cannot be nested.

◆ generate_mipmaps()

virtual void reshade::api::command_list::generate_mipmaps ( resource_view  srv)
pure virtual

Generates the lower mipmap levels for the specified shader resource view. Uses the largest mipmap level of the view to recursively generate the lower levels of the mipmap chain and stops with the smallest level that is specified by the view.

This will invalidate all previous descriptor and pipeline bindings, which will need to be reset by calls to bind_descriptor_tables or push_descriptors and bind_pipeline. The resource the shader resource view points to has to be in the resource_usage::shader_resource state and has to have been created with the resource_flags::generate_mipmaps flag.

Parameters
srvShader resource view to update.

◆ insert_debug_marker()

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

Inserts a debug marker into the command list.

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

◆ push_constants()

virtual void reshade::api::command_list::push_constants ( shader_stage  stages,
pipeline_layout  layout,
uint32_t  param,
uint32_t  first,
uint32_t  count,
const void *  values 
)
pure virtual

Directly updates constant values in the specified shader pipeline stages.

In D3D9 this updates the values of uniform registers, in D3D10/11 and OpenGL the constant buffer specified in the pipeline layout, in D3D12 it sets root constants and in Vulkan push constants.

See also
device_caps::partial_push_constant_updates
Parameters
stagesShader stages that will use the updated constants.
layoutPipeline layout that describes where the constants are located.
paramLayout parameter index of the constant range in the pipeline layout (root parameter index in D3D12).
firstStart offset (in 32-bit values) to the first constant in the constant range to begin updating.
countNumber of 32-bit values to update.
valuesPointer to the first element of an array of 32-bit values to set the constants to. These can be floating-point, integer or boolean depending on what the shader is expecting.

◆ push_descriptors()

virtual void reshade::api::command_list::push_descriptors ( shader_stage  stages,
pipeline_layout  layout,
uint32_t  param,
const descriptor_table_update update 
)
pure virtual

Directly binds a temporary descriptor table for the specfified shader pipeline stage and updates with an array of descriptors.

See also
device_caps::partial_push_descriptor_updates
Parameters
stagesShader stages that will use the updated descriptors.
layoutPipeline layout that describes the descriptors.
paramLayout parameter index of the descriptor table in the pipeline layout (root parameter index in D3D12, descriptor set index in Vulkan).
updateRange of descriptors to update in the temporary descriptor table (descriptor_table_update::table is ignored).

◆ resolve_texture_region()

virtual void reshade::api::command_list::resolve_texture_region ( resource  source,
uint32_t  source_subresource,
const subresource_box source_box,
resource  dest,
uint32_t  dest_subresource,
int32_t  dest_x,
int32_t  dest_y,
int32_t  dest_z,
format  format 
)
pure virtual

Copies a region from the multisampled source texture to the non-multisampled dest ination texture.

The source resource has to be in the resource_usage::resolve_source state. The dest ination resource has to be in the resource_usage::resolve_dest state.

See also
device_caps::resolve_region, device_caps::resolve_depth_stencil
Parameters
sourceTexture resource to resolve from.
source_subresourceIndex of the subresource of the source texture to resolve from.
source_boxOptional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to resolve.
destTexture resource to resolve to.
dest_subresourceIndex of the subresource of the dest ination texture to resolve to.
dest_xOptional X offset (in texels) that defines the region in the dest ination texture to resolve to.
dest_yOptional Y offset (in texels) that defines the region in the dest ination texture to resolve to.
dest_zOptional Z offset (in texels) that defines the region in the dest ination texture to resolve to.
formatFormat of the resource data.

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