protonscr

test_copy_buffer_to_depth_stencil checks undef value of 8 MSBs when copying depth from D24S8

vkd3dclosed
HansKristian-Work/vkd3d-proton#872 · opened 2021-10-25 by werman · updated 2021-11-09 · 1 comments · github
Wwerman 2021-10-25 github

Test separately copies depth and stencil aspects of DS image. At the moment on Turnip it fails with:

test_copy_buffer_to_depth_stencil:622:Test 0: Test failed: Depth is 0xaaffffff
test_copy_buffer_to_depth_stencil:622:Test 0: Test failed: Depth is 0xabffffff
test_copy_buffer_to_depth_stencil:622:Test 0: Test failed: Depth is 0xacffffff
test_copy_buffer_to_depth_stencil:622:Test 0: Test failed: Depth is 0xadffffff
test_copy_buffer_to_depth_stencil:622:Test 1: Test failed: Depth is 0xaa800000
test_copy_buffer_to_depth_stencil:622:Test 1: Test failed: Depth is 0xab800000
test_copy_buffer_to_depth_stencil:622:Test 1: Test failed: Depth is 0xac800000
test_copy_buffer_to_depth_stencil:622:Test 1: Test failed: Depth is 0xad800000
test_copy_buffer_to_depth_stencil:622:Test 2: Test failed: Depth is 0xaa800000
test_copy_buffer_to_depth_stencil:622:Test 2: Test failed: Depth is 0xab800000
test_copy_buffer_to_depth_stencil:622:Test 2: Test failed: Depth is 0xac800000
test_copy_buffer_to_depth_stencil:622:Test 2: Test failed: Depth is 0xad800000
test_copy_buffer_to_depth_stencil:622:Test 8: Test failed: Depth is 0xaaffffff
test_copy_buffer_to_depth_stencil:622:Test 8: Test failed: Depth is 0xabffffff
test_copy_buffer_to_depth_stencil:622:Test 8: Test failed: Depth is 0xacffffff
test_copy_buffer_to_depth_stencil:622:Test 8: Test failed: Depth is 0xadffffff
test_copy_buffer_to_depth_stencil:622:Test 9: Test failed: Depth is 0xaa800000
test_copy_buffer_to_depth_stencil:622:Test 9: Test failed: Depth is 0xab800000
test_copy_buffer_to_depth_stencil:622:Test 9: Test failed: Depth is 0xac800000
test_copy_buffer_to_depth_stencil:622:Test 9: Test failed: Depth is 0xad800000
test_copy_buffer_to_depth_stencil:622:Test 10: Test failed: Depth is 0xaa800000
test_copy_buffer_to_depth_stencil:622:Test 10: Test failed: Depth is 0xab800000
test_copy_buffer_to_depth_stencil:622:Test 10: Test failed: Depth is 0xac800000
test_copy_buffer_to_depth_stencil:622:Test 10: Test failed: Depth is 0xad800000

When copying depth from D24S8 the test doesn't like that in 8 MSBs there is a stencil value. However VK spec states:

data copied to or from the depth aspect of a VK_FORMAT_X8_D24_UNORM_PACK32 or 
VK_FORMAT_D24_UNORM_S8_UINT format is packed with one 32-bit word per texel with the D24 value
in the LSBs of the word, and undefined values in the eight MSBs.

https://github.com/HansKristian-Work/vkd3d-proton/blob/5657f799749d60bbc3d536a80b1514ddc8b24c9b/tests/d3d12_copy.c#L523-L533

This comment only confuses me...

On the other hand I don't know what d3d12 expects in this case.

HHansKristian-Work maintainer 2021-10-25 github

AMD returns the full 32-bit FP value on native, and NV gives you 24-bit. I guess our equal check could do (v & 0xffffff) == depth_24 to handle the case where the top bits are undefined. They're not undefined on NV apparently, but not 100% sure what spec says here. Copying D24 is a pretty messy topic.

Nothing extracted yet.