From: Fan Wenjie fanwj@mail.ustc.edu.cn
--- configure.ac | 2 +- dlls/wined3d/shader_spirv.c | 12 ++++++++++-- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index cba55126869..d60576a8604 100644 --- a/configure.ac +++ b/configure.ac @@ -1161,7 +1161,7 @@ then if test "$ac_cv_mingw_header_vkd3d_h" = "yes" -a "$ac_cv_mingw_header_vkd3d_shader_h" = "yes" then WINE_CHECK_MINGW_LIB(vkd3d,vkd3d_set_log_callback,[:],[:],[$VKD3D_PE_LIBS]) - WINE_CHECK_MINGW_LIB(vkd3d-shader,vkd3d_shader_serialize_dxbc,[:],[:],[$VKD3D_PE_LIBS]) + WINE_CHECK_MINGW_LIB(vkd3d-shader,vkd3d_shader_free_scan_combined_resource_sampler_info,[:],[:],[$VKD3D_PE_LIBS]) if test "$ac_cv_mingw_lib_vkd3d" = "no" -o "$ac_cv_mingw_lib_vkd3d_shader" = "no" then VKD3D_PE_CFLAGS="" diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index b5b0e1f0462..dab0e3dc5f9 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -227,6 +227,14 @@ static void shader_spirv_init_shader_interface_vk(struct wined3d_shader_spirv_sh iface->vkd3d_interface.uav_counter_count = b->uav_counter_count; }
+static enum vkd3d_shader_source_type shader_spirv_get_source_type(uint32_t magic) +{ + if (magic == TAG_DXBC) + return VKD3D_SHADER_SOURCE_DXBC_TPF; + else + return VKD3D_SHADER_SOURCE_D3D_BYTECODE; +} + static VkShaderModule shader_spirv_compile_shader(struct wined3d_context_vk *context_vk, const struct wined3d_shader_desc *shader_desc, enum wined3d_shader_type shader_type, const struct shader_spirv_compile_arguments *args, const struct shader_spirv_resource_bindings *bindings, @@ -252,7 +260,7 @@ static VkShaderModule shader_spirv_compile_shader(struct wined3d_context_vk *con info.next = &compile_args.spirv_target; info.source.code = shader_desc->byte_code; info.source.size = shader_desc->byte_code_size; - info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF; + info.source_type = shader_spirv_get_source_type(*(const uint32_t *)info.source.code); info.target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY; info.options = spirv_compile_options; info.option_count = ARRAY_SIZE(spirv_compile_options); @@ -692,7 +700,7 @@ static void shader_spirv_scan_shader(struct wined3d_shader *shader, info.next = descriptor_info; info.source.code = shader->byte_code; info.source.size = shader->byte_code_size; - info.source_type = VKD3D_SHADER_SOURCE_DXBC_TPF; + info.source_type = shader_spirv_get_source_type(*(const uint32_t *)info.source.code); info.target_type = VKD3D_SHADER_TARGET_SPIRV_BINARY; info.options = spirv_compile_options; info.option_count = ARRAY_SIZE(spirv_compile_options); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5a35ca88a7b..78146799bfd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -92,6 +92,8 @@ static inline const char *wined3d_get_line(const char **ptr, const char *end)
#define WINED3D_BITMAP_SIZE(x) (((x) + 31) >> 5)
+#define TAG_DXBC WINEMAKEFOURCC('D', 'X', 'B', 'C') + struct wined3d_fragment_pipe_ops; struct wined3d_adapter; struct wined3d_context;