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,
|
None,
|
||||||
LEqual, /* Flipped on Vulkan, D3D, Metal */
|
LEqual, /* Flipped on Vulkan, D3D, Metal */
|
||||||
Greater,
|
Greater,
|
||||||
|
GEqual,
|
||||||
Equal
|
Equal
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -564,6 +564,9 @@ class D3D11ShaderPipeline : public IShaderPipeline
|
||||||
case ZTest::Greater:
|
case ZTest::Greater:
|
||||||
dsDesc.DepthFunc = D3D11_COMPARISON_LESS;
|
dsDesc.DepthFunc = D3D11_COMPARISON_LESS;
|
||||||
break;
|
break;
|
||||||
|
case ZTest::GEqual:
|
||||||
|
dsDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
|
||||||
|
break;
|
||||||
case ZTest::Equal:
|
case ZTest::Equal:
|
||||||
dsDesc.DepthFunc = D3D11_COMPARISON_EQUAL;
|
dsDesc.DepthFunc = D3D11_COMPARISON_EQUAL;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -720,6 +720,9 @@ class D3D12ShaderPipeline : public IShaderPipeline
|
||||||
case ZTest::Greater:
|
case ZTest::Greater:
|
||||||
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS;
|
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS;
|
||||||
break;
|
break;
|
||||||
|
case ZTest::GEqual:
|
||||||
|
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL;
|
||||||
|
break;
|
||||||
case ZTest::Equal:
|
case ZTest::Equal:
|
||||||
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_EQUAL;
|
desc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_EQUAL;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -503,6 +503,9 @@ public:
|
||||||
case ZTest::Greater:
|
case ZTest::Greater:
|
||||||
glDepthFunc(GL_GREATER);
|
glDepthFunc(GL_GREATER);
|
||||||
break;
|
break;
|
||||||
|
case ZTest::GEqual:
|
||||||
|
glDepthFunc(GL_GEQUAL);
|
||||||
|
break;
|
||||||
case ZTest::Equal:
|
case ZTest::Equal:
|
||||||
glDepthFunc(GL_EQUAL);
|
glDepthFunc(GL_EQUAL);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -656,6 +656,9 @@ class MetalShaderPipeline : public IShaderPipeline
|
||||||
case ZTest::Greater:
|
case ZTest::Greater:
|
||||||
dsDesc.depthCompareFunction = MTLCompareFunctionLess;
|
dsDesc.depthCompareFunction = MTLCompareFunctionLess;
|
||||||
break;
|
break;
|
||||||
|
case ZTest::GEqual:
|
||||||
|
dsDesc.depthCompareFunction = MTLCompareFunctionLessEqual;
|
||||||
|
break;
|
||||||
case ZTest::Equal:
|
case ZTest::Equal:
|
||||||
dsDesc.depthCompareFunction = MTLCompareFunctionEqual;
|
dsDesc.depthCompareFunction = MTLCompareFunctionEqual;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue