Commit 5231c8c8 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3dcompiler: Allow D3DCompile2() to succeed with null output shader blob pointer.

parent 472d802a
......@@ -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)))
{
......
......@@ -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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment