From: Victor Chiletto <vchiletto@codeweavers.com> Native's default ID3DInclude implementation treats forward slashes in filenames identically to backward slashes. --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index a0cc1367424..ce64e8f3041 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1788,6 +1788,44 @@ static void test_include(void) delete_directory(L"include"); } +static void test_forward_slash_includes(void) +{ +#if D3D_COMPILER_VERSION >= 46 + WCHAR filename[MAX_PATH], directory[MAX_PATH]; + ID3D10Blob *blob = NULL, *errors = NULL; + HRESULT hr; + static const char ps_code[] = + "#include \"include1.h\"\n" + "\n" + "float4 main() : COLOR\n" + "{\n" + " return LIGHT;\n" + "}"; + static const char include1[] = + "#define LIGHT 1\n"; + + create_directory(L"sources"); + create_file(L"sources\\source.ps", ps_code, strlen(ps_code), filename); + create_file(L"sources\\include1.h", include1, strlen(include1), NULL); + + GetCurrentDirectoryW(MAX_PATH, directory); + SetCurrentDirectoryW(temp_dir); + + hr = D3DCompileFromFile(L"sources/source.ps", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + todo_wine ok(!!blob, "Got unexpected blob.\n"); + todo_wine ok(!errors, "Got unexpected errors.\n"); + ID3D10Blob_Release(blob); + blob = NULL; + + SetCurrentDirectoryW(directory); + + delete_file(L"sources\\source.ps"); + delete_file(L"sources\\include1.h"); + delete_directory(L"sources"); +#endif +} + static void test_no_output_blob(void) { static const char vs_source[] = @@ -1878,4 +1916,5 @@ START_TEST(hlsl_d3d9) test_include(); test_no_output_blob(); test_hlsl_double(); + test_forward_slash_includes(); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10662