Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Depth / stencil - how to communicate disabling depth checking? #101

Open
BenConMS opened this issue Aug 1, 2017 · 1 comment
Open

Depth / stencil - how to communicate disabling depth checking? #101

BenConMS opened this issue Aug 1, 2017 · 1 comment

Comments

@BenConMS
Copy link
Contributor

BenConMS commented Aug 1, 2017

D3D12 has an explicit flag (DepthEnable) for disabling depth checking:

https://msdn.microsoft.com/en-us/library/windows/desktop/dn770356(v=vs.85).aspx

OpenGL has a similar thing with GL_DEPTH_TEST and glEnable:

https://www.khronos.org/opengl/wiki/Depth_Test

And Vulkan has a bit that it sets for this too:

https://www.khronos.org/registry/vulkan/specs/1.0/man/html/VkPipelineDepthStencilStateCreateInfo.html

Metal does not seem to have a bit for this, and it appears that the NXT API is using this approach that infers disabling depth testing through the compare function:

https://developer.apple.com/documentation/metal/mtldepthstencildescriptor

I think that we have this backwards right now. This is a low-level, explicit API and having enum values side-affect into multiple settings is undesirable.

This came up when wiring up depth / stencil to the D3D12 backend, filing an issue to discuss how to proceed.

@Kangz
Copy link
Contributor

Kangz commented Aug 3, 2017

The same implicit optimization of the state vs explicitly enabling things will happen for independent blend states. In PR #103 we have it implicit, but when we revisit this issue, we should handle independent blend state the same way we do depth testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants