From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/d3dcompiler_43/compiler.c | 2 +- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index d3c7b81df12..a3c7b22581f 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -556,7 +556,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen vkd3d_shader_free_messages(messages); }
- if (!ret) + if (!ret && shader_blob) { if (FAILED(hr = D3DCreateBlob(byte_code.size, shader_blob))) { diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 15af598c90d..b52b840f3bf 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1742,6 +1742,22 @@ static void test_include(void) delete_directory(L"include"); }
+static void test_no_output_blob(void) +{ + static const char vs_source[] = + "float4 main(float4 pos : POSITION, inout float2 texcoord : TEXCOORD0) : POSITION\n" + "{\n" + " return pos;\n" + "}"; + ID3D10Blob *errors; + HRESULT hr; + + errors = (void *)0xdeadbeef; + hr = D3DCompile(vs_source, strlen(vs_source), NULL, NULL, NULL, "main", "vs_2_0", 0, 0, NULL, &errors); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!errors, "Unexpected errors blob.\n"); +} + START_TEST(hlsl_d3d9) { HMODULE mod; @@ -1770,4 +1786,5 @@ START_TEST(hlsl_d3d9) test_constant_table(); test_fail(); test_include(); + test_no_output_blob(); }