Struct D3D11DepthStencilDesc
Describes depth-stencil state.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.D3D11
Assembly: JeremyAnsel.DirectX.D3D11.dll
Syntax
public struct D3D11DepthStencilDesc : IEquatable<D3D11DepthStencilDesc>
Constructors
| Edit this page View SourceD3D11DepthStencilDesc(bool, D3D11DepthWriteMask, D3D11ComparisonFunction, bool, byte, byte, D3D11StencilOperation, D3D11StencilOperation, D3D11StencilOperation, D3D11ComparisonFunction, D3D11StencilOperation, D3D11StencilOperation, D3D11StencilOperation, D3D11ComparisonFunction)
Initializes a new instance of the D3D11DepthStencilDesc struct.
Declaration
public D3D11DepthStencilDesc(bool isDepthEnabled, D3D11DepthWriteMask depthWriteMask, D3D11ComparisonFunction depthFunction, bool isStencilEnabled, byte stencilReadMask, byte stencilWriteMask, D3D11StencilOperation frontStencilFailOperation, D3D11StencilOperation frontStencilDepthFailOperation, D3D11StencilOperation frontStencilPassOperation, D3D11ComparisonFunction frontStencilFunction, D3D11StencilOperation backStencilFailOperation, D3D11StencilOperation backStencilDepthFailOperation, D3D11StencilOperation backStencilPassOperation, D3D11ComparisonFunction backStencilFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isDepthEnabled | Enable depth testing. |
| D3D11DepthWriteMask | depthWriteMask | Identify a portion of the depth-stencil buffer that can be modified by depth data. |
| D3D11ComparisonFunction | depthFunction | A function that compares depth data against existing depth data. |
| bool | isStencilEnabled | Enable stencil testing. |
| byte | stencilReadMask | Identify a portion of the depth-stencil buffer for reading stencil data. |
| byte | stencilWriteMask | Identify a portion of the depth-stencil buffer for writing stencil data. |
| D3D11StencilOperation | frontStencilFailOperation | The stencil operation to perform when stencil testing fails for pixels whose surface normal is facing towards the camera. |
| D3D11StencilOperation | frontStencilDepthFailOperation | The stencil operation to perform when stencil testing passes and depth testing fails for pixels whose surface normal is facing towards the camera. |
| D3D11StencilOperation | frontStencilPassOperation | The stencil operation to perform when stencil testing and depth testing both pass for pixels whose surface normal is facing towards the camera. |
| D3D11ComparisonFunction | frontStencilFunction | A function that compares stencil data against existing stencil data for pixels whose surface normal is facing towards the camera. |
| D3D11StencilOperation | backStencilFailOperation | The stencil operation to perform when stencil testing fails for pixels whose surface normal is facing away from the camera. |
| D3D11StencilOperation | backStencilDepthFailOperation | The stencil operation to perform when stencil testing passes and depth testing fails for pixels whose surface normal is facing away from the camera. |
| D3D11StencilOperation | backStencilPassOperation | The stencil operation to perform when stencil testing and depth testing both pass for pixels whose surface normal is facing away from the camera. |
| D3D11ComparisonFunction | backStencilFunction | A function that compares stencil data against existing stencil data for pixels whose surface normal is facing away from the camera. |
Properties
| Edit this page View SourceBackFace
Gets or sets a value indicating how to use the results of the depth test and the stencil test for pixels whose surface normal is facing away from the camera.
Declaration
public D3D11DepthStencilOperationDesc BackFace { get; set; }
Property Value
| Type | Description |
|---|---|
| D3D11DepthStencilOperationDesc |
Default
Gets default depth-stencil-state values
Declaration
public static D3D11DepthStencilDesc Default { get; }
Property Value
| Type | Description |
|---|---|
| D3D11DepthStencilDesc |
DepthFunction
Gets or sets a function that compares depth data against existing depth data.
Declaration
public D3D11ComparisonFunction DepthFunction { get; set; }
Property Value
| Type | Description |
|---|---|
| D3D11ComparisonFunction |
DepthWriteMask
Gets or sets a portion of the depth-stencil buffer that can be modified by depth data.
Declaration
public D3D11DepthWriteMask DepthWriteMask { get; set; }
Property Value
| Type | Description |
|---|---|
| D3D11DepthWriteMask |
FrontFace
Gets or sets a value indicating how to use the results of the depth test and the stencil test for pixels whose surface normal is facing towards the camera.
Declaration
public D3D11DepthStencilOperationDesc FrontFace { get; set; }
Property Value
| Type | Description |
|---|---|
| D3D11DepthStencilOperationDesc |
IsDepthEnabled
Gets or sets a value indicating whether depth testing is enabled.
Declaration
public bool IsDepthEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsStencilEnabled
Gets or sets a value indicating whether stencil testing is enabled.
Declaration
public bool IsStencilEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StencilReadMask
Gets or sets a portion of the depth-stencil buffer for reading stencil data.
Declaration
public byte StencilReadMask { get; set; }
Property Value
| Type | Description |
|---|---|
| byte |
StencilWriteMask
Gets or sets a portion of the depth-stencil buffer for writing stencil data.
Declaration
public byte StencilWriteMask { get; set; }
Property Value
| Type | Description |
|---|---|
| byte |
Methods
| Edit this page View SourceEquals(D3D11DepthStencilDesc)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(D3D11DepthStencilDesc other)
Parameters
| Type | Name | Description |
|---|---|---|
| D3D11DepthStencilDesc | other | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(D3D11DepthStencilDesc, D3D11DepthStencilDesc)
Compares two D3D11DepthStencilDesc objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(D3D11DepthStencilDesc left, D3D11DepthStencilDesc right)
Parameters
| Type | Name | Description |
|---|---|---|
| D3D11DepthStencilDesc | left | The left D3D11DepthStencilDesc to compare. |
| D3D11DepthStencilDesc | right | The right D3D11DepthStencilDesc to compare. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(D3D11DepthStencilDesc, D3D11DepthStencilDesc)
Compares two D3D11DepthStencilDesc objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(D3D11DepthStencilDesc left, D3D11DepthStencilDesc right)
Parameters
| Type | Name | Description |
|---|---|---|
| D3D11DepthStencilDesc | left | The left D3D11DepthStencilDesc to compare. |
| D3D11DepthStencilDesc | right | The right D3D11DepthStencilDesc to compare. |
Returns
| Type | Description |
|---|---|
| bool |