From d507acb5ac49d3726e8af24c7cf8ba05f926d704 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Fri, 21 Jun 2024 11:33:58 -0500 Subject: [PATCH] vkd3d-utils: Do not emit implicit truncation warnings from D3DCompile2VKD3D() before version 42. --- libs/vkd3d-utils/vkd3d_utils_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index a36d93cc..d5708267 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -243,7 +243,7 @@ HRESULT WINAPI D3DCompile2VKD3D(const void *data, SIZE_T data_size, const char * { struct vkd3d_shader_preprocess_info preprocess_info; struct vkd3d_shader_hlsl_source_info hlsl_info; - struct vkd3d_shader_compile_option options[6]; + struct vkd3d_shader_compile_option options[7]; struct vkd3d_shader_compile_info compile_info; struct vkd3d_shader_compile_option *option; struct vkd3d_shader_code byte_code; @@ -343,6 +343,13 @@ HRESULT WINAPI D3DCompile2VKD3D(const void *data, SIZE_T data_size, const char * option->value = true; } + if (compiler_version < 42) + { + option = &options[compile_info.option_count++]; + option->name = VKD3D_SHADER_COMPILE_OPTION_WARN_IMPLICIT_TRUNCATION; + option->value = false; + } + ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages); if (messages && messages_blob)