8 #define RESHADE_DEFINE_HANDLE(name) \
9 typedef struct { uint64_t handle; } name; \
10 constexpr bool operator< (name lhs, name rhs) { return lhs.handle < rhs.handle; } \
11 constexpr bool operator!=(name lhs, name rhs) { return lhs.handle != rhs.handle; } \
12 constexpr bool operator!=(name lhs, uint64_t rhs) { return lhs.handle != rhs; } \
13 constexpr bool operator==(name lhs, name rhs) { return lhs.handle == rhs.handle; } \
14 constexpr bool operator==(name lhs, uint64_t rhs) { return lhs.handle == rhs; }
16 #define RESHADE_DEFINE_ENUM_FLAG_OPERATORS(type) \
17 constexpr type operator~(type a) { return static_cast<type>(~static_cast<uint32_t>(a)); } \
18 inline type &operator&=(type &a, type b) { return reinterpret_cast<type &>(reinterpret_cast<uint32_t &>(a) &= static_cast<uint32_t>(b)); } \
19 constexpr type operator&(type a, type b) { return static_cast<type>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); } \
20 inline type &operator|=(type &a, type b) { return reinterpret_cast<type &>(reinterpret_cast<uint32_t &>(a) |= static_cast<uint32_t>(b)); } \
21 constexpr type operator|(type a, type b) { return static_cast<type>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); } \
22 inline type &operator^=(type &a, type b) { return reinterpret_cast<type &>(reinterpret_cast<uint32_t &>(a) ^= static_cast<uint32_t>(b)); } \
23 constexpr type operator^(type a, type b) { return static_cast<type>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); } \
24 constexpr bool operator==(type lhs, uint32_t rhs) { return static_cast<uint32_t>(lhs) == rhs; } \
25 constexpr bool operator!=(type lhs, uint32_t rhs) { return static_cast<uint32_t>(lhs) != rhs; }
29 namespace reshade {
namespace api
259 type(type), texture({ width, height, depth_or_layers, levels,
format, samples }), heap(heap), usage(usage),
flags(flags) {}
299 uint16_t depth_or_layers = 1;
312 uint16_t samples = 1;
370 type(type),
format(
format), texture({ first_level, levels, first_layer, layers }) {}
397 uint64_t size = UINT64_MAX;
408 uint32_t first_level = 0;
413 uint32_t level_count = UINT32_MAX;
417 uint32_t first_layer = 0;
422 uint32_t layer_count = UINT32_MAX;
622 float transform[3][4];
636 constexpr
acceleration_structure_build_input(
api::resource vertex_buffer, uint64_t vertex_offset, uint32_t vertex_count, uint64_t vertex_stride,
api::format vertex_format,
api::resource index_buffer, uint64_t index_offset, uint32_t index_count,
api::format index_format, uint64_t transform_address = 0) : type(
acceleration_structure_build_input_type::
triangles),
triangles({
vertex_buffer, vertex_offset, vertex_count, vertex_stride, vertex_format,
index_buffer, index_offset, index_count, index_format, transform_address }) {}
653 uint64_t vertex_offset = 0;
654 uint32_t vertex_count = 0;
655 uint64_t vertex_stride = 0;
658 uint64_t index_offset = 0;
659 uint32_t index_count = 0;
662 uint64_t transform_offset = 0;
684 bool array_of_pointers =
false;
resource_view_type
Type of a resource view. This identifies how a resource view interprets the data of its resource.
Definition: reshade_api_resource.hpp:342
@ texture_2d_multisample_array
acceleration_structure_build_mode
Type of an acceleration structure build operation.
Definition: reshade_api_resource.hpp:576
acceleration_structure_type
Type of an acceleration structure.
Definition: reshade_api_resource.hpp:555
compare_op
Comparison operations.
Definition: reshade_api_resource.hpp:35
render_pass_store_op
Specifies how the contents of a render target or depth-stencil view are treated at the end of a rende...
Definition: reshade_api_resource.hpp:487
resource_type
Type of a resource. This is specified during creation and is immutable. Various operations may have s...
Definition: reshade_api_resource.hpp:169
memory_heap
Memory heap types, which give a hint as to where to place the allocation for a resource.
Definition: reshade_api_resource.hpp:153
acceleration_structure_build_input_type
Type of an acceleration structure structure build input.
Definition: reshade_api_resource.hpp:599
render_pass_load_op
Specifies how the contents of a render target or depth-stencil view are treated at the start of a ren...
Definition: reshade_api_resource.hpp:476
map_access
Memory mapping access types.
Definition: reshade_api_resource.hpp:142
acceleration_structure_copy_mode
Type of an acceleration structure copy operation.
Definition: reshade_api_resource.hpp:565
acceleration_structure_build_flags
Flags that specify additional parameters to an acceleration structure build operation.
Definition: reshade_api_resource.hpp:585
acceleration_structure_build_input_flags
Flags that specify additional parameters of an acceleration structure build input.
Definition: reshade_api_resource.hpp:609
@ no_duplicate_any_hit_invocation
@ flags
Additional pipeline creation flags. Sub-object data is a pointer to a pipeline_flags value.
format
Available data and texture formats. This is mostly compatible with 'DXGI_FORMAT'.
Definition: reshade_api_format.hpp:18
texture_address_mode
Sampling behavior at texture coordinates outside the bounds of a texture resource.
Definition: reshade_api_resource.hpp:77
filter_mode
Texture filtering modes available for texture sampling operations.
Definition: reshade_api_resource.hpp:50
@ min_mag_anisotropic_mip_point
@ compare_min_linear_mag_mip_point
@ compare_min_mag_point_mip_linear
@ min_point_mag_mip_linear
@ compare_min_point_mag_linear_mip_point
@ compare_min_linear_mag_point_mip_linear
@ compare_min_mag_mip_linear
@ min_mag_linear_mip_point
@ min_mag_point_mip_linear
@ compare_min_mag_mip_point
@ min_linear_mag_point_mip_linear
@ compare_min_mag_linear_mip_point
@ min_linear_mag_mip_point
@ compare_min_point_mag_mip_linear
@ min_point_mag_linear_mip_point
@ compare_min_mag_anisotropic_mip_point
resource_flags
Flags that specify additional parameters of a resource.
Definition: reshade_api_resource.hpp:182
@ generate_mipmaps
Required to use the resource with command_list::generate_mipmaps.
@ shared
Shared resources can be imported/exported from/to different graphics APIs and/or processes....
@ cube_compatible
Required to create resource_view_type::texture_cube or resource_view_type::texture_cube_array views o...
@ dynamic
Dynamic resources can be frequently updated during a frame, with previous contents automatically bein...
@ sparse_binding
Resource is backed using sparse memory binding.
resource_usage
Flags that specify how a resource is used. This needs to be specified during creation and is also use...
Definition: reshade_api_resource.hpp:215
@ shader_resource_non_pixel
Definition: reshade.hpp:56
#define RESHADE_DEFINE_ENUM_FLAG_OPERATORS(type)
Definition: reshade_api_resource.hpp:16
#define RESHADE_DEFINE_HANDLE(name)
Definition: reshade_api_resource.hpp:8
Describes a single instance in a top-level acceleration structure. The data in acceleration_structure...
Definition: reshade_api_resource.hpp:621
uint32_t shader_binding_table_offset
Definition: reshade_api_resource.hpp:625
uint32_t mask
Definition: reshade_api_resource.hpp:624
uint32_t flags
Definition: reshade_api_resource.hpp:626
uint32_t custom_index
Definition: reshade_api_resource.hpp:623
uint64_t acceleration_structure_gpu_address
Definition: reshade_api_resource.hpp:627
Describes a depth-stencil view and how it is treated at the start and end of a render pass.
Definition: reshade_api_resource.hpp:497
render_pass_load_op depth_load_op
Specifies how the depth contents of the depth-stencil view are treated at the start of the render pas...
Definition: reshade_api_resource.hpp:505
render_pass_store_op depth_store_op
Specifies how the depth contents of the depth-stencil view are treated at the end of the render pass.
Definition: reshade_api_resource.hpp:509
render_pass_store_op stencil_store_op
Specifies how the stencil contents of the depth-stencil view are treated at the end of the render pas...
Definition: reshade_api_resource.hpp:517
uint8_t clear_stencil
Value the stencil contents of the depth-stencil resource is cleared to when stencil_load_op is render...
Definition: reshade_api_resource.hpp:525
render_pass_load_op stencil_load_op
Specifies how the stencil contents of the depth-stencil view are treated at the start of the render p...
Definition: reshade_api_resource.hpp:513
resource_view view
Depth-stencil resource view.
Definition: reshade_api_resource.hpp:501
float clear_depth
Value the depth contents of the depth-stencil resource is cleared to when depth_load_op is render_pas...
Definition: reshade_api_resource.hpp:521
Describes a render target view and how it is treated at the start and end of a render pass.
Definition: reshade_api_resource.hpp:532
render_pass_store_op store_op
Specifies how the contents of the render target view are treated at the end of the render pass.
Definition: reshade_api_resource.hpp:544
resource_view view
Render target resource view.
Definition: reshade_api_resource.hpp:536
float clear_color[4]
Value the render target resource is cleared to when load_op is render_pass_load_op::clear.
Definition: reshade_api_resource.hpp:548
render_pass_load_op load_op
Specifies how the contents of the render target view are treated at the start of the render pass.
Definition: reshade_api_resource.hpp:540
Describes a resource, such as a buffer or texture.
Definition: reshade_api_resource.hpp:252
constexpr resource_desc(uint32_t width, uint32_t height, uint16_t layers, uint16_t levels, format format, uint16_t samples, memory_heap heap, resource_usage usage, resource_flags flags=resource_flags::none)
Definition: reshade_api_resource.hpp:256
constexpr resource_desc(uint64_t size, memory_heap heap, resource_usage usage, resource_flags flags=resource_flags::none)
Definition: reshade_api_resource.hpp:254
constexpr resource_desc(resource_type type, uint32_t width, uint32_t height, uint16_t depth_or_layers, uint16_t levels, format format, uint16_t samples, memory_heap heap, resource_usage usage, resource_flags flags=resource_flags::none)
Definition: reshade_api_resource.hpp:258
constexpr resource_desc()
Definition: reshade_api_resource.hpp:253
Describes a resource view, which specifies how to interpret the data of a resource.
Definition: reshade_api_resource.hpp:361
constexpr resource_view_desc(resource_view_type type, format format, uint32_t first_level, uint32_t levels, uint32_t first_layer, uint32_t layers)
Definition: reshade_api_resource.hpp:369
constexpr resource_view_desc()
Definition: reshade_api_resource.hpp:362
constexpr resource_view_desc(format format)
Definition: reshade_api_resource.hpp:371
constexpr resource_view_desc(format format, uint32_t first_level, uint32_t levels, uint32_t first_layer, uint32_t layers)
Definition: reshade_api_resource.hpp:365
constexpr resource_view_desc(format format, uint64_t offset, uint64_t size)
Definition: reshade_api_resource.hpp:363
constexpr resource_view_desc(resource_view_type type, format format, uint64_t offset, uint64_t size)
Definition: reshade_api_resource.hpp:367
An opaque handle to a resource view object (depth-stencil, render target, shader resource view,...
Definition: reshade_api_resource.hpp:432
An opaque handle to a resource object (buffer, texture, ...).
Definition: reshade_api_resource.hpp:336
Describes a sampler state.
Definition: reshade_api_resource.hpp:89
filter_mode filter
Filtering mode to use when sampling a texture.
Definition: reshade_api_resource.hpp:93
float mip_lod_bias
Offset applied to the calculated mipmap level when sampling a texture.
Definition: reshade_api_resource.hpp:109
texture_address_mode address_u
Method to use for resolving U texture coordinates outside 0 to 1 range.
Definition: reshade_api_resource.hpp:97
float max_lod
Upper end of the mipmap range to clamp access to.
Definition: reshade_api_resource.hpp:129
float border_color[4]
RGBA value to return for texture coordinates outside 0 to 1 range when addressing mode is texture_add...
Definition: reshade_api_resource.hpp:121
float min_lod
Lower end of the mipmap range to clamp access to.
Definition: reshade_api_resource.hpp:125
float max_anisotropy
Clamping value to use when filtering mode is filter_mode::anisotropic.
Definition: reshade_api_resource.hpp:113
texture_address_mode address_v
Method to use for resolving V texture coordinates outside 0 to 1 range.
Definition: reshade_api_resource.hpp:101
texture_address_mode address_w
Method to use for resolving W texture coordinates outside 0 to 1 range.
Definition: reshade_api_resource.hpp:105
An opaque handle to a sampler state object.
Definition: reshade_api_resource.hpp:136
Describes a region inside a subresource.
Definition: reshade_api_resource.hpp:438
int32_t right
Definition: reshade_api_resource.hpp:442
int32_t bottom
Definition: reshade_api_resource.hpp:443
constexpr uint32_t height() const
Definition: reshade_api_resource.hpp:447
int32_t back
Definition: reshade_api_resource.hpp:444
int32_t left
Definition: reshade_api_resource.hpp:439
int32_t top
Definition: reshade_api_resource.hpp:440
int32_t front
Definition: reshade_api_resource.hpp:441
constexpr uint32_t width() const
Definition: reshade_api_resource.hpp:446
constexpr uint32_t depth() const
Definition: reshade_api_resource.hpp:448
Describes the data of a subresource.
Definition: reshade_api_resource.hpp:455
uint32_t slice_pitch
Depth pitch of the data (added to the data pointer to move between texture depth/array slices,...
Definition: reshade_api_resource.hpp:469
void * data
Pointer to the data.
Definition: reshade_api_resource.hpp:459
uint32_t row_pitch
Row pitch of the data (added to the data pointer to move between texture rows, unused for buffers and...
Definition: reshade_api_resource.hpp:464