/// Number of constants in this range (in 32-bit values).
/// </summary>
uint32_tcount=0;
/// <summary>
/// Shader pipeline stages that can make use of the constants in this range.
/// </summary>
shader_stagevisibility=shader_stage::all;
};
/// <summary>
/// Describes a range of descriptors of a descriptor table in a pipeline layout.
/// </summary>
structdescriptor_range
{
/// <summary>
/// OpenGL/Vulkan binding index (<c>layout(binding=X)</c> in GLSL).
/// In D3D this is equivalent to the offset (in descriptors) of this range in the descriptor table (since each binding can only have an array size of 1).
/// </summary>
uint32_tbinding=0;
/// <summary>
/// D3D9/D3D10/D3D11/D3D12 shader register index (<c>register(xX)</c> in HLSL).
/// </summary>
uint32_tdx_register_index=0;
/// <summary>
/// D3D12 register space (<c>register(..., spaceX)</c> in HLSL).
/// </summary>
uint32_tdx_register_space=0;
/// <summary>
/// Number of descriptors in this range.
/// Set to -1 (UINT32_MAX) to indicate an unbounded range.
/// </summary>
uint32_tcount=0;
/// <summary>
/// Shader pipeline stages that can make use of the descriptors in this range.
/// </summary>
shader_stagevisibility=shader_stage::all;
/// <summary>
/// Size of the array in case this is an array binding.
/// Only meaningful in Vulkan, in OpenGL and other APIs this has to be 1 (since each array element is a separate binding there).
/// If this is less than the total number of descriptors specified in <see cref="count"/>, then the remaining descriptors are assigned a separate binding (with an array size of 1), with the binding index incrementing with each additional descriptor.
/// Optional array of sampler descriptions to statically embed into the descriptor table when the descriptor type is <see cref="descriptor_type::sampler"/> or <see cref="descriptor_type::sampler_with_resource_view"/>.
/// </summary>
constsampler_desc*static_samplers=nullptr;
};
/// <summary>
/// Describes a single parameter in a pipeline layout.
/// Used when parameter type is <see cref="pipeline_layout_param_type::push_constants"/>.
/// </summary>
constant_rangepush_constants;
/// <summary>
/// Used when parameter type is <see cref="pipeline_layout_param_type::push_descriptors"/>.
/// </summary>
descriptor_rangepush_descriptors;
/// <summary>
/// Used when parameter type is <see cref="pipeline_layout_param_type::descriptor_table"/> or <see cref="pipeline_layout_param_type::push_descriptors_with_ranges"/>.
/// </summary>
struct
{
uint32_tcount;
constdescriptor_range*ranges;
}descriptor_table;
/// <summary>
/// Used when parameter type is <see cref="pipeline_layout_param_type::descriptor_table_with_static_samplers"/> or <see cref="pipeline_layout_param_type::push_descriptors_with_static_samplers"/>.
/// Constant RGBA value to use when <see cref="source_color_blend_factor"/> or <see cref="dest_color_blend_factor"/> is <see cref="blend_factor::constant_color"/>.
/// </summary>
floatblend_constant[4]={1.0f,1.0f,1.0f,1.0f};
/// <summary>
/// Logical operation for each render target. Ignored if <see cref="logic_op_enable"/> is <see langword="false"/>.
/// A write mask specifying which color components are written to each render target. Bitwise combination of <c>0x1</c> for red, <c>0x2</c> for green, <c>0x4</c> for blue and <c>0x8</c> for alpha.
/// Describes the state of the depth-stencil stage.
/// </summary>
structdepth_stencil_desc
{
/// <summary>
/// Enable or disable depth testing.
/// </summary>
booldepth_enable=true;
/// <summary>
/// Enable or disable writes to the depth-stencil buffer.
/// </summary>
booldepth_write_mask=true;
/// <summary>
/// Comparison function to use to compare new depth value from a fragment against current depth value in the depth-stencil buffer.
/// </summary>
compare_opdepth_func=compare_op::less;
/// <summary>
/// Enable or disable stencil testing.
/// </summary>
boolstencil_enable=false;
/// <summary>
/// Mask applied to stencil values read from the depth-stencil buffer for pixels whose surface normal is towards the camera.
/// </summary>
uint8_tfront_stencil_read_mask=0xFF;
/// <summary>
/// Mask applied to stencil values written to the depth-stencil buffer for pixels whose surface normal is towards the camera.
/// </summary>
uint8_tfront_stencil_write_mask=0xFF;
/// <summary>
/// Reference value to perform against when stencil testing pixels whose surface normal is towards the camera.
/// </summary>
uint8_tfront_stencil_reference_value=0;
/// <summary>
/// Comparison function to use to compare new stencil value from a fragment against current stencil value for pixels whose surface normal is facing towards the camera.
/// </summary>
compare_opfront_stencil_func=compare_op::always;
/// <summary>
/// Stencil operation to perform when stencil testing and depth testing both pass for pixels whose surface normal is facing towards the camera.
/// </summary>
stencil_opfront_stencil_pass_op=stencil_op::keep;
/// <summary>
/// Stencil operation to perform when stencil testing fails for pixels whose surface normal is towards the camera.
/// </summary>
stencil_opfront_stencil_fail_op=stencil_op::keep;
/// <summary>
/// Stencil operation to perform when stencil testing passes and depth testing fails for pixels whose surface normal is facing towards the camera.
/// Mask applied to stencil values read from the depth-stencil buffer for pixels whose surface normal is facing away from the camera.
/// </summary>
uint8_tback_stencil_read_mask=0xFF;
/// <summary>
/// Mask applied to stencil values written to the depth-stencil buffer for pixels whose surface normal is facing away from the camera.
/// </summary>
uint8_tback_stencil_write_mask=0xFF;
/// <summary>
/// Reference value to perform against when stencil testing pixels whose surface normal is facing away from the camera.
/// </summary>
uint8_tback_stencil_reference_value=0;
/// <summary>
/// Comparison function to use to compare new stencil value from a fragment against current stencil value for pixels whose surface normal is facing away from the camera.
/// </summary>
compare_opback_stencil_func=compare_op::always;
/// <summary>
/// Stencil operation to perform when stencil testing and depth testing both pass for pixels whose surface normal is facing away from the camera.
/// </summary>
stencil_opback_stencil_pass_op=stencil_op::keep;
/// <summary>
/// Stencil operation to perform when stencil testing fails for pixels whose surface normal is facing away from the camera.
/// </summary>
stencil_opback_stencil_fail_op=stencil_op::keep;
/// <summary>
/// Stencil operation to perform when stencil testing passes and depth testing fails for pixels whose surface normal is facing away from the camera.
/// This should usually be 1, except for array sub-objects like <see cref="pipeline_subobject_type::render_target_formats"/> (where this specifies the number of render targets) or <see cref="pipeline_subobject_type::dynamic_pipeline_states"/>.
/// </summary>
uint32_tcount=0;
/// <summary>
/// Pointer to an array of sub-object descriptions (which should be as large as the specified <see cref="count"/>).
/// Depending on the sub-object <see cref="type"/> this should be a pointer to a <see cref="shader_desc"/>, <see cref="blend_desc"/>, <see cref="rasterizer_desc"/>, <see cref="depth_stencil_desc"/> or ...
/// </summary>
void*data=nullptr;
};
/// <summary>
/// An opaque handle to a pipeline state object.
/// <para>
/// Depending on the graphics API this can be:
/// <list type="bullet">
/// <item>Direct3D 9: A pointer to a 'IDirect3D(...)Shader' object.</item>
/// <item>Direct3D 10: A pointer to a 'ID3D10(...)(Shader/State)' object.</item>
/// <item>Direct3D 11: A pointer to a 'ID3D11(...)(Shader/State)' object.</item>
/// <item>Direct3D 12: A pointer to a 'ID3D12PipelineState' object.</item>
/// <item>OpenGL: An opaque value.</item>
/// <item>Vulkan: A 'VkPipeline' handle.</item>
/// </list>
/// </para>
/// </summary>
RESHADE_DEFINE_HANDLE(pipeline);
/// <summary>
/// A constant buffer resource descriptor.
/// </summary>
structbuffer_range
{
/// <summary>
/// Constant buffer resource.
/// </summary>
resourcebuffer={0};
/// <summary>
/// Offset from the start of the buffer resource (in bytes).
/// </summary>
uint64_toffset=0;
/// <summary>
/// Number of elements this range covers in the buffer resource (in bytes).
/// Set to -1 (UINT64_MAX) to indicate that the whole buffer should be used.
/// </summary>
uint64_tsize=UINT64_MAX;
};
/// <summary>
/// A combined sampler and resource view descriptor.
/// </summary>
structsampler_with_resource_view
{
/// <summary>
/// Sampler to sampler the shader resource view with.
/// </summary>
samplersampler={0};
/// <summary>
/// Shader resource view.
/// </summary>
resource_viewview={0};
};
/// <summary>
/// An opaque handle to a descriptor table in a descriptor heap.
/// <para>
/// Depending on the graphics API this can be:
/// <list type="bullet">
/// <item>Direct3D 9: An opaque value.</item>
/// <item>Direct3D 10: An opaque value.</item>
/// <item>Direct3D 11: An opaque value.</item>
/// <item>Direct3D 12: An opaque value.</item>
/// <item>OpenGL: An opaque value.</item>
/// <item>Vulkan: A 'VkDescriptorSet' handle.</item>
/// </list>
/// </para>
/// </summary>
RESHADE_DEFINE_HANDLE(descriptor_table);
/// <summary>
/// All information needed to copy descriptors between descriptor tables.
/// </summary>
structdescriptor_table_copy
{
/// <summary>
/// Descriptor table to copy from.
/// </summary>
descriptor_tablesource_table={0};
/// <summary>
/// Index of the binding in the source descriptor table.
/// </summary>
uint32_tsource_binding=0;
/// <summary>
/// Array index in the specified source binding to begin copying from.
/// </summary>
uint32_tsource_array_offset=0;
/// <summary>
/// Descriptor table to copy to.
/// </summary>
descriptor_tabledest_table={0};
/// <summary>
/// Index of the binding in the destination descriptor table.
/// </summary>
uint32_tdest_binding=0;
/// <summary>
/// Array index in the specified destination binding to begin copying to.
/// </summary>
uint32_tdest_array_offset=0;
/// <summary>
/// Number of descriptors to copy.
/// </summary>
uint32_tcount=0;
};
/// <summary>
/// All information needed to update descriptors in a descriptor table.
/// </summary>
structdescriptor_table_update
{
/// <summary>
/// Descriptor table to update.
/// </summary>
descriptor_tabletable={0};
/// <summary>
/// OpenGL/Vulkan binding index in the descriptor set.
/// In D3D this is equivalent to the offset (in descriptors) from the start of the table.
/// </summary>
uint32_tbinding=0;
/// <summary>
/// Array index in the specified <see cref="binding"/> to begin updating at.
/// Only meaningful in Vulkan, in OpenGL and other APIs this has to be 0 (since each array element gets a separate binding).
/// </summary>
uint32_tarray_offset=0;
/// <summary>
/// Number of descriptors to update, starting at the specified <see cref="binding"/>.
/// If the specified <see cref="binding"/> has fewer than <see cref="count"/> array elements starting from <see cref="array_offset"/>, then the remainder will be used to update the subsequent binding starting at array element zero, recursively.
/// </summary>
uint32_tcount=0;
/// <summary>
/// Type of the specified <see cref="descriptors"/>.
/// </summary>
descriptor_typetype=descriptor_type::sampler;
/// <summary>
/// Pointer to an array of descriptors to update in the descriptor table (which should be as large as the specified <see cref="count"/>).
/// Depending on the descriptor <see cref="type"/> this should be pointer to an array of <see cref="buffer_range"/>, <see cref="resource_view"/>, <see cref="sampler"/>, <see cref="sampler_with_resource_view"/> or <see cref="acceleration_structure"/>.
/// </summary>
constvoid*descriptors=nullptr;
};
/// <summary>
/// An opaque handle to a descriptor heap.
/// <para>
/// Depending on the graphics API this can be:
/// <list type="bullet">
/// <item>Direct3D 9: An opaque value.</item>
/// <item>Direct3D 10: An opaque value.</item>
/// <item>Direct3D 11: An opaque value.</item>
/// <item>Direct3D 12: A pointer to a 'ID3D12DescriptorHeap' object.</item>
/// <item>OpenGL: An opaque value.</item>
/// <item>Vulkan: A 'VkDescriptorPool' handle.</item>
/// </list>
/// </para>
/// </summary>
RESHADE_DEFINE_HANDLE(descriptor_heap);
/// <summary>
/// Type of a query.
/// </summary>
enumclassquery_type
{
/// <summary>
/// Number of samples that passed the depth and stencil tests between beginning and end of the query.
/// Data is a 64-bit unsigned integer value.
/// </summary>
occlusion=0,
/// <summary>
/// Zero if no samples passed, one if at least one sample passed the depth and stencil tests between beginning and end of the query.
/// Data is a 64-bit unsigned integer value.
/// </summary>
binary_occlusion=1,
/// <summary>
/// GPU timestamp at the frequency returned by <see cref="command_queue::get_timestamp_frequency"/>.
/// Data is a 64-bit unsigned integer value.
/// </summary>
timestamp=2,
/// <summary>
/// Pipeline statistics (such as the number of shader invocations) between beginning and end of the query.
/// Data is a structure of type <c>{ uint64_t ia_vertices; uint64_t ia_primitives; uint64_t vs_invocations; uint64_t gs_invocations; uint64_t gs_primitives; uint64_t invocations; uint64_t primitives; uint64_t ps_invocations; uint64_t hs_invocations; uint64_t ds_invocations; uint64_t cs_invocations; }</c>.
/// </summary>
pipeline_statistics=3,
/// <summary>
/// Streaming output statistics for stream 0 between beginning and end of the query.
/// Data is a structure of type <c>{ uint64_t primitives_written; uint64_t primitives_storage_needed; }</c>.