Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- include/vkd3d.h | 4 ++++ libs/vkd3d/vkd3d.map | 1 + libs/vkd3d/vkd3d_main.c | 14 ++++---------- 3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/include/vkd3d.h b/include/vkd3d.h index 0ef8105..f05eb56 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -193,6 +193,8 @@ HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGN HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
+HRESULT vkd3d_create_blob(void *buffer, SIZE_T size, ID3DBlob **blob); + #endif /* VKD3D_NO_PROTOTYPES */
/* @@ -236,6 +238,8 @@ typedef HRESULT (*PFN_vkd3d_serialize_versioned_root_signature)(const D3D12_VERS typedef HRESULT (*PFN_vkd3d_create_versioned_root_signature_deserializer)(const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
+typedef HRESULT (*PFN_vkd3d_create_blob)(void *buffer, SIZE_T size, ID3DBlob **blob); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/libs/vkd3d/vkd3d.map b/libs/vkd3d/vkd3d.map index 6f1f376..d1515d9 100644 --- a/libs/vkd3d/vkd3d.map +++ b/libs/vkd3d/vkd3d.map @@ -2,6 +2,7 @@ VKD3D_1_0 { global: vkd3d_acquire_vk_queue; + vkd3d_create_blob; vkd3d_create_device; vkd3d_create_image_resource; vkd3d_create_instance; diff --git a/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/vkd3d_main.c index 7775077..9e05f11 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -520,7 +520,7 @@ static void d3d_blob_init(struct d3d_blob *blob, void *buffer, SIZE_T size) blob->size = size; }
-static HRESULT d3d_blob_create(void *buffer, SIZE_T size, struct d3d_blob **blob) +HRESULT vkd3d_create_blob(void *buffer, SIZE_T size, ID3DBlob **blob) { struct d3d_blob *object;
@@ -531,7 +531,7 @@ static HRESULT d3d_blob_create(void *buffer, SIZE_T size, struct d3d_blob **blob
TRACE("Created blob object %p.\n", object);
- *blob = object; + *blob = &object->ID3DBlob_iface;
return S_OK; } @@ -541,7 +541,6 @@ HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, { struct vkd3d_versioned_root_signature_desc vkd3d_desc; struct vkd3d_shader_code dxbc; - struct d3d_blob *blob_object; HRESULT hr; int ret;
@@ -572,15 +571,13 @@ HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, return hresult_from_vkd3d_result(ret); }
- if (FAILED(hr = d3d_blob_create((void *)dxbc.code, dxbc.size, &blob_object))) + if (FAILED(hr = vkd3d_create_blob((void *)dxbc.code, dxbc.size, blob))) { WARN("Failed to create blob object, hr %#x.\n", hr); vkd3d_shader_free_shader_code(&dxbc); return hr; }
- *blob = &blob_object->ID3DBlob_iface; - return S_OK; }
@@ -589,7 +586,6 @@ HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGN { const struct vkd3d_versioned_root_signature_desc *vkd3d_desc; struct vkd3d_shader_code dxbc; - struct d3d_blob *blob_object; HRESULT hr; int ret;
@@ -613,14 +609,12 @@ HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGN return hresult_from_vkd3d_result(ret); }
- if (FAILED(hr = d3d_blob_create((void *)dxbc.code, dxbc.size, &blob_object))) + if (FAILED(hr = vkd3d_create_blob((void *)dxbc.code, dxbc.size, blob))) { WARN("Failed to create blob object, hr %#x.\n", hr); vkd3d_shader_free_shader_code(&dxbc); return hr; }
- *blob = &blob_object->ID3DBlob_iface; - return S_OK; }