From: Zebediah Figura zfigura@codeweavers.com
Some drivers (AMD Radeon RX 6700 XT, with radeonsi from Mesa 22.2.0-rc3) emit less than one invocation per pixel, presumably because they detect that the shader control flow is uniform for all pixels. Having the control flow depend on SV_Position avoids this test failure.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index acc85f03b23..ca05f373c11 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -4743,7 +4743,6 @@ static void test_occlusion_query(void)
static void test_pipeline_statistics_query(void) { - static const struct vec4 red = {1.0f, 0.0f, 0.0f, 1.0f}; static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
struct d3d10core_test_context test_context; @@ -4751,9 +4750,27 @@ static void test_pipeline_statistics_query(void) D3D10_QUERY_DESC query_desc; ID3D10Asynchronous *query; unsigned int data_size; + ID3D10PixelShader *ps; ID3D10Device *device; HRESULT hr;
+ static const DWORD ps_code[] = + { +#if 0 + float4 main(float4 pos : sv_position) : sv_target + { + return pos; + } +#endif + 0x43425844, 0xac408178, 0x2ca4213f, 0x4f2551e1, 0x1626b422, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x0000003c, 0x00000040, + 0x0000000f, 0x04002064, 0x001010f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + if (!init_test_context(&test_context)) return;
@@ -4796,8 +4813,12 @@ static void test_pipeline_statistics_query(void) todo_wine ok(!data.PSInvocations, "Got unexpected PSInvocations count: %u.\n", (unsigned int)data.PSInvocations);
+ hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D10Device_PSSetShader(device, ps); + ID3D10Asynchronous_Begin(query); - draw_color_quad(&test_context, &red); + draw_quad(&test_context); ID3D10Asynchronous_End(query); get_query_data(query, &data, sizeof(data)); ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); @@ -4809,6 +4830,7 @@ static void test_pipeline_statistics_query(void) ok(data.CPrimitives == 2, "Got unexpected CPrimitives count: %u.\n", (unsigned int)data.CPrimitives); ok(data.PSInvocations >= 640 * 480, "Got unexpected PSInvocations count: %u.\n", (unsigned int)data.PSInvocations);
+ ID3D10PixelShader_Release(ps); ID3D10Asynchronous_Release(query); release_test_context(&test_context); }
From: Zebediah Figura zfigura@codeweavers.com
Some drivers (AMD Radeon RX 6700 XT, with radeonsi from Mesa 22.2.0-rc3) emit less than one invocation per pixel, presumably because they detect that the shader control flow is uniform for all pixels. Having the control flow depend on SV_Position avoids this test failure.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 5e00bc7a336..f3913d240d4 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6020,7 +6020,6 @@ static void test_occlusion_query(void) static void test_pipeline_statistics_query(void) { static const D3D11_QUERY_DATA_PIPELINE_STATISTICS zero_data = {0}; - static const struct vec4 red = {1.0f, 0.0f, 0.0f, 1.0f}; static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
D3D11_QUERY_DATA_PIPELINE_STATISTICS data; @@ -6029,9 +6028,27 @@ static void test_pipeline_statistics_query(void) D3D11_QUERY_DESC query_desc; ID3D11Asynchronous *query; unsigned int data_size; + ID3D11PixelShader *ps; ID3D11Device *device; HRESULT hr;
+ static const DWORD ps_code[] = + { +#if 0 + float4 main(float4 pos : sv_position) : sv_target + { + return pos; + } +#endif + 0x43425844, 0xac408178, 0x2ca4213f, 0x4f2551e1, 0x1626b422, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x705f7673, 0x7469736f, 0x006e6f69, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x0000003c, 0x00000040, + 0x0000000f, 0x04002064, 0x001010f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + if (!init_test_context(&test_context, NULL)) return;
@@ -6091,8 +6108,12 @@ static void test_pipeline_statistics_query(void) ok(!data.CSInvocations, "Got unexpected CSInvocations count: %u.\n", (unsigned int)data.CSInvocations); }
+ hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + ID3D11DeviceContext_Begin(context, query); - draw_color_quad(&test_context, &red); + draw_quad(&test_context); ID3D11DeviceContext_End(context, query); get_query_data(context, query, &data, sizeof(data)); ok(data.IAVertices == 4, "Got unexpected IAVertices count: %u.\n", (unsigned int)data.IAVertices); @@ -6107,6 +6128,7 @@ static void test_pipeline_statistics_query(void) ok(!data.DSInvocations, "Got unexpected DSInvocations count: %u.\n", (unsigned int)data.DSInvocations); ok(!data.CSInvocations, "Got unexpected CSInvocations count: %u.\n", (unsigned int)data.CSInvocations);
+ ID3D11PixelShader_Release(ps); ID3D11Asynchronous_Release(query); release_test_context(&test_context); }
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=123482
Your paranoid android.
=== w1064_adm (64 bit report) ===
d3d11: d3d11.c:5914: Test failed: Got unexpected query result 0x0000000000000000.
From: Zebediah Figura zfigura@codeweavers.com
This is the d3d10core counterpart to d741742e327cb0a68a63ab49b1a632ede02bd689.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index ca05f373c11..f8468675c5b 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -4743,6 +4743,7 @@ static void test_occlusion_query(void)
static void test_pipeline_statistics_query(void) { + static const D3D10_QUERY_DATA_PIPELINE_STATISTICS zero_data; static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
struct d3d10core_test_context test_context; @@ -4803,15 +4804,26 @@ static void test_pipeline_statistics_query(void)
ID3D10Asynchronous_End(query); get_query_data(query, &data, sizeof(data)); - 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); - ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); - 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); - todo_wine - ok(!data.PSInvocations, "Got unexpected PSInvocations count: %u.\n", (unsigned int)data.PSInvocations); + + /* WARP devices randomly return all-zeroed structures as if the draw did not happen. Flushing and + * sleeping a second before ending the query reduces the likelyhood of hitting the bug a lot, but + * does not eliminate it entirely. To make things work reliably ignore such broken results. */ + if (is_warp_device(device) && !memcmp(&data, &zero_data, sizeof(data))) + { + win_skip("WARP device randomly returns zeroed query results.\n"); + } + else + { + 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); + ok(!data.GSInvocations, "Got unexpected GSInvocations count: %u.\n", (unsigned int)data.GSInvocations); + 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); + todo_wine + ok(!data.PSInvocations, "Got unexpected PSInvocations count: %u.\n", (unsigned int)data.PSInvocations); + }
hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
This merge request was approved by Jan Sikorski.