diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 83570128cf..4a14846861 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -231,6 +231,7 @@ enum vkd3d_shader_interface_flag VKD3D_SHADER_INTERFACE_RAW_VA_ALIAS_DESCRIPTOR_BUFFER = 0x00000020u, VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER = 0x00000040u, VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FULL = 0x00000080u, + VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FLUSH_NAN = 0x00000100u, }; struct vkd3d_shader_stage_io_entry diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 1b2f11acd4..c14ff4f7e3 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -748,6 +748,8 @@ int vkd3d_shader_compile_dxil(const struct vkd3d_shader_code *dxbc, helper.type = DXIL_SPV_INSTRUCTION_INSTRUMENTATION_TYPE_EXTERNALLY_VISIBLE_WRITE_NAN_INF; if (shader_interface_info->flags & VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FULL) helper.type = DXIL_SPV_INSTRUCTION_INSTRUMENTATION_TYPE_FULL_NAN_INF; + else if (shader_interface_info->flags & VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FLUSH_NAN) + helper.type = DXIL_SPV_INSTRUCTION_INSTRUMENTATION_TYPE_FLUSH_NAN_TO_ZERO; if (dxil_spv_converter_add_option(converter, &helper.base) != DXIL_SPV_SUCCESS) { diff --git a/libs/vkd3d/debug_common.c b/libs/vkd3d/debug_common.c index 1e7510595a..92a24d6422 100644 --- a/libs/vkd3d/debug_common.c +++ b/libs/vkd3d/debug_common.c @@ -112,6 +112,8 @@ void vkd3d_shader_hash_range_parse(FILE *file, struct vkd3d_shader_hash_range ** (*ranges)[new_count].flags = VKD3D_SHADER_HASH_RANGE_QA_FLAG_DISALLOW; else if (strcmp(end_ptr, "full") == 0) (*ranges)[new_count].flags = VKD3D_SHADER_HASH_RANGE_QA_FLAG_FULL_QA; + else if (strcmp(end_ptr, "flush-nan") == 0) + (*ranges)[new_count].flags = VKD3D_SHADER_HASH_RANGE_QA_FLAG_FLUSH_NAN; else end_ptr = "N/A"; diff --git a/libs/vkd3d/descriptor_debug.c b/libs/vkd3d/descriptor_debug.c index 7371e08f29..b37487aa7b 100644 --- a/libs/vkd3d/descriptor_debug.c +++ b/libs/vkd3d/descriptor_debug.c @@ -447,6 +447,11 @@ uint32_t vkd3d_descriptor_debug_get_shader_interface_flags( flags = VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FULL | VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER; } + else if (flags & VKD3D_SHADER_HASH_RANGE_QA_FLAG_FLUSH_NAN) + { + flags = VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER_FLUSH_NAN | + VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER; + } else if (flags & VKD3D_SHADER_HASH_RANGE_QA_FLAG_ALLOW) flags = VKD3D_SHADER_INTERFACE_INSTRUCTION_QA_BUFFER; } diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 63abb30c19..056fdea323 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -3523,7 +3523,8 @@ enum vkd3d_shader_hash_range_qa_flags { VKD3D_SHADER_HASH_RANGE_QA_FLAG_ALLOW = 1 << 0, VKD3D_SHADER_HASH_RANGE_QA_FLAG_DISALLOW = 1 << 1, - VKD3D_SHADER_HASH_RANGE_QA_FLAG_FULL_QA = 1 << 2 + VKD3D_SHADER_HASH_RANGE_QA_FLAG_FULL_QA = 1 << 2, + VKD3D_SHADER_HASH_RANGE_QA_FLAG_FLUSH_NAN = 1 << 3 }; struct vkd3d_shader_hash_range