From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/Makefile.in | 1 + include/d3d9on12.h | 84 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 include/d3d9on12.h
diff --git a/include/Makefile.in b/include/Makefile.in index f70aeb9414b..805188e5f17 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -138,6 +138,7 @@ SOURCES = \ d3d8types.h \ d3d9.h \ d3d9caps.h \ + d3d9on12.h \ d3d9types.h \ d3dcaps.h \ d3dcommon.idl \ diff --git a/include/d3d9on12.h b/include/d3d9on12.h new file mode 100644 index 00000000000..72293f439bd --- /dev/null +++ b/include/d3d9on12.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Mohamad Al-Jaf + * + * 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 _WINE_D3D9ON12_H_ +#define _WINE_D3D9ON12_H_ + +#include "d3d9.h" +#include "d3d12.h" + +#define MAX_D3D9ON12_QUEUES 2 + +typedef struct D3D9ON12_ARGS +{ + BOOL Enable9On12; + IUnknown *pD3D12Device; + IUnknown *ppD3D12Queues[MAX_D3D9ON12_QUEUES]; + UINT NumQueues; + UINT NodeMask; +} D3D9ON12_ARGS; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef IDirect3D9 * (__stdcall *PFN_Direct3DCreate9On12)(UINT sdk_version, D3D9ON12_ARGS *override_list, UINT override_entries); +IDirect3D9 * __stdcall Direct3DCreate9On12(UINT,D3D9ON12_ARGS *,UINT); + +DEFINE_GUID(IID_IDirect3DDevice9On12, 0xe7fda234, 0xb589, 0x4049, 0x94, 0x0d, 0x88, 0x78, 0x97, 0x75, 0x31, 0xc8); +typedef struct IDirect3DDevice9On12 *LPDIRECT3DDEVICE9ON12, *PDIRECT3DDEVICE9ON12; + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9On12 +DECLARE_INTERFACE_(IDirect3DDevice9On12, IUnknown) +{ + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* IDirect3DDevice9On12 methods */ + STDMETHOD(GetD3D12Device)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD(UnwrapUnderlyingResource)(THIS_ IDirect3DResource9 *resource, ID3D12CommandQueue *queue, REFIID riid, void **out) PURE; + STDMETHOD(ReturnUnderlyingResource)(THIS_ IDirect3DResource9 *resource, UINT num_sync, UINT64 *signal_values, ID3D12Fence **fences) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +/* IUnknown methods */ +#define IDirect3DDevice9On12_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9On12_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9On12_Release(p) (p)->lpVtbl->Release(p) +/* IDirect3DDevice9On12 methods */ +#define IDirect3DDevice9On12_GetD3D12Device(p,a,b) (p)->lpVtbl->GetD3D12Device(p,a,b) +#define IDirect3DDevice9On12_UnwrapUnderlyingResource(p,a,b,c,d) (p)->lpVtbl->UnwrapUnderlyingResource(p,a,b,c,d) +#define IDirect3DDevice9On12_ReturnUnderlyingResource(p,a,b,c,d) (p)->lpVtbl->ReturnUnderlyingResource(p,a,b,c,d) +#else +/* IUnknown methods */ +#define IDirect3DDevice9On12_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9On12_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9On12_Release(p) (p)->Release() +/* IDirect3DDevice9On12 methods */ +#define IDirect3DDevice9On12_GetD3D12Device(p,a,b) (p)->GetD3D12Device(a,b) +#define IDirect3DDevice9On12_UnwrapUnderlyingResource(p,a,b,c,d) (p)->UnwrapUnderlyingResource(a,b,c,d) +#define IDirect3DDevice9On12_ReturnUnderlyingResource(p,a,b,c,d) (p)->ReturnUnderlyingResource(a,b,c,d) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _WINE_D3D9ON12_H_ */