On 9 December 2016 at 11:30, Józef Kucia jkucia@codeweavers.com wrote:
Signed-off-by: Józef Kucia jkucia@codeweavers.com
The test was slightly changed. If it still fails the failures should be more clear now after "d3d11/tests: Print expected result in case of failures in check_texture_sub_resource_*() functions."
Still fails:
d3d11.c:6532: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6537: Test failed: Got 0.00000000e+000, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6542: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6563: Test failed: Got 6.00000024e-001, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6568: Test failed: Got 1.00000000e+000, expected 2.00000003e-001 at (0, 0), sub-resource 0. d3d11.c:6594: Test failed: Got 0.00000000e+000, expected 1.00000000e+002 at (0, 0), sub-resource 0. d3d11.c:6599: Test failed: Got 1.00000000e+002, expected 2.55000000e+002 at (0, 0), sub-resource 0. d3d11.c:6608: Test failed: Got 2.55199997e+002, expected 3.29999995e+000 at (0, 0), sub-resource 0. d3d11.c:6613: Test failed: Got 3.29999995e+000, expected 4.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6618: Test failed: Got 4.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6532: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6537: Test failed: Got 0.00000000e+000, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6542: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6563: Test failed: Got 6.00000024e-001, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6568: Test failed: Got 1.00000000e+000, expected 2.00000003e-001 at (0, 0), sub-resource 0. d3d11.c:6532: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6537: Test failed: Got 0.00000000e+000, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6542: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6563: Test failed: Got 6.00000024e-001, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6568: Test failed: Got 1.00000000e+000, expected 2.00000003e-001 at (0, 0), sub-resource 0. d3d11.c:6594: Test failed: Got 0.00000000e+000, expected 1.00000000e+002 at (0, 0), sub-resource 0. d3d11.c:6599: Test failed: Got 1.00000000e+002, expected 2.55000000e+002 at (0, 0), sub-resource 0. d3d11.c:6608: Test failed: Got 2.55199997e+002, expected 3.29999995e+000 at (0, 0), sub-resource 0. d3d11.c:6613: Test failed: Got 3.29999995e+000, expected 4.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6618: Test failed: Got 4.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6532: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6537: Test failed: Got 0.00000000e+000, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6542: Test failed: Got 1.00000000e+000, expected 0.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6563: Test failed: Got 6.00000024e-001, expected 1.00000000e+000 at (0, 0), sub-resource 0. d3d11.c:6568: Test failed: Got 1.00000000e+000, expected 2.00000003e-001 at (0, 0), sub-resource 0.
So I investigated this a little, and the issue seems to be that as soon as D3D11_BIND_SHADER_RESOURCE is in the bind flags, reads from the depth texture return stale values. E.g., the failure at line 6563 is from the 0.6f written by the clear at line 6544. This can also be reproduced by calling check_texture_float() directly on the depth texture, and is not specific to typeless formats. I'd guess at a driver bug related to e.g. compressed depth or fast clear handling. Regardless, I'd expect that using separate resources for the clear and the shader reads would fix the failures, although it would perhaps weaken the test a little.