[PATCH v2 0/2] MR5760: d3dcompiler: Make use of vkd3d 1.12 effect compilation options.
-- v2: d3dcompiler: Enable D3DCOMPILE_EFFECT_CHILD_EFFECT option. https://gitlab.winehq.org/wine/wine/-/merge_requests/5760
From: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d3d10/tests/effect.c | 12 +++--------- dlls/d3dcompiler_43/compiler.c | 8 +++++++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 534ea00fa17..572493e3a40 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -9912,10 +9912,8 @@ static void test_effect_compiler(void) cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); hr = cb->lpVtbl->GetDesc(cb, &var_desc); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (hr == S_OK) - ok(!strcmp(var_desc.Name, "$Globals"), "Unexpected variable name %s.\n", var_desc.Name); + ok(!strcmp(var_desc.Name, "$Globals"), "Unexpected variable name %s.\n", var_desc.Name); ID3D10Effect_Release(effect); ID3D10Blob_Release(blob); @@ -9936,21 +9934,17 @@ static void test_effect_compiler(void) cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 0); hr = cb->lpVtbl->GetDesc(cb, &var_desc); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(!strcmp(var_desc.Name, "$Globals"), "Unexpected variable name %s.\n", var_desc.Name); cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 1); hr = cb->lpVtbl->GetDesc(cb, &var_desc); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (hr == S_OK) - ok(!strcmp(var_desc.Name, "cb1"), "Unexpected variable name %s.\n", var_desc.Name); + ok(!strcmp(var_desc.Name, "cb1"), "Unexpected variable name %s.\n", var_desc.Name); cb = effect->lpVtbl->GetConstantBufferByIndex(effect, 2); hr = cb->lpVtbl->GetDesc(cb, &var_desc); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (hr == S_OK) - ok(!strcmp(var_desc.Name, "cb2"), "Unexpected variable name %s.\n", var_desc.Name); + ok(!strcmp(var_desc.Name, "cb2"), "Unexpected variable name %s.\n", var_desc.Name); ID3D10Effect_Release(effect); ID3D10Blob_Release(blob); diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 4b2b05df917..6a829ae43d7 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -457,7 +457,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen struct d3dcompiler_include_from_file include_from_file; struct vkd3d_shader_preprocess_info preprocess_info; struct vkd3d_shader_hlsl_source_info hlsl_info; - struct vkd3d_shader_compile_option options[4]; + struct vkd3d_shader_compile_option options[5]; struct vkd3d_shader_compile_info compile_info; struct vkd3d_shader_compile_option *option; struct vkd3d_shader_code byte_code; @@ -557,6 +557,12 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen option->value = VKD3D_SHADER_COMPILE_OPTION_BACKCOMPAT_MAP_SEMANTIC_NAMES; } +#if D3D_COMPILER_VERSION <= 39 + option = &options[compile_info.option_count++]; + option->name = VKD3D_SHADER_COMPILE_OPTION_INCLUDE_EMPTY_BUFFERS_IN_EFFECTS; + option->value = true; +#endif + ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages); if (ret) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5760
From: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d3dcompiler_43/compiler.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 6a829ae43d7..6fffcfb82ab 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -457,7 +457,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen struct d3dcompiler_include_from_file include_from_file; struct vkd3d_shader_preprocess_info preprocess_info; struct vkd3d_shader_hlsl_source_info hlsl_info; - struct vkd3d_shader_compile_option options[5]; + struct vkd3d_shader_compile_option options[6]; struct vkd3d_shader_compile_info compile_info; struct vkd3d_shader_compile_option *option; struct vkd3d_shader_code byte_code; @@ -485,8 +485,8 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen { FIXME("Ignoring flags %#x.\n", flags); } - if (effect_flags) - FIXME("Ignoring effect flags %#x.\n", effect_flags); + if (effect_flags & ~D3DCOMPILE_EFFECT_CHILD_EFFECT) + FIXME("Ignoring effect flags %#x.\n", effect_flags & ~D3DCOMPILE_EFFECT_CHILD_EFFECT); if (secondary_flags) FIXME("Ignoring secondary flags %#x.\n", secondary_flags); @@ -557,6 +557,13 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen option->value = VKD3D_SHADER_COMPILE_OPTION_BACKCOMPAT_MAP_SEMANTIC_NAMES; } + if (effect_flags & D3DCOMPILE_EFFECT_CHILD_EFFECT) + { + option = &options[compile_info.option_count++]; + option->name = VKD3D_SHADER_COMPILE_OPTION_CHILD_EFFECT; + option->value = true; + } + #if D3D_COMPILER_VERSION <= 39 option = &options[compile_info.option_count++]; option->name = VKD3D_SHADER_COMPILE_OPTION_INCLUDE_EMPTY_BUFFERS_IN_EFFECTS; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5760
On Fri May 31 14:18:00 2024 +0000, Nikolay Sivov wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/5760/diffs?diff_id=116021&start_sha=e25dc7e48864dd5c3ca2ddbcd29f75e3ed7c5164#7e597c6cf1e6254eccf53f99a8c6f4adbf968eb1_489_489) Sure, done.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5760#note_71925
This merge request was approved by Matteo Bruni. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5760
participants (3)
-
Matteo Bruni (@Mystral) -
Nikolay Sivov -
Nikolay Sivov (@nsivov)