vkd3d: Add partial implementation for CreateCommittedResource1().

This commit is contained in:
Nikolay Sivov
2023-10-09 17:13:40 +02:00
committed by Alexandre Julliard
parent 72e8b6e0dc
commit 9c6c7cb78f
Notes: Alexandre Julliard 2023-10-10 23:12:44 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/399
4 changed files with 55 additions and 6 deletions

View File

@@ -1547,6 +1547,7 @@ static void test_create_committed_resource(void)
D3D12_CLEAR_VALUE clear_value;
D3D12_RESOURCE_STATES state;
ID3D12Resource *resource;
ID3D12Device4 *device4;
unsigned int i;
ULONG refcount;
HRESULT hr;
@@ -1837,6 +1838,38 @@ static void test_create_committed_resource(void)
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
}
if (SUCCEEDED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device4, (void **)&device4)))
{
memset(&heap_properties, 0, sizeof(heap_properties));
heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
resource_desc.Alignment = 0;
resource_desc.Width = 32;
resource_desc.Height = 32;
resource_desc.DepthOrArraySize = 1;
resource_desc.MipLevels = 1;
resource_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
resource_desc.SampleDesc.Count = 1;
resource_desc.SampleDesc.Quality = 0;
resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
clear_value.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
clear_value.Color[0] = 1.0f;
clear_value.Color[1] = 0.0f;
clear_value.Color[2] = 0.0f;
clear_value.Color[3] = 1.0f;
hr = ID3D12Device4_CreateCommittedResource1(device4, &heap_properties, D3D12_HEAP_FLAG_NONE,
&resource_desc, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, NULL,
&IID_ID3D12Resource, (void **)&resource);
ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr);
ID3D12Resource_Release(resource);
ID3D12Device4_Release(device4);
}
refcount = ID3D12Device_Release(device);
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
}