vkd3d-utils: Do not emit implicit truncation warnings from D3DCompile2VKD3D() before version 42.

This commit is contained in:
Elizabeth Figura 2024-06-21 11:33:58 -05:00 committed by Henri Verbeet
parent 8515fcbc70
commit d507acb5ac
Notes: Henri Verbeet 2024-09-03 17:17:14 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/963

View File

@ -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_preprocess_info preprocess_info;
struct vkd3d_shader_hlsl_source_info hlsl_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_info compile_info;
struct vkd3d_shader_compile_option *option; struct vkd3d_shader_compile_option *option;
struct vkd3d_shader_code byte_code; 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; 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); ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages);
if (messages && messages_blob) if (messages && messages_blob)