Conor McCarthy : tests: Add UINT_MAX layer count tests to test_clear_render_target_view().
Alexandre Julliard
julliard at winehq.org
Tue Oct 12 16:05:32 CDT 2021
Module: vkd3d
Branch: master
Commit: dbb07a40f8524881fbc0f81c5c1842c54401b2f4
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=dbb07a40f8524881fbc0f81c5c1842c54401b2f4
Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date: Tue Oct 12 18:31:15 2021 +0200
tests: Add UINT_MAX layer count tests to test_clear_render_target_view().
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tests/d3d12.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index ac1e24d..9e4dcb5 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -4672,7 +4672,7 @@ static void test_clear_render_target_view(void)
rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DARRAY;
rtv_desc.Texture2DArray.FirstArraySlice = i;
- rtv_desc.Texture2DArray.ArraySize = 1;
+ rtv_desc.Texture2DArray.ArraySize = (i == ARRAY_SIZE(array_colors) - 1) ? UINT_MAX : 1;
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
@@ -4703,7 +4703,7 @@ static void test_clear_render_target_view(void)
rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY;
rtv_desc.Texture2DMSArray.FirstArraySlice = i;
- rtv_desc.Texture2DMSArray.ArraySize = 1;
+ rtv_desc.Texture2DMSArray.ArraySize = (i == ARRAY_SIZE(array_colors) - 1) ? UINT_MAX : 1;
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
@@ -4759,6 +4759,23 @@ static void test_clear_render_target_view(void)
check_readback_data_uint(&rb, &box, 0xbf4c7f19, 1);
release_resource_readback(&rb);
+ rtv_desc.Texture3D.FirstWSlice = 30;
+ rtv_desc.Texture3D.WSize = UINT_MAX;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, green, 0, NULL);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ get_texture_readback_with_command_list(resource, 0, &rb, queue, command_list);
+ set_box(&box, 0, 0, 4, 32, 32, 30);
+ check_readback_data_uint(&rb, &box, 0xbf4c7f19, 1);
+ set_box(&box, 0, 0, 30, 32, 32, 32);
+ check_readback_data_uint(&rb, &box, 0xff00ff00, 1);
+ release_resource_readback(&rb);
+
ID3D12Resource_Release(resource);
ID3D12DescriptorHeap_Release(rtv_heap);
destroy_test_context(&context);
More information about the wine-cvs
mailing list