Zebediah Figura : vkd3d-utils: Introduce D3DCreateBlob().
Alexandre Julliard
julliard at winehq.org
Thu Sep 24 15:48:59 CDT 2020
Module: vkd3d
Branch: master
Commit: b72a2893c27d40b4cb5fd0d7f6cf0e47adc54a20
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=b72a2893c27d40b4cb5fd0d7f6cf0e47adc54a20
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Wed Sep 23 11:07:48 2020 -0500
vkd3d-utils: Introduce D3DCreateBlob().
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
Makefile.am | 1 +
include/vkd3d_d3dcompiler.h | 26 ++++++++++++++++++++++++++
include/vkd3d_utils.h | 3 +++
libs/vkd3d-utils/vkd3d_utils.map | 1 +
libs/vkd3d-utils/vkd3d_utils_main.c | 18 ++++++++++++++++++
libs/vkd3d-utils/vkd3d_utils_private.h | 2 ++
6 files changed, 51 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index d0c7cd5..fe6ba92 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,7 @@ vkd3d_public_headers = \
include/vkd3d_d3d12.h \
include/vkd3d_d3d12sdklayers.h \
include/vkd3d_d3dcommon.h \
+ include/vkd3d_d3dcompiler.h \
include/vkd3d_dxgibase.h \
include/vkd3d_dxgiformat.h \
include/vkd3d_shader.h \
diff --git a/include/vkd3d_d3dcompiler.h b/include/vkd3d_d3dcompiler.h
new file mode 100644
index 0000000..25f6044
--- /dev/null
+++ b/include/vkd3d_d3dcompiler.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2010 Matteo Bruni for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __VKD3D_D3DCOMPILER_H
+#define __VKD3D_D3DCOMPILER_H
+#ifndef __D3DCOMPILER_H__
+
+HRESULT WINAPI D3DCreateBlob(SIZE_T size, ID3D10Blob **blob);
+
+#endif /* __D3DCOMPILER_H__ */
+#endif /* __VKD3D_D3DCOMPILER_H */
diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h
index 02687ed..f1fc4db 100644
--- a/include/vkd3d_utils.h
+++ b/include/vkd3d_utils.h
@@ -54,6 +54,9 @@ HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data,
HRESULT WINAPI D3D12SerializeVersionedRootSignature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc,
ID3DBlob **blob, ID3DBlob **error_blob);
+/* 1.3 */
+HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/libs/vkd3d-utils/vkd3d_utils.map b/libs/vkd3d-utils/vkd3d_utils.map
index fb39124..20d182c 100644
--- a/libs/vkd3d-utils/vkd3d_utils.map
+++ b/libs/vkd3d-utils/vkd3d_utils.map
@@ -8,6 +8,7 @@ global:
D3D12GetDebugInterface;
D3D12SerializeRootSignature;
D3D12SerializeVersionedRootSignature;
+ D3DCreateBlob;
vkd3d_create_event;
vkd3d_destroy_event;
vkd3d_signal_event;
diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c
index c19fe7f..ffb655f 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_blob_create(data, data_size, blob)))
+ {
+ WARN("Failed to create blob object, hr %#x.\n", hr);
+ vkd3d_free(data);
+ }
+ return hr;
+}
diff --git a/libs/vkd3d-utils/vkd3d_utils_private.h b/libs/vkd3d-utils/vkd3d_utils_private.h
index 6b5851e..3c73f42 100644
--- a/libs/vkd3d-utils/vkd3d_utils_private.h
+++ b/libs/vkd3d-utils/vkd3d_utils_private.h
@@ -25,7 +25,9 @@
#include <pthread.h>
#include <vkd3d.h>
+#include <vkd3d_shader.h>
+#include "vkd3d_blob.h"
#include "vkd3d_memory.h"
#include <vkd3d_utils.h>
More information about the wine-cvs
mailing list