Fix a bug for depth test on Vulkan backend
The default value for maxDepthBound should be 1.0. BUG=dawn:81 Change-Id: I337aac884456c739222bc31f8003267aa6de96af Reviewed-on: https://dawn-review.googlesource.com/c/3580 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
parent
d238bb67a5
commit
2b9d702c09
|
@ -74,12 +74,16 @@ namespace dawn_native { namespace vulkan {
|
||||||
mCreateInfo.flags = 0;
|
mCreateInfo.flags = 0;
|
||||||
|
|
||||||
const auto& depth = GetDepth();
|
const auto& depth = GetDepth();
|
||||||
mCreateInfo.depthTestEnable = VK_TRUE;
|
// Depth writes only occur if depth is enabled
|
||||||
|
mCreateInfo.depthTestEnable =
|
||||||
|
(depth.compareFunction == dawn::CompareFunction::Always && !depth.depthWriteEnabled)
|
||||||
|
? VK_FALSE
|
||||||
|
: VK_TRUE;
|
||||||
mCreateInfo.depthWriteEnable = depth.depthWriteEnabled ? VK_TRUE : VK_FALSE;
|
mCreateInfo.depthWriteEnable = depth.depthWriteEnabled ? VK_TRUE : VK_FALSE;
|
||||||
mCreateInfo.depthCompareOp = VulkanCompareOp(depth.compareFunction);
|
mCreateInfo.depthCompareOp = VulkanCompareOp(depth.compareFunction);
|
||||||
mCreateInfo.depthBoundsTestEnable = false;
|
mCreateInfo.depthBoundsTestEnable = false;
|
||||||
mCreateInfo.minDepthBounds = 0.0f;
|
mCreateInfo.minDepthBounds = 0.0f;
|
||||||
mCreateInfo.maxDepthBounds = 0.0f;
|
mCreateInfo.maxDepthBounds = 1.0f;
|
||||||
|
|
||||||
const auto& stencil = GetStencil();
|
const auto& stencil = GetStencil();
|
||||||
mCreateInfo.stencilTestEnable = StencilTestEnabled() ? VK_TRUE : VK_FALSE;
|
mCreateInfo.stencilTestEnable = StencilTestEnabled() ? VK_TRUE : VK_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue