![]() |
ReShade
A generic post-processing injector for games and video software.
|
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>
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. 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. 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. 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_set_update &update)=0 |
Directly binds a temporary descriptor set for the specfified shader pipeline stage and updates with an array of descriptors. More... | |
void | bind_descriptor_set (shader_stage stages, pipeline_layout layout, uint32_t param, descriptor_set set) |
Binds a single descriptor set. More... | |
virtual void | bind_descriptor_sets (shader_stage stages, pipeline_layout layout, uint32_t first, uint32_t count, const descriptor_set *sets)=0 |
Binds an array of descriptor sets. 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)=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 mip and stops with the smallest level that is specified by the view. More... | |
virtual void | begin_query (query_pool pool, query_type type, uint32_t index)=0 |
Begins a query. More... | |
virtual void | end_query (query_pool pool, query_type type, uint32_t index)=0 |
Ends a query. More... | |
virtual void | copy_query_pool_results (query_pool pool, query_type type, uint32_t first, uint32_t count, resource dest, uint64_t dest_offset, uint32_t stride)=0 |
Copy the results of queries in a query pool 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 device * | get_device ()=0 |
Gets the parent device for this object. More... | |
![]() | |
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 > | |
T & | create_private_data () |
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... | |
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!
|
inline |
Adds a barrier for the specified resource to the command stream. When both old_state and new_state are resource_usage::unordered_access a UAV barrier is added, otherwise a state transition is performed.
resource | Resource to transition. |
old_state | Usage flags describing how the resource was used before this barrier. |
new_state | Usage flags describing how the resource will be used after this barrier. |
|
pure virtual |
Adds a barrier for the specified resources to the command stream.
count | Number of resources to transition. |
resources | Pointer to an array of resources to transition. |
old_states | Pointer to an array of usage flags describing how the resources were used before this barrier. |
new_states | Pointer to an array of usage flags describing how the resources will be used after this barrier. |
|
pure virtual |
Opens a debug event region in the command list.
label | Null-terminated string containing the label of the event. |
color | Optional RGBA color value associated with the event. |
|
pure virtual |
Begins a query.
pool | Query pool that will manage the results of the query. |
type | Type of the query to begin. |
index | Index of the query in the pool. |
|
pure virtual |
Begins a render pass and binds render target and depth-stencil resource views.
count | Number of render target views to bind. |
rts | Pointer to an array of render target descriptions. |
ds | Optional pointer to a depth-stencil description, or nullptr to bind none. |
|
inline |
Binds a single descriptor set.
stages | Shader stages that will use the descriptors. |
layout | Pipeline layout that describes the descriptors. |
param | Index of the pipeline layout parameter that describes the descriptor set (root parameter index in D3D12, descriptor set index in Vulkan). |
set | Descriptor set to bind. |
|
pure virtual |
Binds an array of descriptor sets.
stages | Shader stages that will use the descriptors. |
layout | Pipeline layout that describes the descriptors. |
first | Index of the first pipeline layout parameter that describes the first descriptor set to bind. |
count | Number of descriptor sets to bind. |
sets | Pointer to an array of descriptor sets to bind. |
|
pure virtual |
Binds an index buffer to the input-assembler stage.
buffer | Index buffer resource. This resource must have been created with the resource_usage::index_buffer usage. |
offset | Offset (in bytes) from the start of the index buffer to the first index to use. In D3D9 this has to be 0. |
index_size | Size (in bytes) of each index. Can typically be 2 (16-bit indices) or 4 (32-bit indices). |
|
pure virtual |
Binds a pipeline state object.
stages | Pipeline stages to update with state from the pipeline state object. |
pipeline | Pipeline state object to bind. |
|
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.
state | Pipeline state to update. |
value | Value to update the pipeline state to. |
|
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.
count | Number of pipeline states to update. |
states | Pointer to an array of pipeline states to update. |
values | Pointer to an array of values to update the pipeline states to, with one for each state in states . |
|
pure virtual |
Binds individual render target and depth-stencil resource views. This must not be called between begin_render_pass and end_render_pass.
This is not supported (and will do nothing) in Vulkan.
count | Number of render target views to bind. |
rtvs | Pointer to an array of render target views to bind. |
dsv | Depth-stencil view to bind, or zero to bind none. |
|
pure virtual |
Binds an array of scissor rectangles to the rasterizer stage.
first | Index of the first scissor rectangle to bind. In D3D9, D3D10, D3D11 and D3D12 this has to be 0. |
count | Number of scissor rectangles to bind. In D3D9 this has to be 1. |
rects | Pointer to an array of scissor rectangles. |
|
pure virtual |
Binds an array of buffers to the stream-output stage.
first | First stream-output slot for binding. |
count | Number of stream-output targets to bind. |
buffers | Pointer to an array of buffer resources. These resources must have been created with the resource_usage::stream_output usage. |
offsets | Pointer to 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_sizes | Optional 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. |
|
inline |
Binds a single vertex buffer to the input-assembler stage.
index | Input slot for binding. |
buffer | Vertex buffer resource. This resources must have been created with the resource_usage::vertex_buffer usage. |
offset | Offset (in bytes) from the start of the vertex buffer to the first vertex element to use. |
stride | Size (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). |
|
pure virtual |
Binds an array of vertex buffers to the input-assembler stage.
first | First input slot for binding. |
count | Number of vertex buffers to bind. |
buffers | Pointer to an array of vertex buffer resources. These resources must have been created with the resource_usage::vertex_buffer usage. |
offsets | Pointer to 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. |
strides | Pointer to 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). |
|
pure virtual |
Binds an array of viewports to the rasterizer stage.
first | Index of the first viewport to bind. In D3D9, D3D10, D3D11 and D3D12 this has to be 0. |
count | Number of viewports to bind. In D3D9 this has to be 1. |
viewports | Pointer to an array of viewports. |
|
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.
dsv | Resource view handle of the depth-stencil. |
depth | Optional value to clear the depth buffer with. |
stencil | Optional value to clear the stencil buffer with. |
rect_count | Number of rectangles to clear in the depth-stencil resource, or zero to clear the whole resource. |
rects | Pointer to an array of rectangles. |
|
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.
rtv | Resource view handle of the render target. |
color | Value to clear the resource with. |
rect_count | Number of rectangles to clear in the render target resource, or zero to clear the whole resource. |
rects | Pointer to an array of rectangles. |
|
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.
uav | Resource view handle of the unordered access view. |
values | Value to clear the resource with. |
rect_count | Number of rectangles to clear in the unordered access resource, or zero to clear the whole resource. |
rects | Pointer to an array of rectangles. |
|
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.
uav | Resource view handle of the unordered access view. |
values | Value to clear the resource with. |
rect_count | Number of rectangles to clear in the unordered access resource, or zero to clear the whole resource. |
rects | Pointer to an array of rectangles. |
|
pure virtual |
Copies a linear memory region from the source buffer to the dest ination buffer.
This is not supported (and will do nothing) in D3D9. 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.
source | Buffer resource to copy from. |
source_offset | Offset (in bytes) into the source buffer to start copying at. |
dest | Buffer resource to copy to. |
dest_offset | Offset (in bytes) into the dest ination buffer to start copying to. |
size | Number of bytes to copy. |
|
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.
source | Buffer resource to copy from. |
source_offset | Offset (in bytes) into the source buffer to start copying at. |
row_length | Number of pixels from one row to the next (in the buffer), or zero if data is tightly packed. |
slice_height | Number of rows from one slice to the next (in the buffer) or zero if data is tightly packed. |
dest | Texture resource to copy to. |
dest_subresource | Index of the subresource of the dest ination texture to copy to. |
dest_box | Optional 3D box (or nullptr to reference the entire subresource) that defines the region in the dest ination texture to copy to. |
|
pure virtual |
Copy the results of queries in a query pool to a buffer resource.
The dest ination resource has to be in the resource_usage::copy_dest state.
pool | Query pool that manages the results of the queries. |
type | Type of the queries to copy. |
first | Index of the first query in the pool to copy the result from. |
count | Number of query results to copy. |
dest | Buffer resource to copy to. |
dest_offset | Offset (in bytes) into the dest ination buffer to start copying to. |
stride | Size (in bytes) of each result element. |
|
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.
source | Resource to copy from. |
dest | Resource to copy to. |
|
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.
source | Texture resource to copy from. |
source_subresource | Index of the subresource of the source texture to copy from. |
source_box | Optional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to blit from. |
dest | Texture resource to copy to. |
dest_subresource | Index of the subresource of the dest ination texture to copy to. |
dest_box | Optional 3D box (or nullptr to reference the entire subresource) that defines the region in the dest ination texture to blit to. |
filter | Filter to apply when copy requires scaling. |
|
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.
source | Texture resource to copy from. |
source_subresource | Index of the subresource of the source texture to copy from. |
source_box | Optional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to copy from. |
dest | Buffer resource to copy to. |
dest_offset | Offset (in bytes) into the dest ination buffer to start copying to. |
row_length | Number of pixels from one row to the next (in the buffer), or zero if data is tightly packed. |
slice_height | Number of rows from one slice to the next (in the buffer), or zero if data is tightly packed. |
|
pure virtual |
Performs a compute shader dispatch.
This is not supported (and will do nothing) in D3D9 and D3D10.
group_count_x | Number of thread groups dispatched in the x direction. |
group_count_y | Number of thread groups dispatched in the y direction. |
group_count_z | Number of thread groups dispatched in the z direction. |
|
pure virtual |
Draws non-indexed primitives.
vertex_count | Number of vertices to draw. |
instance_count | Number of instances to draw. In D3D9 this has to be 1. |
first_vertex | Index of the first vertex. |
first_instance | Value added to each index before reading per-instance data from a vertex buffer. In D3D9 this has to be 0. |
|
pure virtual |
Draws indexed primitives.
index_count | Number of indices read from the index buffer for each instance. |
instance_count | Number of instances to draw. In D3D9 this has to be 1. |
first_index | Location of the first index read from the index buffer. |
vertex_offset | Value added to each index before reading per-vertex data from a vertex buffer. |
first_instance | Value added to each index before reading per-instance data from a vertex buffer. In D3D9 this has to be 0. |
|
pure virtual |
Executes indirect draw or dispatch commands.
This is not supported (and will do nothing) in D3D9 and D3D10.
type | Specifies whether this is an indirect draw, indexed draw or dispatch command. |
buffer | Buffer resource that contains command arguments. |
offset | Offset (in bytes) from the start of the argument buffer to the first argument to use. |
draw_count | Number of commands to execute. |
stride | Stride (in bytes) between commands in the argument buffer. |
|
pure virtual |
Closes the current debug event region (the last one opened with begin_debug_event).
|
pure virtual |
Ends a query.
pool | Query pool that will manage the results of the query. |
type | Type of the query end. |
index | Index of the query in the pool. |
|
pure virtual |
Ends a render pass. This must be preceeded by a call to begin_render_pass. Render passes cannot be nested.
|
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 mip and stops with the smallest level that is specified by the view.
This will invalidate all previous descriptor bindings, which will need to be reset by calls to bind_descriptor_set or push_descriptors. 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.
srv | Shader resource view to update. |
|
pure virtual |
Inserts a debug marker into the command list.
label | Null-terminated string containing the label of the debug marker. |
color | Optional RGBA color value associated with the debug marker. |
|
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.
stages | Shader stages that will use the updated constants. |
layout | Pipeline layout that describes where the constants are located. |
param | Layout parameter index of the constant range in the pipeline layout (root parameter index in D3D12). |
first | Start offset (in 32-bit values) to the first constant in the constant range to begin updating. |
count | Number of 32-bit values to update. |
values | Pointer to 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. |
|
pure virtual |
Directly binds a temporary descriptor set for the specfified shader pipeline stage and updates with an array of descriptors.
stages | Shader stages that will use the updated descriptors. |
layout | Pipeline layout that describes the descriptors. |
param | Layout parameter index of the descriptor set in the pipeline layout (root parameter index in D3D12, descriptor set index in Vulkan). |
update | Range of descriptors to update in the temporary set (descriptor_set_update::set is ignored). |
|
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.
source | Texture resource to resolve from. |
source_subresource | Index of the subresource of the source texture to resolve from. |
source_box | Optional 3D box (or nullptr to reference the entire subresource) that defines the region in the source texture to resolve. In D3D10 and D3D11 this has to be nullptr . |
dest | Texture resource to resolve to. |
dest_subresource | Index of the subresource of the dest ination texture to resolve to. |
dest_x | Optional X offset (in texels) that defines the region in the dest ination texture to resolve to. In D3D10 and D3D11 this has to be zero. |
dest_y | Optional Y offset (in texels) that defines the region in the dest ination texture to resolve to. In D3D10 and D3D11 this has to be zero. |
dest_z | Optional Z offset (in texels) that defines the region in the dest ination texture to resolve to. In D3D10 and D3D11 this has to be zero. |
format | Format of the resource data. |