From a0c67191a7230d6f54cc152cf51ac2f2bcf863f3 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 24 Apr 2019 22:48:07 +0200 Subject: [PATCH] [d3d11] Implement depth bounds extension --- src/d3d11/d3d11_context_ext.cpp | 9 +++++++++ src/d3d11/d3d11_device.cpp | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context_ext.cpp b/src/d3d11/d3d11_context_ext.cpp index 3f164ff3a..b5a933b3b 100644 --- a/src/d3d11/d3d11_context_ext.cpp +++ b/src/d3d11/d3d11_context_ext.cpp @@ -108,7 +108,16 @@ namespace dxvk { BOOL Enable, FLOAT MinDepthBounds, FLOAT MaxDepthBounds) { + D3D10DeviceLock lock = m_ctx->LockContext(); + + DxvkDepthBounds db; + db.enableDepthBounds = Enable; + db.minDepthBounds = MinDepthBounds; + db.maxDepthBounds = MaxDepthBounds; + m_ctx->EmitCs([cDepthBounds = db] (DxvkContext* ctx) { + ctx->setDepthBounds(cDepthBounds); + }); } diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 4075bb4c8..5e01871e8 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1411,6 +1411,7 @@ namespace dxvk { enabled.core.features.robustBufferAccess = VK_TRUE; enabled.core.features.shaderStorageImageExtendedFormats = VK_TRUE; enabled.core.features.shaderStorageImageWriteWithoutFormat = VK_TRUE; + enabled.core.features.depthBounds = supported.core.features.depthBounds; enabled.extMemoryPriority.memoryPriority = supported.extMemoryPriority.memoryPriority; @@ -1785,7 +1786,10 @@ namespace dxvk { case D3D11_VK_EXT_MULTI_DRAW_INDIRECT_COUNT: return deviceFeatures.core.features.multiDrawIndirect && deviceExtensions.khrDrawIndirectCount; - + + case D3D11_VK_EXT_DEPTH_BOUNDS: + return deviceFeatures.core.features.depthBounds; + default: return false; }