From: Zebediah Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54399 --- dlls/d3d11/tests/d3d11.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1b33664befd..f2b8558262a 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -34832,7 +34832,7 @@ static void test_vertex_formats(void) {DXGI_FORMAT_R8_SNORM, { 2.59842515e-01, 0.0, 0.0, 1.0}},
{DXGI_FORMAT_B8G8R8A8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 5.29411793e-01}}, - {DXGI_FORMAT_B8G8R8X8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01, 1.0}}, + {DXGI_FORMAT_B8G8R8X8_UNORM, { 3.96078438e-01, 2.62745112e-01, 1.29411772e-01}}, };
if (!init_test_context(&test_context, NULL)) @@ -34876,9 +34876,12 @@ static void test_vertex_formats(void) };
static const unsigned int stride = sizeof(*quad); + const struct vec4 *expect = &tests[i].expect; static const unsigned int offset = 0; ID3D11InputLayout *input_layout; + struct resource_readback rb; unsigned int format_support; + struct vec4 value;
hr = ID3D11Device_CheckFormatSupport(device, tests[i].format, &format_support); ok(hr == S_OK || hr == E_FAIL, "Got hr %#lx.\n", hr); @@ -34901,8 +34904,15 @@ static void test_vertex_formats(void) ID3D11DeviceContext_PSSetShader(context, test_context.ps, NULL, 0); ID3D11DeviceContext_Draw(context, 4, 0);
- todo_wine_if (damavand && tests[i].format == DXGI_FORMAT_B8G8R8X8_UNORM) - check_texture_vec4(rt, &tests[i].expect, 1); + get_texture_readback(rt, 0, &rb); + value = *get_readback_vec4(&rb, 0, 0); + /* AMD supports B8G8R8X8_UNORM but puts garbage in the w component. */ + if (tests[i].format == DXGI_FORMAT_B8G8R8X8_UNORM) + value.w = 0.0f; + ok(compare_vec4(&value, expect, 1), + "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + value.x, value.y, value.z, value.w, expect->x, expect->y, expect->z, expect->w); + release_resource_readback(&rb);
ID3D11InputLayout_Release(input_layout);
From: Zebediah Figura zfigura@codeweavers.com
This does not work reliably on Windows. The application in question uses a managed texture.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53743 --- dlls/d3d9/tests/visual.c | 76 ++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 45 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index a7d88adbc00..aa6197710d8 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -27967,11 +27967,11 @@ static void test_managed_generate_mipmap(void) release_test_context(&context); }
-/* Some applications lock a mipmapped texture at level 0, write every level at - * once, and expect it to be uploaded. */ +/* Some applications (Vivisector, Cryostasis) lock a mipmapped managed texture + * at level 0, write every level at once, and expect it to be uploaded. */ static void test_mipmap_upload(void) { - unsigned int i, j, width, level_count; + unsigned int j, width, level_count; struct d3d9_test_context context; IDirect3DTexture9 *texture; D3DLOCKED_RECT locked_rect; @@ -27979,64 +27979,50 @@ static void test_mipmap_upload(void) unsigned int *mem; HRESULT hr;
- static const D3DPOOL pools[] = - { - D3DPOOL_MANAGED, - D3DPOOL_SYSTEMMEM, - }; - if (!init_test_context(&context)) return; device = context.device;
- for (i = 0; i < ARRAY_SIZE(pools); ++i) - { - winetest_push_context("pool %#x", pools[i]); - - hr = IDirect3DDevice9_CreateTexture(device, 32, 32, 0, 0, - D3DFMT_A8R8G8B8, pools[i], &texture, NULL); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - - level_count = IDirect3DBaseTexture9_GetLevelCount(texture); - - hr = IDirect3DTexture9_LockRect(texture, 0, &locked_rect, NULL, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_CreateTexture(device, 32, 32, 0, 0, + D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- mem = locked_rect.pBits; + level_count = IDirect3DBaseTexture9_GetLevelCount(texture);
- for (j = 0; j < level_count; ++j) - { - width = 32 >> j; - memset(mem, 0x11 * (j + 1), width * width * 4); - mem += width * width; - } + hr = IDirect3DTexture9_LockRect(texture, 0, &locked_rect, NULL, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IDirect3DTexture9_UnlockRect(texture, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + mem = locked_rect.pBits;
- for (j = 0; j < level_count; ++j) - { - winetest_push_context("level %u", j); + for (j = 0; j < level_count; ++j) + { + width = 32 >> j; + memset(mem, 0x11 * (j + 1), width * width * 4); + mem += width * width; + }
- hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DTexture9_UnlockRect(texture, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, j); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + for (j = 0; j < level_count; ++j) + { + winetest_push_context("level %u", j);
- draw_textured_quad(&context, texture); - /* AMD Windows drivers don't sample from sysmem textures. */ - check_rt_color_broken(context.backbuffer, 0x00111111 * (j + 1), 0x00000000, pools[i] == D3DPOOL_SYSTEMMEM); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- winetest_pop_context(); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, j); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- IDirect3DTexture9_Release(texture); + draw_textured_quad(&context, texture); + check_rt_color(context.backbuffer, 0x00111111 * (j + 1));
winetest_pop_context(); } + + IDirect3DTexture9_Release(texture); release_test_context(&context); }
From: Zebediah Figura zfigura@codeweavers.com
This does not work reliably on Windows. The application in question uses a managed texture. --- dlls/d3d8/tests/visual.c | 76 ++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 45 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index b7688e9251a..13b6a8eee95 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -12129,11 +12129,11 @@ static void test_managed_reset(void) release_test_context(&context); }
-/* Some applications lock a mipmapped texture at level 0, write every level at - * once, and expect it to be uploaded. */ +/* Some applications (Vivisector, Cryostasis) lock a mipmapped managed texture + * at level 0, write every level at once, and expect it to be uploaded. */ static void test_mipmap_upload(void) { - unsigned int i, j, width, level_count; + unsigned int j, width, level_count; struct d3d8_test_context context; IDirect3DTexture8 *texture; D3DLOCKED_RECT locked_rect; @@ -12141,64 +12141,50 @@ static void test_mipmap_upload(void) unsigned int *mem; HRESULT hr;
- static const D3DPOOL pools[] = - { - D3DPOOL_MANAGED, - D3DPOOL_SYSTEMMEM, - }; - if (!init_test_context(&context)) return; device = context.device;
- for (i = 0; i < ARRAY_SIZE(pools); ++i) - { - winetest_push_context("pool %#x", pools[i]); - - hr = IDirect3DDevice8_CreateTexture(device, 32, 32, 0, 0, - D3DFMT_A8R8G8B8, pools[i], &texture); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - - level_count = IDirect3DBaseTexture8_GetLevelCount(texture); - - hr = IDirect3DTexture8_LockRect(texture, 0, &locked_rect, NULL, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice8_CreateTexture(device, 32, 32, 0, 0, + D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- mem = locked_rect.pBits; + level_count = IDirect3DBaseTexture8_GetLevelCount(texture);
- for (j = 0; j < level_count; ++j) - { - width = 32 >> j; - memset(mem, 0x11 * (j + 1), width * width * 4); - mem += width * width; - } + hr = IDirect3DTexture8_LockRect(texture, 0, &locked_rect, NULL, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IDirect3DTexture8_UnlockRect(texture, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + mem = locked_rect.pBits;
- for (j = 0; j < level_count; ++j) - { - winetest_push_context("level %u", j); + for (j = 0; j < level_count; ++j) + { + width = 32 >> j; + memset(mem, 0x11 * (j + 1), width * width * 4); + mem += width * width; + }
- hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DTexture8_UnlockRect(texture, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, j); - ok(hr == S_OK, "Got hr %#lx.\n", hr); + for (j = 0; j < level_count; ++j) + { + winetest_push_context("level %u", j);
- draw_textured_quad(&context, texture); - /* AMD Windows drivers don't sample from sysmem textures. */ - check_rt_color_broken(context.backbuffer, 0x00111111 * (j + 1), 0x00000000, pools[i] == D3DPOOL_SYSTEMMEM); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- winetest_pop_context(); - } + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAXMIPLEVEL, j); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
- IDirect3DTexture8_Release(texture); + draw_textured_quad(&context, texture); + check_rt_color(context.backbuffer, 0x00111111 * (j + 1));
winetest_pop_context(); } + + IDirect3DTexture8_Release(texture); release_test_context(&context); }
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d10core/tests/d3d10core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index a8283da9c18..6aad99faaaf 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -4916,7 +4916,7 @@ static void test_pipeline_statistics_query(void) ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); ok(data.IAPrimitives == 2, "Got unexpected IAPrimitives count: %u.\n", (unsigned int)data.IAPrimitives); ok(data.VSInvocations == 4, "Got unexpected VSInvocations count: %u.\n", (unsigned int)data.VSInvocations); - todo_wine_if (damavand) ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); + /* AMD has nonzero GSInvocations on Windows. */ ok(!data.GSPrimitives, "Got unexpected GSPrimitives count: %u.\n", (unsigned int)data.GSPrimitives); ok(data.CInvocations == 2, "Got unexpected CInvocations count: %u.\n", (unsigned int)data.CInvocations); ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u.\n", (unsigned int)data.CPrimitives); @@ -4935,7 +4935,7 @@ static void test_pipeline_statistics_query(void) ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); ok(data.IAPrimitives == 2, "Got unexpected IAPrimitives count: %u.\n", (unsigned int)data.IAPrimitives); ok(data.VSInvocations == 4, "Got unexpected VSInvocations count: %u.\n", (unsigned int)data.VSInvocations); - todo_wine_if (damavand) ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); + /* AMD has nonzero GSInvocations on Windows. */ ok(!data.GSPrimitives, "Got unexpected GSPrimitives count: %u.\n", (unsigned int)data.GSPrimitives); ok(data.CInvocations == 2, "Got unexpected CInvocations count: %u.\n", (unsigned int)data.CInvocations); ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u.\n", (unsigned int)data.CPrimitives);
From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d11/tests/d3d11.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index f2b8558262a..1134a7bc7a5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6200,8 +6200,7 @@ static void test_pipeline_statistics_query(void) ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); ok(data.IAPrimitives == 2, "Got unexpected IAPrimitives count: %u.\n", (unsigned int)data.IAPrimitives); ok(data.VSInvocations == 4, "Got unexpected VSInvocations count: %u.\n", (unsigned int)data.VSInvocations); - todo_wine_if (damavand) - ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); + /* AMD has nonzero GSInvocations on Windows. */ ok(!data.GSPrimitives, "Got unexpected GSPrimitives count: %u.\n", (unsigned int)data.GSPrimitives); ok(data.CInvocations == 2, "Got unexpected CInvocations count: %u.\n", (unsigned int)data.CInvocations); ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u.\n", (unsigned int)data.CPrimitives); @@ -6223,8 +6222,7 @@ static void test_pipeline_statistics_query(void) ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); ok(data.IAPrimitives == 2, "Got unexpected IAPrimitives count: %u.\n", (unsigned int)data.IAPrimitives); ok(data.VSInvocations == 4, "Got unexpected VSInvocations count: %u.\n", (unsigned int)data.VSInvocations); - todo_wine_if (damavand) - ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); + /* AMD has nonzero GSInvocations on Windows. */ ok(!data.GSPrimitives, "Got unexpected GSPrimitives count: %u.\n", (unsigned int)data.GSPrimitives); ok(data.CInvocations == 2, "Got unexpected CInvocations count: %u.\n", (unsigned int)data.CInvocations); ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u.\n", (unsigned int)data.CPrimitives);
From: Zebediah Figura zfigura@codeweavers.com
For some arcane reason the native AMD driver on Windows seems to fail to clear (or read from?) layer 0. Work around that by using 0.0 there. --- dlls/d3d10core/tests/d3d10core.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index 6aad99faaaf..5a915125180 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -8428,7 +8428,7 @@ static void test_sample_c_lz(void) 0x0020800a, 0x00000000, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00100006, 0x00000000, 0x0100003e, }; - static const float depth_values[] = {1.0f, 0.0f, 0.5f, 0.6f, 0.4f, 0.1f}; + static const float depth_values[] = {0.0f, 1.0f, 0.5f, 0.6f, 0.4f, 0.1f}; static const struct { unsigned int layer; @@ -8437,8 +8437,8 @@ static void test_sample_c_lz(void) } tests[] = { - {0, 0.5f, 0.0f}, - {1, 0.5f, 1.0f}, + {0, 0.5f, 1.0f}, + {1, 0.5f, 0.0f}, {2, 0.5f, 0.0f}, {3, 0.5f, 0.0f}, {4, 0.5f, 1.0f}, @@ -8451,8 +8451,8 @@ static void test_sample_c_lz(void) {4, 0.0f, 0.0f}, {5, 0.0f, 0.0f},
- {0, 1.0f, 0.0f}, - {1, 1.0f, 1.0f}, + {0, 1.0f, 1.0f}, + {1, 1.0f, 0.0f}, {2, 1.0f, 1.0f}, {3, 1.0f, 1.0f}, {4, 1.0f, 1.0f}, @@ -8539,6 +8539,8 @@ static void test_sample_c_lz(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i) { + winetest_push_context("Layer %u, ref %f", tests[i].layer, tests[i].d_ref); + ps_constant.x = tests[i].d_ref; ps_constant.y = tests[i].layer; ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, @@ -8548,6 +8550,8 @@ static void test_sample_c_lz(void) /* Avoid testing values affected by seamless cube map filtering. */ SetRect(&rect, 100, 100, 540, 380); check_texture_sub_resource_float(rt_texture, 0, &rect, tests[i].expected, 2); + + winetest_pop_context(); }
ID3D10Texture2D_Release(texture);
From: Zebediah Figura zfigura@codeweavers.com
For some arcane reason the native AMD driver on Windows seems to fail to clear (or read from?) layer 0. Work around that by using 0.0 there. --- dlls/d3d11/tests/d3d11.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1134a7bc7a5..0fb856489d0 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -10959,7 +10959,7 @@ static void test_sample_c_lz(void) 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00100006, 0x00000000, 0x0100003e, }; - static const float depth_values[] = {1.0f, 0.0f, 0.5f, 0.6f, 0.4f, 0.1f}; + static const float depth_values[] = {0.0f, 1.0f, 0.5f, 0.6f, 0.4f, 0.1f}; static const struct { unsigned int layer; @@ -10968,8 +10968,8 @@ static void test_sample_c_lz(void) } tests[] = { - {0, 0.5f, 0.0f}, - {1, 0.5f, 1.0f}, + {0, 0.5f, 1.0f}, + {1, 0.5f, 0.0f}, {2, 0.5f, 0.0f}, {3, 0.5f, 0.0f}, {4, 0.5f, 1.0f}, @@ -10982,8 +10982,8 @@ static void test_sample_c_lz(void) {4, 0.0f, 0.0f}, {5, 0.0f, 0.0f},
- {0, 1.0f, 0.0f}, - {1, 1.0f, 1.0f}, + {0, 1.0f, 1.0f}, + {1, 1.0f, 0.0f}, {2, 1.0f, 1.0f}, {3, 1.0f, 1.0f}, {4, 1.0f, 1.0f},
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139171
Your paranoid android.
=== debian11 (32 bit ja:JP report) ===
Report validation errors: d3d11:d3d11 returned a non-zero exit code despite reporting no failures
This merge request was approved by Jan Sikorski.