[PATCH vkd3d 1/2] vkd3d/tests: Add tests for GetCopyableFootprints() depth/stencil planes.

Conor McCarthy cmccarthy at codeweavers.com
Mon Dec 9 02:50:34 CST 2019


Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 tests/d3d12.c            | 19 +++++++++++++++++++
 tests/d3d12_test_utils.h |  1 +
 2 files changed, 20 insertions(+)

diff --git a/tests/d3d12.c b/tests/d3d12.c
index 323ef23..1e0e25f 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -18810,6 +18810,8 @@ static void test_get_copyable_footprints(void)
         {DXGI_FORMAT_BC6H_UF16, true},
         {DXGI_FORMAT_BC6H_SF16, true},
         {DXGI_FORMAT_BC7_UNORM, true},
+        {DXGI_FORMAT_D32_FLOAT, false},
+        {DXGI_FORMAT_D24_UNORM_S8_UINT, false},
     };
     static const uint64_t base_offsets[] =
     {
@@ -18855,6 +18857,14 @@ static void test_get_copyable_footprints(void)
             {D3D12_RESOURCE_DIMENSION_TEXTURE3D, 3, 2, 2, 2, 2, DXGI_FORMAT_BC1_UNORM,
                 {1, 0}, D3D12_TEXTURE_LAYOUT_UNKNOWN, D3D12_RESOURCE_FLAG_NONE}, 0, 1,
         },
+        {
+            {D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, 4, 4, 1, 1, DXGI_FORMAT_D32_FLOAT,
+                {1, 0}, D3D12_TEXTURE_LAYOUT_UNKNOWN, D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL}, 0, 2,
+        },
+        {
+            {D3D12_RESOURCE_DIMENSION_TEXTURE2D, 0, 4, 4, 1, 1, DXGI_FORMAT_D24_UNORM_S8_UINT,
+                {1, 0}, D3D12_TEXTURE_LAYOUT_UNKNOWN, D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL}, 0, 3,
+        },
     };
 
     if (!(device = create_device()))
@@ -18894,6 +18904,15 @@ static void test_get_copyable_footprints(void)
             sub_resource_count = resource_desc.MipLevels;
             if (resources[i].dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D)
                 sub_resource_count *= resource_desc.DepthOrArraySize;
+            if (resource_desc.Format == DXGI_FORMAT_D24_UNORM_S8_UINT)
+            {
+                if (!vkd3d_test_platform_is_windows())
+                {
+                    skip("Depth/stencil planes are not supported.\n");
+                    continue;
+                }
+                sub_resource_count *= 2;
+            }
             assert(sub_resource_count <= ARRAY_SIZE(layouts));
 
             for (k = 0; k < ARRAY_SIZE(base_offsets); ++k)
diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h
index 5092183..f9d49de 100644
--- a/tests/d3d12_test_utils.h
+++ b/tests/d3d12_test_utils.h
@@ -308,6 +308,7 @@ static unsigned int format_size(DXGI_FORMAT format)
         case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
         case DXGI_FORMAT_R8G8B8A8_UINT:
         case DXGI_FORMAT_B8G8R8A8_UNORM:
+        case DXGI_FORMAT_D24_UNORM_S8_UINT:
             return 4;
         case DXGI_FORMAT_R16_FLOAT:
         case DXGI_FORMAT_R16_UNORM:
-- 
2.24.0




More information about the wine-devel mailing list