mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Remove DepthTestEnabled() and fix depth writes for depth function Always
This commit is contained in:
@@ -74,14 +74,15 @@ namespace opengl {
|
||||
}
|
||||
|
||||
void DepthStencilState::ApplyNow(PersistentPipelineState &persistentPipelineState) const {
|
||||
if (DepthTestEnabled()) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
} else {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
auto& depthInfo = GetDepth();
|
||||
|
||||
// Depth writes only occur if depth is enabled
|
||||
if (depthInfo.compareFunction == nxt::CompareFunction::Always && !depthInfo.depthWriteEnabled) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
} else {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (depthInfo.depthWriteEnabled) {
|
||||
glDepthMask(GL_TRUE);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user