Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- include/vkd3d_utils.h | 2 ++ libs/vkd3d-utils/vkd3d_utils.map | 1 + libs/vkd3d-utils/vkd3d_utils_main.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+)
diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index 02687ed..489795a 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -47,6 +47,8 @@ HRESULT WINAPI D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *desc D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob);
/* 1.2 */ +HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob); + HRESULT WINAPI D3D12CreateDeviceVKD3D(IUnknown *adapter, D3D_FEATURE_LEVEL feature_level, REFIID iid, void **device, enum vkd3d_api_version api_version); HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data, diff --git a/libs/vkd3d-utils/vkd3d_utils.map b/libs/vkd3d-utils/vkd3d_utils.map index fb39124..3c05bbc 100644 --- a/libs/vkd3d-utils/vkd3d_utils.map +++ b/libs/vkd3d-utils/vkd3d_utils.map @@ -1,6 +1,7 @@ VKD3D_1_0 { global: + D3DCreateBlob; D3D12CreateDevice; D3D12CreateDeviceVKD3D; D3D12CreateRootSignatureDeserializer; diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index c19fe7f..d270bda 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -232,3 +232,21 @@ void vkd3d_destroy_event(HANDLE event) ERR("Failed to destroy condition variable, error %d.\n", rc); vkd3d_free(impl); } + +HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob) +{ + HRESULT hr; + void *data; + + TRACE("data_size %lu, blob %p.\n", data_size, blob); + + if (!(data = vkd3d_calloc(data_size, 1))) + return E_OUTOFMEMORY; + + if (FAILED(hr = vkd3d_create_blob(data, data_size, blob))) + { + WARN("Failed to create blob object, hr %#x.\n", hr); + vkd3d_free(data); + } + return hr; +}