libs/vkd3d: Add ID3D12RootSignatureDeserializer interface stub.

This commit is contained in:
Józef Kucia 2017-06-27 13:16:47 +02:00
parent d998cb88c5
commit d220ae4bfb
2 changed files with 114 additions and 1 deletions

View File

@ -1811,6 +1811,15 @@ interface ID3D12Debug : IUnknown
void EnableDebugLayer();
};
[uuid(34ab647b-3cc8-46ac-841b-c0965645c046), object, local, pointer_default(unique)]
interface ID3D12RootSignatureDeserializer : IUnknown
{
const D3D12_ROOT_SIGNATURE_DESC *GetRootSignatureDesc();
};
cpp_quote("HRESULT WINAPI D3D12CreateRootSignatureDeserializer(")
cpp_quote("const void *data, SIZE_T data_size, REFIID riid, void **deserializer);")
cpp_quote("HRESULT WINAPI D3D12SerializeRootSignature(")
cpp_quote("const D3D12_ROOT_SIGNATURE_DESC *root_signature,")
cpp_quote("D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob);")

View File

@ -1,5 +1,5 @@
/*
* Copyright 2016 Józef Kucia for CodeWeavers
* Copyright 2016-2017 Józef Kucia for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -46,3 +46,107 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
return return_interface((IUnknown *)&object->ID3D12Device_iface, &IID_ID3D12Device,
riid, device);
}
struct d3d12_root_signature_deserializer
{
ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer_iface;
LONG refcount;
D3D12_ROOT_SIGNATURE_DESC desc;
};
static struct d3d12_root_signature_deserializer *impl_from_ID3D12RootSignatureDeserializer(
ID3D12RootSignatureDeserializer *iface)
{
return CONTAINING_RECORD(iface, struct d3d12_root_signature_deserializer, ID3D12RootSignatureDeserializer_iface);
}
static HRESULT STDMETHODCALLTYPE d3d12_root_signature_deserializer_QueryInterface(
ID3D12RootSignatureDeserializer *iface, REFIID riid, void **object)
{
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
/* QueryInterface() implementation seems to be broken, E_NOINTERFACE is
* returned for IUnknown. */
if (IsEqualGUID(riid, &IID_ID3D12RootSignatureDeserializer))
{
ID3D12RootSignatureDeserializer_AddRef(iface);
*object = iface;
return S_OK;
}
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*object = NULL;
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_AddRef(ID3D12RootSignatureDeserializer *iface)
{
struct d3d12_root_signature_deserializer *deserializer = impl_from_ID3D12RootSignatureDeserializer(iface);
ULONG refcount = InterlockedIncrement(&deserializer->refcount);
TRACE("%p increasing refcount to %u.\n", deserializer, refcount);
return refcount;
}
static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_Release(ID3D12RootSignatureDeserializer *iface)
{
struct d3d12_root_signature_deserializer *deserializer = impl_from_ID3D12RootSignatureDeserializer(iface);
ULONG refcount = InterlockedDecrement(&deserializer->refcount);
TRACE("%p decreasing refcount to %u.\n", deserializer, refcount);
if (!refcount)
{
vkd3d_free(deserializer);
}
return refcount;
}
static const D3D12_ROOT_SIGNATURE_DESC * STDMETHODCALLTYPE d3d12_root_signature_deserializer_GetRootSignatureDesc(
ID3D12RootSignatureDeserializer *iface)
{
struct d3d12_root_signature_deserializer *deserializer = impl_from_ID3D12RootSignatureDeserializer(iface);
TRACE("iface %p.\n", iface);
return &deserializer->desc;
}
static const struct ID3D12RootSignatureDeserializerVtbl d3d12_root_signature_deserializer_vtbl =
{
/* IUnknown methods */
d3d12_root_signature_deserializer_QueryInterface,
d3d12_root_signature_deserializer_AddRef,
d3d12_root_signature_deserializer_Release,
/* ID3D12RootSignatureDeserializer methods */
d3d12_root_signature_deserializer_GetRootSignatureDesc,
};
static void d3d12_root_signature_deserializer_init(struct d3d12_root_signature_deserializer *deserializer)
{
deserializer->ID3D12RootSignatureDeserializer_iface.lpVtbl = &d3d12_root_signature_deserializer_vtbl;
deserializer->refcount = 1;
memset(&deserializer->desc, 0, sizeof(deserializer->desc));
}
HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T data_size,
REFIID riid, void **deserializer)
{
struct d3d12_root_signature_deserializer *object;
FIXME("data %p, data_size %lu, riid %s, deserializer %p partial-stub!\n",
data, data_size, debugstr_guid(riid), deserializer);
if (!(object = vkd3d_malloc(sizeof(*object))))
return E_OUTOFMEMORY;
d3d12_root_signature_deserializer_init(object);
return return_interface((IUnknown *)&object->ID3D12RootSignatureDeserializer_iface,
&IID_ID3D12RootSignatureDeserializer, riid, deserializer);
}