mirror of https://github.com/AxioDL/boo.git
Add GEqual Z-test option for pipeline backends
This commit is contained in:
parent
04ff1692d8
commit
18cbfd2865
|
@ -198,6 +198,7 @@ enum class ZTest
|
|||
None,
|
||||
LEqual, /* Flipped on Vulkan, D3D, Metal */
|
||||
Greater,
|
||||
GEqual,
|
||||
Equal
|
||||
};
|
||||
|
||||
|
|
|
@ -564,6 +564,9 @@ class D3D11ShaderPipeline : public IShaderPipeline
|
|||
case ZTest::Greater:
|
||||
dsDesc.DepthFunc = D3D11_COMPARISON_LESS;
|
||||
break;
|
||||
case ZTest::GEqual:
|
||||
dsDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
|
||||
break;
|
||||
case ZTest::Equal:
|
||||
dsDesc.DepthFunc = D3D11_COMPARISON_EQUAL;
|
||||
break;
|
||||
|
|
|
@ -720,6 +720,9 @@ class D3D12ShaderPipeline : public IShaderPipeline
|
|||
case ZTest::Greater:
|
||||
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS;
|
||||
break;
|
||||
case ZTest::GEqual:
|
||||
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL;
|
||||
break;
|
||||
case ZTest::Equal:
|
||||
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_EQUAL;
|
||||
break;
|
||||
|
|
|
@ -503,6 +503,9 @@ public:
|
|||
case ZTest::Greater:
|
||||
glDepthFunc(GL_GREATER);
|
||||
break;
|
||||
case ZTest::GEqual:
|
||||
glDepthFunc(GL_GEQUAL);
|
||||
break;
|
||||
case ZTest::Equal:
|
||||
glDepthFunc(GL_EQUAL);
|
||||
break;
|
||||
|
|
|
@ -656,6 +656,9 @@ class MetalShaderPipeline : public IShaderPipeline
|
|||
case ZTest::Greater:
|
||||
dsDesc.depthCompareFunction = MTLCompareFunctionLess;
|
||||
break;
|
||||
case ZTest::GEqual:
|
||||
dsDesc.depthCompareFunction = MTLCompareFunctionLessEqual;
|
||||
break;
|
||||
case ZTest::Equal:
|
||||
dsDesc.depthCompareFunction = MTLCompareFunctionEqual;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue