From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 4 +--- libs/vkd3d/state.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 222555d4..1175817f 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1521,9 +1521,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, device->feature_options1.ExpandedComputeResourceStates = TRUE; device->feature_options1.Int64ShaderOps = features->shaderInt64;
- /* Depth bounds test is enabled in D3D12_DEPTH_STENCIL_DESC1, which is not - * supported. */ - device->feature_options2.DepthBoundsTestSupported = FALSE; + device->feature_options2.DepthBoundsTestSupported = features->depthBounds; /* d3d12_command_list_SetSamplePositions() is not implemented. */ device->feature_options2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED;
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index a7392035..f6ab254a 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2714,7 +2714,7 @@ static void ds_desc_from_d3d12(struct VkPipelineDepthStencilStateCreateInfo *vk_ vk_desc->depthWriteEnable = VK_FALSE; vk_desc->depthCompareOp = VK_COMPARE_OP_NEVER; } - vk_desc->depthBoundsTestEnable = VK_FALSE; + vk_desc->depthBoundsTestEnable = d3d12_desc->DepthBoundsTestEnable; if ((vk_desc->stencilTestEnable = d3d12_desc->StencilEnable)) { vk_stencil_op_state_from_d3d12(&vk_desc->front, &d3d12_desc->FrontFace, @@ -3123,6 +3123,12 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s graphics->rt_count = rt_count;
ds_desc_from_d3d12(&graphics->ds_desc, &desc->depth_stencil_state); + if (graphics->ds_desc.depthBoundsTestEnable && !device->feature_options2.DepthBoundsTestSupported) + { + WARN("Depth bounds test not supported by device.\n"); + hr = E_INVALIDARG; + goto fail; + } if (desc->dsv_format == DXGI_FORMAT_UNKNOWN && graphics->ds_desc.depthTestEnable && !graphics->ds_desc.depthWriteEnable && graphics->ds_desc.depthCompareOp == VK_COMPARE_OP_ALWAYS && !graphics->ds_desc.stencilTestEnable) @@ -3132,7 +3138,8 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s }
graphics->dsv_format = VK_FORMAT_UNDEFINED; - if (graphics->ds_desc.depthTestEnable || graphics->ds_desc.stencilTestEnable) + if (graphics->ds_desc.depthTestEnable || graphics->ds_desc.stencilTestEnable + || graphics->ds_desc.depthBoundsTestEnable) { if (desc->dsv_format == DXGI_FORMAT_UNKNOWN) {