1 | /* $Id: VBoxD3DAdapter9.c 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Windows Guest Mesa3D - Gallium driver interface.
|
---|
4 | *
|
---|
5 | * ID3DAdapter9 C wrappers.
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2016-2022 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #if 0
|
---|
21 | /*
|
---|
22 | * Can't use Windows SDK headers because WINAPI is defined as empty in Mesa.
|
---|
23 | *
|
---|
24 | * Include mesa D3D9 headers in that order. This will prevent inclusion of d3d9.h
|
---|
25 | * from d3dadapter9.h, because _D3D9_H_ and other guard defines will be already
|
---|
26 | * defined by D3D9/d3d9.h, etc.
|
---|
27 | */
|
---|
28 | #include <D3D9/d3d9types.h>
|
---|
29 | #include <D3D9/d3d9caps.h>
|
---|
30 | #include <D3D9/d3d9.h>
|
---|
31 | #ifndef _D3D9_H_
|
---|
32 | #error Gallium header did not define_D3D9_H_
|
---|
33 | #endif
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #include <iprt/win/windows.h>
|
---|
37 | #include <d3d9types.h>
|
---|
38 | #include <d3d9caps.h>
|
---|
39 | #include <iprt/win/d3d9.h>
|
---|
40 | #include <d3dadapter/d3dadapter9.h>
|
---|
41 |
|
---|
42 | /* ID3DAdapter9 interface has a C++ declaration. However Gallium uses C.
|
---|
43 | * The wrappers makes sure that we are using "native" Gallium interface from WDDM C++ code.
|
---|
44 | */
|
---|
45 |
|
---|
46 | HRESULT D3DAdapter9_QueryInterface(ID3DAdapter9 *This, REFIID riid, void **ppvObject)
|
---|
47 | {
|
---|
48 | return ID3DAdapter9_QueryInterface(This, riid, ppvObject);
|
---|
49 | }
|
---|
50 |
|
---|
51 | ULONG D3DAdapter9_AddRef(ID3DAdapter9 *This)
|
---|
52 | {
|
---|
53 | return ID3DAdapter9_AddRef(This);
|
---|
54 | }
|
---|
55 |
|
---|
56 | ULONG D3DAdapter9_Release(ID3DAdapter9 *This)
|
---|
57 | {
|
---|
58 | return ID3DAdapter9_Release(This);
|
---|
59 | }
|
---|
60 |
|
---|
61 | HRESULT D3DAdapter9_GetAdapterIdentifier(ID3DAdapter9 *This, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier)
|
---|
62 | {
|
---|
63 | return ID3DAdapter9_GetAdapterIdentifier(This, Flags, pIdentifier);
|
---|
64 | }
|
---|
65 |
|
---|
66 | HRESULT D3DAdapter9_CheckDeviceType(ID3DAdapter9 *This, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed)
|
---|
67 | {
|
---|
68 | return ID3DAdapter9_CheckDeviceType(This, DevType, AdapterFormat, BackBufferFormat, bWindowed);
|
---|
69 | }
|
---|
70 |
|
---|
71 | HRESULT D3DAdapter9_CheckDeviceFormat(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat)
|
---|
72 | {
|
---|
73 | return ID3DAdapter9_CheckDeviceFormat(This, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
|
---|
74 | }
|
---|
75 |
|
---|
76 | HRESULT D3DAdapter9_CheckDeviceMultiSampleType(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels)
|
---|
77 | {
|
---|
78 | return ID3DAdapter9_CheckDeviceMultiSampleType(This, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels);
|
---|
79 | }
|
---|
80 |
|
---|
81 | HRESULT D3DAdapter9_CheckDepthStencilMatch(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat)
|
---|
82 | {
|
---|
83 | return ID3DAdapter9_CheckDepthStencilMatch(This, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
|
---|
84 | }
|
---|
85 |
|
---|
86 | HRESULT D3DAdapter9_CheckDeviceFormatConversion(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat)
|
---|
87 | {
|
---|
88 | return ID3DAdapter9_CheckDeviceFormatConversion(This, DeviceType, SourceFormat, TargetFormat);
|
---|
89 | }
|
---|
90 |
|
---|
91 | HRESULT D3DAdapter9_GetDeviceCaps(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps)
|
---|
92 | {
|
---|
93 | return ID3DAdapter9_GetDeviceCaps(This, DeviceType, pCaps);
|
---|
94 | }
|
---|
95 |
|
---|
96 | HRESULT D3DAdapter9_CreateDevice(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3D9 *pD3D9, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9 **ppReturnedDeviceInterface)
|
---|
97 | {
|
---|
98 | return ID3DAdapter9_CreateDevice(This, RealAdapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pD3D9, pPresentationFactory, ppReturnedDeviceInterface);
|
---|
99 | }
|
---|
100 |
|
---|
101 | HRESULT D3DAdapter9_CreateDeviceEx(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3D9Ex *pD3D9Ex, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9Ex **ppReturnedDeviceInterface)
|
---|
102 | {
|
---|
103 | return ID3DAdapter9_CreateDeviceEx(This, RealAdapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, pD3D9Ex, pPresentationFactory, ppReturnedDeviceInterface);
|
---|
104 | }
|
---|