vkd3d-utils: Introduce D3DCreateBlob().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-09-23 11:07:48 -05:00 committed by Alexandre Julliard
parent e5fea6ade0
commit b72a2893c2
6 changed files with 51 additions and 0 deletions

View File

@ -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 \

View File

@ -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 */

View File

@ -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 */

View File

@ -8,6 +8,7 @@ global:
D3D12GetDebugInterface;
D3D12SerializeRootSignature;
D3D12SerializeVersionedRootSignature;
D3DCreateBlob;
vkd3d_create_event;
vkd3d_destroy_event;
vkd3d_signal_event;

View File

@ -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;
}

View File

@ -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>