mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Implement private data for descriptor 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:
parent
781d856ce3
commit
c9bd123bd0
@ -2373,6 +2373,8 @@ static ULONG STDMETHODCALLTYPE d3d12_descriptor_heap_Release(ID3D12DescriptorHea
|
||||
struct d3d12_device *device = heap->device;
|
||||
unsigned int i;
|
||||
|
||||
vkd3d_private_store_destroy(&heap->private_store);
|
||||
|
||||
switch (heap->desc.Type)
|
||||
{
|
||||
case D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV:
|
||||
@ -2424,25 +2426,31 @@ static ULONG STDMETHODCALLTYPE d3d12_descriptor_heap_Release(ID3D12DescriptorHea
|
||||
static HRESULT STDMETHODCALLTYPE d3d12_descriptor_heap_GetPrivateData(ID3D12DescriptorHeap *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_descriptor_heap *heap = impl_from_ID3D12DescriptorHeap(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_descriptor_heap_SetPrivateData(ID3D12DescriptorHeap *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_descriptor_heap *heap = impl_from_ID3D12DescriptorHeap(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_descriptor_heap_SetPrivateDataInterface(ID3D12DescriptorHeap *iface,
|
||||
REFGUID guid, const IUnknown *data)
|
||||
{
|
||||
FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
|
||||
struct d3d12_descriptor_heap *heap = impl_from_ID3D12DescriptorHeap(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_descriptor_heap_SetName(ID3D12DescriptorHeap *iface, const WCHAR *name)
|
||||
@ -2526,6 +2534,8 @@ static void d3d12_descriptor_heap_init(struct d3d12_descriptor_heap *descriptor_
|
||||
|
||||
descriptor_heap->desc = *desc;
|
||||
|
||||
vkd3d_private_store_init(&descriptor_heap->private_store);
|
||||
|
||||
descriptor_heap->device = device;
|
||||
ID3D12Device_AddRef(&device->ID3D12Device_iface);
|
||||
}
|
||||
|
@ -449,6 +449,8 @@ struct d3d12_descriptor_heap
|
||||
|
||||
struct d3d12_device *device;
|
||||
|
||||
struct vkd3d_private_store private_store;
|
||||
|
||||
BYTE descriptors[];
|
||||
};
|
||||
|
||||
|
@ -2560,6 +2560,7 @@ static void test_create_fence(void)
|
||||
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_COMMAND_QUEUE_DESC queue_desc;
|
||||
ID3D12RootSignature *root_signature;
|
||||
@ -2586,6 +2587,7 @@ static void test_private_data(void)
|
||||
&IID_ID3D12CommandList,
|
||||
&IID_ID3D12CommandQueue,
|
||||
&IID_ID3D12CommandSignature,
|
||||
&IID_ID3D12DescriptorHeap,
|
||||
&IID_ID3D12Device,
|
||||
&IID_ID3D12Fence,
|
||||
&IID_ID3D12Heap,
|
||||
@ -2643,6 +2645,17 @@ static void test_private_data(void)
|
||||
NULL, &IID_ID3D12CommandSignature, (void **)&unknown);
|
||||
ok(hr == S_OK, "Failed to create command signature, hr %#x.\n", hr);
|
||||
}
|
||||
else if (IsEqualGUID(tests[i], &IID_ID3D12DescriptorHeap))
|
||||
{
|
||||
vkd3d_test_set_context("descriptor heap");
|
||||
descriptor_heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
|
||||
descriptor_heap_desc.NumDescriptors = 16;
|
||||
descriptor_heap_desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
|
||||
descriptor_heap_desc.NodeMask = 0;
|
||||
hr = ID3D12Device_CreateDescriptorHeap(device, &descriptor_heap_desc,
|
||||
&IID_ID3D12DescriptorHeap, (void **)&unknown);
|
||||
ok(hr == S_OK, "Failed to create descriptor heap, hr %#x.\n", hr);
|
||||
}
|
||||
else if (IsEqualGUID(tests[i], &IID_ID3D12Device))
|
||||
{
|
||||
vkd3d_test_set_context("device");
|
||||
|
Loading…
x
Reference in New Issue
Block a user