vkd3d: Support depth bounds test.

This commit is contained in:
Conor McCarthy 2023-07-18 15:50:18 +10:00 committed by Alexandre Julliard
parent 63b8972b0e
commit 76eb0adf03
Notes: Alexandre Julliard 2023-11-15 22:58:50 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/461
2 changed files with 10 additions and 5 deletions

View File

@ -1522,9 +1522,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;

View File

@ -2659,7 +2659,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,
@ -3068,6 +3068,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)
@ -3077,7 +3083,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)
{