Add support for greater depth function
This commit is contained in:
parent
b2deff18aa
commit
d798d1328e
2 changed files with 13 additions and 2 deletions
|
@ -598,7 +598,17 @@ GFXPipeline* GFXMetal::create_graphics_pipeline(const GFXGraphicsPipelineCreateI
|
||||||
MTLDepthStencilDescriptor* depthStencil = [MTLDepthStencilDescriptor new];
|
MTLDepthStencilDescriptor* depthStencil = [MTLDepthStencilDescriptor new];
|
||||||
|
|
||||||
if(info.depth.depth_mode != GFXDepthMode::None) {
|
if(info.depth.depth_mode != GFXDepthMode::None) {
|
||||||
depthStencil.depthCompareFunction = info.depth.depth_mode == GFXDepthMode::LessOrEqual ? MTLCompareFunctionLessEqual : MTLCompareFunctionLess;
|
switch(info.depth.depth_mode) {
|
||||||
|
case GFXDepthMode::Less:
|
||||||
|
depthStencil.depthCompareFunction = MTLCompareFunctionLess;
|
||||||
|
break;
|
||||||
|
case GFXDepthMode::LessOrEqual:
|
||||||
|
depthStencil.depthCompareFunction = MTLCompareFunctionLessEqual;
|
||||||
|
break;
|
||||||
|
case GFXDepthMode::Greater:
|
||||||
|
depthStencil.depthCompareFunction = MTLCompareFunctionGreater;
|
||||||
|
break;
|
||||||
|
}
|
||||||
depthStencil.depthWriteEnabled = true;
|
depthStencil.depthWriteEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,8 @@ struct GFXVertexAttribute {
|
||||||
enum class GFXDepthMode {
|
enum class GFXDepthMode {
|
||||||
None,
|
None,
|
||||||
Less,
|
Less,
|
||||||
LessOrEqual
|
LessOrEqual,
|
||||||
|
Greater
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GFXPushConstant {
|
struct GFXPushConstant {
|
||||||
|
|
Reference in a new issue