diff --git a/include/boo/graphicsdev/IGraphicsDataFactory.hpp b/include/boo/graphicsdev/IGraphicsDataFactory.hpp index 42bddb2..46080d1 100644 --- a/include/boo/graphicsdev/IGraphicsDataFactory.hpp +++ b/include/boo/graphicsdev/IGraphicsDataFactory.hpp @@ -198,6 +198,7 @@ enum class ZTest None, LEqual, /* Flipped on Vulkan, D3D, Metal */ Greater, + GEqual, Equal }; diff --git a/lib/graphicsdev/D3D11.cpp b/lib/graphicsdev/D3D11.cpp index b4d5dad..8bbe2d7 100644 --- a/lib/graphicsdev/D3D11.cpp +++ b/lib/graphicsdev/D3D11.cpp @@ -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; diff --git a/lib/graphicsdev/D3D12.cpp b/lib/graphicsdev/D3D12.cpp index 6506cca..0c83df5 100644 --- a/lib/graphicsdev/D3D12.cpp +++ b/lib/graphicsdev/D3D12.cpp @@ -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; diff --git a/lib/graphicsdev/GL.cpp b/lib/graphicsdev/GL.cpp index 5f1af87..991f21a 100644 --- a/lib/graphicsdev/GL.cpp +++ b/lib/graphicsdev/GL.cpp @@ -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; diff --git a/lib/graphicsdev/Metal.mm b/lib/graphicsdev/Metal.mm index a18bb1d..3ecf49f 100644 --- a/lib/graphicsdev/Metal.mm +++ b/lib/graphicsdev/Metal.mm @@ -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;