vkd3d: Allow devices with recursion of 1 to be accepted.

We can fail RTPSOs later if they for whatever reason use recursion.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-03-12 11:15:27 +01:00
parent d9be9b57f2
commit 58615cd5dc
2 changed files with 14 additions and 2 deletions

View File

@ -4454,9 +4454,10 @@ static D3D12_RAYTRACING_TIER d3d12_device_determine_ray_tracing_tier(struct d3d1
* but Vulkan is essentially specced to match DXR directly. */
info->ray_tracing_pipeline_properties.shaderGroupHandleSize == D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES &&
info->ray_tracing_pipeline_properties.shaderGroupBaseAlignment <= D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT &&
info->ray_tracing_pipeline_properties.shaderGroupHandleAlignment <= D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT &&
info->ray_tracing_pipeline_properties.maxRayRecursionDepth >= D3D12_RAYTRACING_MAX_DECLARABLE_TRACE_RECURSION_DEPTH)
info->ray_tracing_pipeline_properties.shaderGroupHandleAlignment <= D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT)
{
/* DXR has 31 ray depth min-spec, but no content uses that. We will instead pass through implementations
* which only expose 1 level of recursion and fail PSO compiles if they actually exceed device limits. */
supports_vbo_formats = true;
for (i = 0; i < ARRAY_SIZE(required_vbo_formats); i++)
{

View File

@ -813,6 +813,17 @@ static HRESULT d3d12_state_object_compile_pipeline(struct d3d12_state_object *ob
pipeline_create_info.pDynamicState = &dynamic_state;
pipeline_create_info.maxPipelineRayRecursionDepth = data->pipeline_config->MaxTraceRecursionDepth;
if (data->pipeline_config->MaxTraceRecursionDepth >
object->device->device_info.ray_tracing_pipeline_properties.maxRayRecursionDepth)
{
/* We cannot do anything about this, since we let sub-minspec devices through,
* and this content actually tries to use recursion. */
ERR("MaxTraceRecursionDepth %u exceeds device limit of %u.\n",
data->pipeline_config->MaxTraceRecursionDepth,
object->device->device_info.ray_tracing_pipeline_properties.maxRayRecursionDepth);
return E_INVALIDARG;
}
dynamic_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
dynamic_state.pNext = NULL;
dynamic_state.flags = 0;