Variable rate shading API
-
namespace d3d
Functions
-
void set_variable_rate_shading(unsigned rate_x, unsigned rate_y, VariableRateShadingCombiner vertex_combiner = VariableRateShadingCombiner::VRS_PASSTHROUGH, VariableRateShadingCombiner pixel_combiner = VariableRateShadingCombiner::VRS_PASSTHROUGH)
Sets variable rate shading setup for next draw calls.
Note
Rates (
rate_x
,rate_y
) of 1 by 4 or 4 by 1 are invalid.Note
Depth/Stencil values are always computed at full rate and so shaders that modify depth value output may interfere with the
pixel_combiner
.- Parameters:
rate_x, rate_y – Constant rates for the next draw calls, those are supported by all VRS capable devices. Valid values for both are 1, 2 and with the corresponding feature cap 4.
vertex_combiner – The mode in which the constant rate of
rate_x
andrate_y
is combined with a possible vertex/geometry shader rate output. For shader outputs see SV_ShadingRate, note that the provoking vertex or the per primitive value is used.pixel_combiner – The mode in which the result of ‘vertex_combiner’ is combined with the rate of the sampling rate texture set by set_variable_rate_shading_texture.
-
void set_variable_rate_shading_texture(BaseTexture *rate_texture = nullptr)
Sets the variable rate shading texture for the next draw calls.
Note that when you start to modify the used texture, you should reset the used shading rate texture to null to ensure that on next use as a shading rate source, the texture is in a state the device can use.
Note
It is invalid to call this when DeviceDriverCapabilities::hasVariableRateShadingTexture feature is not supported.
- Parameters:
rate_texture – The texture to use as a shading rate source.
-
void set_variable_rate_shading(unsigned rate_x, unsigned rate_y, VariableRateShadingCombiner vertex_combiner = VariableRateShadingCombiner::VRS_PASSTHROUGH, VariableRateShadingCombiner pixel_combiner = VariableRateShadingCombiner::VRS_PASSTHROUGH)