mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Move invalid BC1_UNORM buffer view tests to d3d12_invalid_usage.
Device is removed after CreateUnorderedAccessView(). Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d1492e3465
commit
619bc19bdd
@ -2543,10 +2543,6 @@ static void test_create_unordered_access_view(void)
|
||||
|
||||
cpu_handle.ptr += descriptor_size;
|
||||
|
||||
/* The following call fails. Buffer views cannot be created for compressed formats. */
|
||||
uav_desc.Format = DXGI_FORMAT_BC1_UNORM;
|
||||
ID3D12Device_CreateUnorderedAccessView(device, buffer, NULL, &uav_desc, cpu_handle);
|
||||
|
||||
/* DXGI_FORMAT_R32_UINT view for DXGI_FORMAT_R8G8B8A8_TYPELESS resources. */
|
||||
texture = create_default_texture(device, 8, 8, DXGI_FORMAT_R8G8B8A8_TYPELESS,
|
||||
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
|
@ -286,6 +286,44 @@ static void test_invalid_copy_texture_region(void)
|
||||
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
|
||||
}
|
||||
|
||||
static void test_invalid_unordered_access_views(void)
|
||||
{
|
||||
D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle;
|
||||
ID3D12DescriptorHeap *heap;
|
||||
ID3D12Resource *buffer;
|
||||
ID3D12Device *device;
|
||||
ULONG refcount;
|
||||
|
||||
if (!(device = create_device()))
|
||||
{
|
||||
skip("Failed to create device.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
heap = create_gpu_descriptor_heap(device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 16);
|
||||
|
||||
buffer = create_default_buffer(device, 64 * sizeof(float),
|
||||
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
|
||||
cpu_handle = ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap);
|
||||
|
||||
/* Buffer views cannot be created for compressed formats. */
|
||||
uav_desc.Format = DXGI_FORMAT_BC1_UNORM;
|
||||
uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER;
|
||||
uav_desc.Buffer.FirstElement = 0;
|
||||
uav_desc.Buffer.NumElements = 64;
|
||||
uav_desc.Buffer.StructureByteStride = 0;
|
||||
uav_desc.Buffer.CounterOffsetInBytes = 0;
|
||||
uav_desc.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_NONE;
|
||||
ID3D12Device_CreateUnorderedAccessView(device, buffer, NULL, &uav_desc, cpu_handle);
|
||||
|
||||
ID3D12DescriptorHeap_Release(heap);
|
||||
ID3D12Resource_Release(buffer);
|
||||
refcount = ID3D12Device_Release(device);
|
||||
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
|
||||
}
|
||||
|
||||
START_TEST(d3d12_invalid_usage)
|
||||
{
|
||||
parse_args(argc, argv);
|
||||
@ -294,4 +332,5 @@ START_TEST(d3d12_invalid_usage)
|
||||
|
||||
run_test(test_invalid_resource_barriers);
|
||||
run_test(test_invalid_copy_texture_region);
|
||||
run_test(test_invalid_unordered_access_views);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user