Render State
-
namespace shaders
Typedefs
-
using DriverRenderStateId = GenerationRefId<8, DriverRenderStateIdDummy>
-
class DriverRenderStateIdDummy
-
using DriverRenderStateId = GenerationRefId<8, DriverRenderStateIdDummy>
-
namespace shaders
-
struct RenderStateBits
Description of render state.
Subclassed by shaders::RenderState
Public Members
-
uint32_t zwrite
Enable depth write.
-
uint32_t ztest
Enable depth test.
-
uint32_t zFunc
Relationship operation #CMPF used for depth test (less, greater, equal and etc.).
-
uint32_t stencilRef
Reference value to perform against when doing a stencil test.
-
uint32_t cull
Specifies triangle face culling #CULL_TYPE.
-
uint32_t depthBoundsEnable
Enable depth-bounds testing. Samples outside the range are discarded.
-
uint32_t forcedSampleCount
The sample count that is forced while UAV rendering or rasterizing.
Warning
Requires caps.hasForcedSamplerCount (DX 11.1).
Warning
Depth test must be disabled.
-
uint32_t conservativeRaster
Identifies whether conservative rasterization is on or off.
Warning
Requires caps.hasConservativeRassterization (DX 11.3).
Warning
Only triangle topology is allowed (DX 12).
-
uint32_t zClip
Enable depth clipping based on distance.
-
uint32_t scissorEnabled
Enable scissor-rectangle culling. All pixels outside an active scissor rectangle are culled.
-
uint32_t independentBlendEnabled
Enable independent blending in simultaneous render targets.
-
uint32_t alphaToCoverage
Specifies whether to use alpha-to-coverage.
-
uint32_t viewInstanceCount
Specifies the number of used views.
-
uint32_t colorWr = 0xFFFFFFFF
Specifies mask which is used for color write.
-
float zBias = 0
Specifies depth value added to a given pixel.
-
float slopeZBias = 0
Specifies scalar on a given pixel’s slope.
-
StencilState stencil
Specifies stencil state.
-
uint32_t zwrite
-
struct RenderState : public shaders::RenderStateBits
Extended render state with blending params.
Public Functions
-
inline RenderState()
-
inline bool operator==(const RenderState &s) const
-
inline bool operator!=(const RenderState &s) const
Public Members
-
BlendParams blendParams[NumIndependentBlendParameters]
Public Static Attributes
-
static constexpr uint32_t NumIndependentBlendParameters = 4
-
struct BlendFactors
Description of blending factors.
-
struct BlendParams
Description of blending parameters.
Public Members
-
BlendFactors ablendFactors
Configures alpha blend factor.
-
BlendFactors sepablendFactors
Configures separate alpha blend factor.
-
uint8_t blendOp
Specifies #BLENDOP operation for alpha blending.
-
uint8_t sepablendOp
Specifies #BLENDOP operation for separate alpha blending.
-
uint8_t ablend
Enables alpha blending.
-
uint8_t sepablend
Enables separate alpha blending.
-
BlendFactors ablendFactors
-
inline RenderState()
-
struct RenderStateBits
-
namespace d3d
Functions
-
bool set_blend_factor(E3DCOLOR color)
Set the blend factor object.
- Parameters:
color – blend factor to set
- Returns:
true if successful, false otherwise
-
bool setstencil(uint32_t ref)
Set the stencil reference value.
- Parameters:
ref – reference value to set
- Returns:
true if successful, false otherwise
-
bool setwire(bool in)
Set the wireframe mode. Works only in dev build.
- Parameters:
in – true to enable wireframe mode, false to disable
- Returns:
true if successful, false otherwise
-
bool set_depth_bounds(float zmin, float zmax)
Set the depth bounds.
- Parameters:
zmin – minimum depth value
zmax – maximum depth value
- Returns:
true if successful, false otherwise
-
shaders::DriverRenderStateId create_render_state(const shaders::RenderState &state)
Create a render state object in driver.
- Parameters:
state – parameters of the render state object to create
- Returns:
shaders::DriverRenderStateId id of the created render state object
-
bool set_render_state(shaders::DriverRenderStateId state_id)
Set the render state object in driver.
- Parameters:
state_id – id of the render state object to set
- Returns:
true if successful, false otherwise
-
void clear_render_states()
Remove all render state objects allocated in driver.
-
bool set_blend_factor(E3DCOLOR color)