VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/VBoxGaD3DDevice9Ex.h@ 93115

Last change on this file since 93115 was 93115, checked in by vboxsync, 2 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.1 KB
Line 
1/* $Id: VBoxGaD3DDevice9Ex.h 93115 2022-01-01 11:31:46Z vboxsync $ */
2/** @file
3 * VirtualBox Windows Guest Mesa3D - Gallium driver interface.
4 *
5 * GaDirect3DDevice9Ex implements IDirect3DDevice9Ex wrapper.
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#ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxGaD3DDevice9Ex_h
21#define GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxGaD3DDevice9Ex_h
22#ifndef RT_WITHOUT_PRAGMA_ONCE
23# pragma once
24#endif
25
26#include "VBoxPresent.h"
27#include "VBoxGallium.h"
28
29class GaDirect3DDevice9Ex: public IGaDirect3DDevice9Ex
30{
31 public:
32 GaDirect3DDevice9Ex(IGaDirect3D9Ex *pD3D9Ex,
33 HANDLE hAdapter,
34 HANDLE hDevice,
35 const D3DDDI_DEVICECALLBACKS *pDeviceCallbacks);
36 virtual ~GaDirect3DDevice9Ex();
37
38 HRESULT Init(D3DDEVTYPE DeviceType,
39 HWND hFocusWindow,
40 DWORD BehaviorFlags,
41 D3DPRESENT_PARAMETERS* pPresentationParameters,
42 D3DDISPLAYMODEEX* pFullscreenDisplayMode);
43
44 /* IUnknown methods */
45 STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj);
46 STDMETHOD_(ULONG,AddRef)(THIS);
47 STDMETHOD_(ULONG,Release)(THIS);
48
49 /* IDirect3DDevice9Ex methods */
50 STDMETHOD(TestCooperativeLevel)(THIS);
51 STDMETHOD_(UINT, GetAvailableTextureMem)(THIS);
52 STDMETHOD(EvictManagedResources)(THIS);
53 STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9);
54 STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps);
55 STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode);
56 STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters);
57 STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap);
58 STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags);
59 STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow);
60 STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain);
61 STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain);
62 STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS);
63 STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters);
64 STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
65 STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer);
66 STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus);
67 STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs);
68 STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp);
69 STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp);
70 STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle);
71 STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle);
72 STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle);
73 STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle);
74 STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle);
75 STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
76 STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
77 STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint);
78 STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture);
79 STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface);
80 STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface);
81 STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter);
82 STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color);
83 STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
84 STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget);
85 STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget);
86 STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil);
87 STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface);
88 STDMETHOD(BeginScene)(THIS);
89 STDMETHOD(EndScene)(THIS);
90 STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil);
91 STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
92 STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix);
93 STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*);
94 STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport);
95 STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport);
96 STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial);
97 STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial);
98 STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*);
99 STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*);
100 STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable);
101 STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable);
102 STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane);
103 STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane);
104 STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value);
105 STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue);
106 STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB);
107 STDMETHOD(BeginStateBlock)(THIS);
108 STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB);
109 STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus);
110 STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus);
111 STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture);
112 STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture);
113 STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue);
114 STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value);
115 STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue);
116 STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value);
117 STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses);
118 STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries);
119 STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries);
120 STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber);
121 STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber);
122 STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect);
123 STDMETHOD(GetScissorRect)(THIS_ RECT* pRect);
124 STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware);
125 STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS);
126 STDMETHOD(SetNPatchMode)(THIS_ float nSegments);
127 STDMETHOD_(float, GetNPatchMode)(THIS);
128 STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount);
129 STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
130 STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
131 STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
132 STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags);
133 STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl);
134 STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl);
135 STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl);
136 STDMETHOD(SetFVF)(THIS_ DWORD FVF);
137 STDMETHOD(GetFVF)(THIS_ DWORD* pFVF);
138 STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader);
139 STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader);
140 STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader);
141 STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
142 STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount);
143 STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
144 STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount);
145 STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
146 STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
147 STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
148 STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride);
149 STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting);
150 STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting);
151 STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData);
152 STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData);
153 STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader);
154 STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader);
155 STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader);
156 STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
157 STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount);
158 STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
159 STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount);
160 STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
161 STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
162 STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
163 STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
164 STDMETHOD(DeletePatch)(THIS_ UINT Handle);
165 STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
166 STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width,UINT height,float* rows,float* columns);
167 STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9* pSrc,IDirect3DSurface9* pDst,IDirect3DVertexBuffer9* pSrcRectDescs,UINT NumRects,IDirect3DVertexBuffer9* pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset);
168 STDMETHOD(PresentEx)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags);
169 STDMETHOD(GetGPUThreadPriority)(THIS_ INT* pPriority);
170 STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority);
171 STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain);
172 STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9** pResourceArray,UINT32 NumResources);
173 STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency);
174 STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT* pMaxLatency);
175 STDMETHOD(CheckDeviceState)(THIS_ HWND hDestinationWindow);
176 STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage);
177 STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage);
178 STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage);
179 STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode);
180 STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation);
181
182 /* IGaDirect3DDevice9Ex methods. */
183 STDMETHOD(EscapeCb)(const void *pvData, uint32_t cbData, bool fHardwareAccess);
184 STDMETHOD(GaSurfaceId)(THIS_ IUnknown *pSurface, uint32_t *pu32Sid);
185 STDMETHOD(GaWDDMContextHandle)(HANDLE *phContext);
186 STDMETHOD(GaFlush)();
187
188 private:
189 void cleanup();
190
191 volatile ULONG mcRefs;
192
193 HANDLE mhAdapter;
194 HANDLE mhDevice;
195 D3DDDI_DEVICECALLBACKS mDeviceCallbacks;
196
197 IGaDirect3D9Ex *mpD3D9Ex;
198 IGalliumStack *mpStack;
199 ID3DPresentGroup *mpPresentationGroup;
200 IDirect3DDevice9Ex *mpDevice;
201};
202
203#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxGaD3DDevice9Ex_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use