vkd3d: Implement private data for query heaps.

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:
Józef Kucia 2019-01-04 14:34:18 +01:00 committed by Alexandre Julliard
parent c9bd123bd0
commit e13fb138cd
3 changed files with 30 additions and 6 deletions

View File

@ -2630,6 +2630,8 @@ static ULONG STDMETHODCALLTYPE d3d12_query_heap_Release(ID3D12QueryHeap *iface)
struct d3d12_device *device = heap->device;
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
vkd3d_private_store_destroy(&heap->private_store);
VK_CALL(vkDestroyQueryPool(device->vk_device, heap->vk_query_pool, NULL));
vkd3d_free(heap);
@ -2643,25 +2645,31 @@ static ULONG STDMETHODCALLTYPE d3d12_query_heap_Release(ID3D12QueryHeap *iface)
static HRESULT STDMETHODCALLTYPE d3d12_query_heap_GetPrivateData(ID3D12QueryHeap *iface,
REFGUID guid, UINT *data_size, void *data)
{
FIXME("iface %p, guid %s, data_size %p, data %p stub!", iface, debugstr_guid(guid), data_size, data);
struct d3d12_query_heap *heap = impl_from_ID3D12QueryHeap(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_get_private_data(&heap->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_query_heap_SetPrivateData(ID3D12QueryHeap *iface,
REFGUID guid, UINT data_size, const void *data)
{
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
struct d3d12_query_heap *heap = impl_from_ID3D12QueryHeap(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_set_private_data(&heap->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_query_heap_SetPrivateDataInterface(ID3D12QueryHeap *iface,
REFGUID guid, const IUnknown *data)
{
FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
struct d3d12_query_heap *heap = impl_from_ID3D12QueryHeap(iface);
return E_NOTIMPL;
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
return vkd3d_set_private_data_interface(&heap->private_store, guid, data);
}
static HRESULT STDMETHODCALLTYPE d3d12_query_heap_SetName(ID3D12QueryHeap *iface, const WCHAR *name)
@ -2774,6 +2782,8 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
return hresult_from_vk_result(vr);
}
vkd3d_private_store_init(&object->private_store);
ID3D12Device_AddRef(&device->ID3D12Device_iface);
TRACE("Created query heap %p.\n", object);

View File

@ -467,6 +467,8 @@ struct d3d12_query_heap
struct d3d12_device *device;
struct vkd3d_private_store private_store;
uint64_t availability_mask[];
};

View File

@ -2562,6 +2562,7 @@ static void test_private_data(void)
D3D12_COMMAND_SIGNATURE_DESC command_signature_desc;
D3D12_DESCRIPTOR_HEAP_DESC descriptor_heap_desc;
D3D12_INDIRECT_ARGUMENT_DESC argument_desc;
D3D12_QUERY_HEAP_DESC query_heap_desc;
D3D12_COMMAND_QUEUE_DESC queue_desc;
ID3D12RootSignature *root_signature;
ULONG refcount, expected_refcount;
@ -2592,6 +2593,7 @@ static void test_private_data(void)
&IID_ID3D12Fence,
&IID_ID3D12Heap,
&IID_ID3D12PipelineState,
&IID_ID3D12QueryHeap,
&IID_ID3D12Resource,
&IID_ID3D12RootSignature,
};
@ -2687,6 +2689,16 @@ static void test_private_data(void)
root_signature, DXGI_FORMAT_R8G8B8A8_UNORM, NULL, NULL, NULL);
ID3D12RootSignature_Release(root_signature);
}
else if (IsEqualGUID(tests[i], &IID_ID3D12QueryHeap))
{
vkd3d_test_set_context("query heap");
query_heap_desc.Type = D3D12_QUERY_HEAP_TYPE_OCCLUSION;
query_heap_desc.Count = 8;
query_heap_desc.NodeMask = 0;
hr = ID3D12Device_CreateQueryHeap(device, &query_heap_desc,
&IID_ID3D12QueryHeap, (void **)&unknown);
ok(hr == S_OK, "Failed to create query heap, hr %#x.\n", hr);
}
else if (IsEqualGUID(tests[i], &IID_ID3D12Resource))
{
vkd3d_test_set_context("resource");