From: Henri Verbeet hverbeet@codeweavers.com
--- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 71 ++++++++++----------------- 1 file changed, 27 insertions(+), 44 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 2f7b90b2346..357f215b5d0 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -703,24 +703,19 @@ static void test_trig(void) device = test_context.device;
ps_code = compile_shader(ps_source, "ps_2_0", 0); - if (ps_code) + draw_quad(device, ps_code); + init_readback(device, &rb); + for (i = 0; i < 32; ++i) { - draw_quad(device, ps_code); - init_readback(device, &rb); - - for (i = 0; i < 32; ++i) - { - float expect_x = (sinf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; - float expect_y = (cosf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; - v = get_readback_vec4(&rb, i * 640 / 32, 0); - ok(compare_vec4(v, expect_x, expect_y, 0.0f, 0.0f, 4096), - "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", - i, v->x, v->y, v->z, v->w, expect_x, expect_y, 0.0f, 0.0f); - } - - release_readback(&rb); - ID3D10Blob_Release(ps_code); + float expect_x = (sinf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; + float expect_y = (cosf(i * 2 * M_PI / 32) + 1.0f) / 2.0f; + v = get_readback_vec4(&rb, i * 640 / 32, 0); + ok(compare_vec4(v, expect_x, expect_y, 0.0f, 0.0f, 4096), + "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + i, v->x, v->y, v->z, v->w, expect_x, expect_y, 0.0f, 0.0f); } + release_readback(&rb); + ID3D10Blob_Release(ps_code); release_test_context(&test_context); }
@@ -1086,21 +1081,18 @@ static void test_global_initializer(void) return;
ps_code = compile_shader(ps_source, "ps_2_0", 0); - if (ps_code) - { - hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants); - ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - hr = ID3DXConstantTable_SetDefaults(constants, test_context.device); - ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); - ID3DXConstantTable_Release(constants); - draw_quad(test_context.device, ps_code); + hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID3DXConstantTable_SetDefaults(constants, test_context.device); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + ID3DXConstantTable_Release(constants); + draw_quad(test_context.device, ps_code);
- v = get_color_vec4(test_context.device, 0, 0); - ok(compare_vec4(&v, 0.8f, 0.2f, 0.0f, 0.0f, 4096), - "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + v = get_color_vec4(test_context.device, 0, 0); + ok(compare_vec4(&v, 0.8f, 0.2f, 0.0f, 0.0f, 4096), + "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code); - } + ID3D10Blob_Release(ps_code); release_test_context(&test_context); }
@@ -1739,11 +1731,8 @@ static void test_include(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
/* Windows always seems to resolve includes from the initial file location * instead of using the immediate parent, as it would be the case for @@ -1752,11 +1741,8 @@ static void test_include(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
sprintf(ps_absolute_buffer, ps_absolute_template, include_filename); hr = D3DCompile(ps_absolute_buffer, sizeof(ps_absolute_buffer), filename_a, NULL, @@ -1797,11 +1783,8 @@ static void test_include(void) ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
SetCurrentDirectoryW(directory); #endif /* D3D_COMPILER_VERSION >= 46 */
From: Henri Verbeet hverbeet@codeweavers.com
--- dlls/d3d10_1/tests/d3d10_1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index ef9caac0a6d..9f0ff99b7b4 100644 --- a/dlls/d3d10_1/tests/d3d10_1.c +++ b/dlls/d3d10_1/tests/d3d10_1.c @@ -1067,8 +1067,7 @@ static void test_compile_effect(void) hr = D3D10CompileEffectFromMemory(default_bs_source, strlen(default_bs_source), NULL, NULL, NULL, 0, 0, &blob, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - if (SUCCEEDED(hr)) - ID3D10Blob_Release(blob); + ID3D10Blob_Release(blob);
/* Compilation fails due to 10.1 feature incompatibility with fx_4_0 profile. */ hr = D3D10CompileEffectFromMemory(bs_source2, strlen(bs_source2), NULL, NULL, NULL,
From: Henri Verbeet hverbeet@codeweavers.com
--- dlls/d3dx11_43/tests/d3dx11.c | 48 ++++++----------------------------- 1 file changed, 8 insertions(+), 40 deletions(-)
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 64ee050ec5d..16c0f0bc03e 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -578,16 +578,8 @@ static void test_D3DX11CompileFromFile(void) ok(hr == S_OK && hr == result, "Got unexpected hr %#lx, result %#lx.\n", hr, result); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (errors) - { - ID3D10Blob_Release(errors); - errors = NULL; - } - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
/* Windows always seems to resolve includes from the initial file location * instead of using the immediate parent, as it would be the case for @@ -596,16 +588,8 @@ static void test_D3DX11CompileFromFile(void) ok(hr == S_OK && hr == result, "Got unexpected hr %#lx, result %#lx.\n", hr, result); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (errors) - { - ID3D10Blob_Release(errors); - errors = NULL; - } - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL); @@ -613,16 +597,8 @@ static void test_D3DX11CompileFromFile(void) ok(hr == S_OK && hr == result, "Got unexpected hr %#lx, result %#lx.\n", hr, result); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (errors) - { - ID3D10Blob_Release(errors); - errors = NULL; - } - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
GetCurrentDirectoryW(MAX_PATH, directory); SetCurrentDirectoryW(temp_dir); @@ -631,16 +607,8 @@ static void test_D3DX11CompileFromFile(void) ok(hr == S_OK && hr == result, "Got unexpected hr %#lx, result %#lx.\n", hr, result); ok(!!blob, "Got unexpected blob.\n"); ok(!errors, "Got unexpected errors.\n"); - if (errors) - { - ID3D10Blob_Release(errors); - errors = NULL; - } - if (blob) - { - ID3D10Blob_Release(blob); - blob = NULL; - } + ID3D10Blob_Release(blob); + blob = NULL;
SetCurrentDirectoryW(directory);
From: Matteo Bruni mbruni@codeweavers.com
--- dlls/d3dcompiler_43/tests/hlsl_d3d11.c | 43 ++++++++++---------------- 1 file changed, 16 insertions(+), 27 deletions(-)
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c index 1814b6e38ea..309ba6b2663 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c @@ -497,22 +497,19 @@ static void test_trig(void) return;
ps_code = compile_shader(ps_source, "ps_4_0"); - if (ps_code) - { - draw_quad(&test_context, ps_code); - init_readback(&test_context, &rb); - - for (i = 0; i < 640; i += 20) - { - v = get_readback_vec4(&rb, i, 0); - ok(compare_vec4(v, sinf(i), cosf(i), 0.0f, 0.0f, 16384), - "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", - i, v->x, v->y, v->z, v->w, sinf(i), cos(i), 0.0f, 0.0f); - } + draw_quad(&test_context, ps_code); + init_readback(&test_context, &rb);
- release_readback(&test_context, &rb); - ID3D10Blob_Release(ps_code); + for (i = 0; i < 640; i += 20) + { + v = get_readback_vec4(&rb, i, 0); + ok(compare_vec4(v, sinf(i), cosf(i), 0.0f, 0.0f, 16384), + "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + i, v->x, v->y, v->z, v->w, sinf(i), cos(i), 0.0f, 0.0f); } + + release_readback(&test_context, &rb); + ID3D10Blob_Release(ps_code); release_test_context(&test_context); }
@@ -617,16 +614,13 @@ static void test_sampling(void)
ID3D11DeviceContext_ClearRenderTargetView(test_context.immediate_context, test_context.rtv, red); ps_code = compile_shader_flags(tests[i], "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY); - if (ps_code) - { - draw_quad(&test_context, ps_code); + draw_quad(&test_context, ps_code);
- v = get_color_vec4(&test_context, 0, 0); - ok(compare_vec4(&v, 0.25f, 0.0f, 0.25f, 0.0f, 0), - "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + v = get_color_vec4(&test_context, 0, 0); + ok(compare_vec4(&v, 0.25f, 0.0f, 0.25f, 0.0f, 0), + "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code); - } + ID3D10Blob_Release(ps_code);
winetest_pop_context(); } @@ -821,9 +815,6 @@ static void test_reflection(void) };
code = compile_shader(vs_source, "vs_5_0"); - if (!code) - return; - hr = D3DReflect(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code), &IID_ID3D11ShaderReflection, (void **)&reflection); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -902,8 +893,6 @@ static void test_reflection(void) ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
code = compile_shader_flags(ps_source, "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY); - if (!code) - return; hr = D3DReflect(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code), &IID_ID3D11ShaderReflection, (void **)&reflection); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
This merge request was approved by Matteo Bruni.