1 | /* $Id: DevVGA-SVGA3d.h 86886 2020-11-14 02:30:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DevVMWare - VMWare SVGA device - 3D part.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA3d_h
|
---|
19 | #define VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA3d_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "DevVGA-SVGA.h"
|
---|
25 |
|
---|
26 |
|
---|
27 | /** Arbitrary limit */
|
---|
28 | #define SVGA3D_MAX_SHADER_IDS 0x800
|
---|
29 | /** D3D allows up to 8 texture stages. */
|
---|
30 | #define SVGA3D_MAX_TEXTURE_STAGES 8
|
---|
31 | /** Samplers: 16 Pixel Shader + 1 Displacement Map + 4 Vertex Shader */
|
---|
32 | #define SVGA3D_MAX_SAMPLERS_PS 16
|
---|
33 | #define SVGA3D_MAX_SAMPLERS_DMAP 1
|
---|
34 | #define SVGA3D_MAX_SAMPLERS_VS 4
|
---|
35 | #define SVGA3D_MAX_SAMPLERS (SVGA3D_MAX_SAMPLERS_PS + SVGA3D_MAX_SAMPLERS_DMAP + SVGA3D_MAX_SAMPLERS_VS)
|
---|
36 | /** Arbitrary upper limit; seen 8 so far. */
|
---|
37 | #define SVGA3D_MAX_LIGHTS 32
|
---|
38 | /** Arbitrary upper limit; 2GB enough for 32768x16384*4. */
|
---|
39 | #define SVGA3D_MAX_SURFACE_MEM_SIZE 0x80000000
|
---|
40 |
|
---|
41 |
|
---|
42 | /**@def FLOAT_FMT_STR
|
---|
43 | * Format string bits to go with FLOAT_FMT_ARGS. */
|
---|
44 | #define FLOAT_FMT_STR "%s%u.%06u"
|
---|
45 | /** @def FLOAT_FMT_ARGS
|
---|
46 | * Format arguments for a float value, corresponding to FLOAT_FMT_STR.
|
---|
47 | * @param r The floating point value to format. */
|
---|
48 | #define FLOAT_FMT_ARGS(r) (r) >= 0.0f ? "" : "-", (unsigned)RT_ABS(r), (unsigned)(RT_ABS((r) - (unsigned)(r)) * 1000000.0f)
|
---|
49 |
|
---|
50 |
|
---|
51 | typedef enum VMSVGA3D_SURFACE_MAP
|
---|
52 | {
|
---|
53 | VMSVGA3D_SURFACE_MAP_READ,
|
---|
54 | VMSVGA3D_SURFACE_MAP_WRITE,
|
---|
55 | VMSVGA3D_SURFACE_MAP_READ_WRITE,
|
---|
56 | VMSVGA3D_SURFACE_MAP_WRITE_DISCARD,
|
---|
57 | } VMSVGA3D_SURFACE_MAP;
|
---|
58 |
|
---|
59 | typedef struct VMSVGA3D_MAPPED_SURFACE
|
---|
60 | {
|
---|
61 | VMSVGA3D_SURFACE_MAP enmMapType;
|
---|
62 | SVGA3dBox box;
|
---|
63 | uint32_t cbPixel;
|
---|
64 | uint32_t cbRowPitch;
|
---|
65 | uint32_t cbDepthPitch;
|
---|
66 | void *pvData;
|
---|
67 | } VMSVGA3D_MAPPED_SURFACE;
|
---|
68 |
|
---|
69 | #ifdef DUMP_BITMAPS
|
---|
70 | void vmsvga3dMapWriteBmpFile(VMSVGA3D_MAPPED_SURFACE const *pMap, char const *pszPrefix);
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | /* DevVGA-SVGA.cpp: */
|
---|
74 | void vmsvgaR33dSurfaceUpdateHeapBuffersOnFifoThread(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC, uint32_t sid);
|
---|
75 |
|
---|
76 |
|
---|
77 | /* DevVGA-SVGA3d-ogl.cpp & DevVGA-SVGA3d-win.cpp: */
|
---|
78 | int vmsvga3dInit(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC);
|
---|
79 | int vmsvga3dPowerOn(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC);
|
---|
80 | int vmsvga3dLoadExec(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
|
---|
81 | int vmsvga3dSaveExec(PPDMDEVINS pDevIns, PVGASTATECC pThisCC, PSSMHANDLE pSSM);
|
---|
82 | int vmsvga3dTerminate(PVGASTATECC pThisCC);
|
---|
83 | int vmsvga3dReset(PVGASTATECC pThisCC);
|
---|
84 | void vmsvga3dUpdateHostScreenViewport(PVGASTATECC pThisCC, uint32_t idScreen, VMSVGAVIEWPORT const *pOldViewport);
|
---|
85 | int vmsvga3dQueryCaps(PVGASTATECC pThisCC, SVGA3dDevCapIndex idx3dCaps, uint32_t *pu32Val);
|
---|
86 |
|
---|
87 | int vmsvga3dSurfaceDefine(PVGASTATECC pThisCC, uint32_t sid, SVGA3dSurfaceFlags surfaceFlags, SVGA3dSurfaceFormat format,
|
---|
88 | uint32_t multisampleCount, SVGA3dTextureFilter autogenFilter,
|
---|
89 | uint32_t cMipLevels, SVGA3dSize const *pMipLevel0Size);
|
---|
90 | int vmsvga3dSurfaceDestroy(PVGASTATECC pThisCC, uint32_t sid);
|
---|
91 | int vmsvga3dSurfaceCopy(PVGASTATECC pThisCC, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src,
|
---|
92 | uint32_t cCopyBoxes, SVGA3dCopyBox *pBox);
|
---|
93 | int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, PVGASTATECC pThisCC,
|
---|
94 | SVGA3dSurfaceImageId const *pDstSfcImg, SVGA3dBox const *pDstBox,
|
---|
95 | SVGA3dSurfaceImageId const *pSrcSfcImg, SVGA3dBox const *pSrcBox, SVGA3dStretchBltMode enmMode);
|
---|
96 | int vmsvga3dSurfaceDMA(PVGASTATE pThis, PVGASTATECC pThisCC, SVGAGuestImage guest, SVGA3dSurfaceImageId host, SVGA3dTransferType transfer, uint32_t cCopyBoxes, SVGA3dCopyBox *pBoxes);
|
---|
97 | int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, PVGASTATECC pThisCC, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId srcImage, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect);
|
---|
98 |
|
---|
99 | int vmsvga3dContextDefine(PVGASTATECC pThisCC, uint32_t cid);
|
---|
100 | int vmsvga3dContextDestroy(PVGASTATECC pThisCC, uint32_t cid);
|
---|
101 |
|
---|
102 | int vmsvga3dChangeMode(PVGASTATECC pThisCC);
|
---|
103 |
|
---|
104 | int vmsvga3dDefineScreen(PVGASTATE pThis, PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen);
|
---|
105 | int vmsvga3dDestroyScreen(PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen);
|
---|
106 |
|
---|
107 | int vmsvga3dSetTransform(PVGASTATECC pThisCC, uint32_t cid, SVGA3dTransformType type, float matrix[16]);
|
---|
108 | int vmsvga3dSetZRange(PVGASTATECC pThisCC, uint32_t cid, SVGA3dZRange zRange);
|
---|
109 | int vmsvga3dSetRenderState(PVGASTATECC pThisCC, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState);
|
---|
110 | int vmsvga3dSetRenderTarget(PVGASTATECC pThisCC, uint32_t cid, SVGA3dRenderTargetType type, SVGA3dSurfaceImageId target);
|
---|
111 | int vmsvga3dSetTextureState(PVGASTATECC pThisCC, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState);
|
---|
112 | int vmsvga3dSetMaterial(PVGASTATECC pThisCC, uint32_t cid, SVGA3dFace face, SVGA3dMaterial *pMaterial);
|
---|
113 | int vmsvga3dSetLightData(PVGASTATECC pThisCC, uint32_t cid, uint32_t index, SVGA3dLightData *pData);
|
---|
114 | int vmsvga3dSetLightEnabled(PVGASTATECC pThisCC, uint32_t cid, uint32_t index, uint32_t enabled);
|
---|
115 | int vmsvga3dSetViewPort(PVGASTATECC pThisCC, uint32_t cid, SVGA3dRect *pRect);
|
---|
116 | int vmsvga3dSetClipPlane(PVGASTATECC pThisCC, uint32_t cid, uint32_t index, float plane[4]);
|
---|
117 | int vmsvga3dCommandClear(PVGASTATECC pThisCC, uint32_t cid, SVGA3dClearFlag clearFlag, uint32_t color, float depth, uint32_t stencil, uint32_t cRects, SVGA3dRect *pRect);
|
---|
118 | int vmsvga3dCommandPresent(PVGASTATE pThis, PVGASTATECC pThisCC, uint32_t sid, uint32_t cRects, SVGA3dCopyRect *pRect);
|
---|
119 | int vmsvga3dDrawPrimitives(PVGASTATECC pThisCC, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pNumRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor);
|
---|
120 | int vmsvga3dSetScissorRect(PVGASTATECC pThisCC, uint32_t cid, SVGA3dRect *pRect);
|
---|
121 | int vmsvga3dGenerateMipmaps(PVGASTATECC pThisCC, uint32_t sid, SVGA3dTextureFilter filter);
|
---|
122 |
|
---|
123 | int vmsvga3dShaderDefine(PVGASTATECC pThisCC, uint32_t cid, uint32_t shid, SVGA3dShaderType type, uint32_t cbData, uint32_t *pShaderData);
|
---|
124 | int vmsvga3dShaderDestroy(PVGASTATECC pThisCC, uint32_t cid, uint32_t shid, SVGA3dShaderType type);
|
---|
125 | int vmsvga3dShaderSet(PVGASTATECC pThisCC, struct VMSVGA3DCONTEXT *pContext, uint32_t cid, SVGA3dShaderType type, uint32_t shid);
|
---|
126 | int vmsvga3dShaderSetConst(PVGASTATECC pThisCC, uint32_t cid, uint32_t reg, SVGA3dShaderType type, SVGA3dShaderConstType ctype, uint32_t cRegisters, uint32_t *pValues);
|
---|
127 |
|
---|
128 | int vmsvga3dQueryBegin(PVGASTATECC pThisCC, uint32_t cid, SVGA3dQueryType type);
|
---|
129 | int vmsvga3dQueryEnd(PVGASTATECC pThisCC, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult);
|
---|
130 | int vmsvga3dQueryWait(PVGASTATE pThis, PVGASTATECC pThisCC, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult);
|
---|
131 |
|
---|
132 | /* DevVGA-SVGA3d-shared.h: */
|
---|
133 | #if defined(RT_OS_WINDOWS) && defined(IN_RING3)
|
---|
134 | # include <iprt/win/windows.h>
|
---|
135 |
|
---|
136 | # define WM_VMSVGA3D_WAKEUP (WM_APP+1)
|
---|
137 | # define WM_VMSVGA3D_CREATEWINDOW (WM_APP+2)
|
---|
138 | # define WM_VMSVGA3D_DESTROYWINDOW (WM_APP+3)
|
---|
139 | # define WM_VMSVGA3D_EXIT (WM_APP+5)
|
---|
140 | # if 0
|
---|
141 | # define WM_VMSVGA3D_CREATE_DEVICE (WM_APP+6)
|
---|
142 | typedef struct VMSVGA3DCREATEDEVICEPARAMS
|
---|
143 | {
|
---|
144 | struct VMSVGA3DSTATE *pState;
|
---|
145 | struct VMSVGA3DCONTEXT *pContext;
|
---|
146 | struct _D3DPRESENT_PARAMETERS_ *pPresParams;
|
---|
147 | HRESULT hrc;
|
---|
148 | } VMSVGA3DCREATEDEVICEPARAMS;
|
---|
149 | # endif
|
---|
150 |
|
---|
151 | DECLCALLBACK(int) vmsvga3dWindowThread(RTTHREAD ThreadSelf, void *pvUser);
|
---|
152 | int vmsvga3dSendThreadMessage(RTTHREAD pWindowThread, RTSEMEVENT WndRequestSem, UINT msg, WPARAM wParam, LPARAM lParam);
|
---|
153 | int vmsvga3dContextWindowCreate(HINSTANCE hInstance, RTTHREAD pWindowThread, RTSEMEVENT WndRequestSem, HWND *pHwnd);
|
---|
154 |
|
---|
155 | #endif
|
---|
156 |
|
---|
157 | void vmsvga3dUpdateHeapBuffersForSurfaces(PVGASTATECC pThisCC, uint32_t sid);
|
---|
158 | void vmsvga3dInfoContextWorker(PVGASTATECC pThisCC, PCDBGFINFOHLP pHlp, uint32_t cid, bool fVerbose);
|
---|
159 | void vmsvga3dInfoSurfaceWorker(PPDMDEVINS pDevIns, PVGASTATE pThis, PVGASTATECC pThisCC, PCDBGFINFOHLP pHlp, uint32_t sid,
|
---|
160 | bool fVerbose, uint32_t cxAscii, bool fInvY, const char *pszBitmapPath);
|
---|
161 |
|
---|
162 | /* DevVGA-SVGA3d-shared.cpp: */
|
---|
163 |
|
---|
164 | /**
|
---|
165 | * Structure for use with vmsvga3dInfoU32Flags.
|
---|
166 | */
|
---|
167 | typedef struct VMSVGAINFOFLAGS32
|
---|
168 | {
|
---|
169 | /** The flags. */
|
---|
170 | uint32_t fFlags;
|
---|
171 | /** The corresponding mnemonic. */
|
---|
172 | const char *pszJohnny;
|
---|
173 | } VMSVGAINFOFLAGS32;
|
---|
174 | /** Pointer to a read-only flag translation entry. */
|
---|
175 | typedef VMSVGAINFOFLAGS32 const *PCVMSVGAINFOFLAGS32;
|
---|
176 | void vmsvga3dInfoU32Flags(PCDBGFINFOHLP pHlp, uint32_t fFlags, const char *pszPrefix, PCVMSVGAINFOFLAGS32 paFlags, uint32_t cFlags);
|
---|
177 |
|
---|
178 | /**
|
---|
179 | * Structure for use with vmsvgaFormatEnumValueEx and vmsvgaFormatEnumValue.
|
---|
180 | */
|
---|
181 | typedef struct VMSVGAINFOENUM
|
---|
182 | {
|
---|
183 | /** The enum value. */
|
---|
184 | int32_t iValue;
|
---|
185 | /** The corresponding value name. */
|
---|
186 | const char *pszName;
|
---|
187 | } VMSVGAINFOENUM;
|
---|
188 | /** Pointer to a read-only enum value translation entry. */
|
---|
189 | typedef VMSVGAINFOENUM const *PCVMSVGAINFOENUM;
|
---|
190 | /**
|
---|
191 | * Structure for use with vmsvgaFormatEnumValueEx and vmsvgaFormatEnumValue.
|
---|
192 | */
|
---|
193 | typedef struct VMSVGAINFOENUMMAP
|
---|
194 | {
|
---|
195 | /** Pointer to the value mapping array. */
|
---|
196 | PCVMSVGAINFOENUM paValues;
|
---|
197 | /** The number of value mappings. */
|
---|
198 | size_t cValues;
|
---|
199 | /** The prefix. */
|
---|
200 | const char *pszPrefix;
|
---|
201 | #ifdef RT_STRICT
|
---|
202 | /** Indicates whether we've checked that it's sorted or not. */
|
---|
203 | bool *pfAsserted;
|
---|
204 | #endif
|
---|
205 | } VMSVGAINFOENUMMAP;
|
---|
206 | typedef VMSVGAINFOENUMMAP const *PCVMSVGAINFOENUMMAP;
|
---|
207 | /** @def VMSVGAINFOENUMMAP_MAKE
|
---|
208 | * Macro for defining a VMSVGAINFOENUMMAP, silently dealing with pfAsserted.
|
---|
209 | *
|
---|
210 | * @param a_Scope The scope. RT_NOTHING or static.
|
---|
211 | * @param a_VarName The variable name for this map.
|
---|
212 | * @param a_aValues The variable name of the value mapping array.
|
---|
213 | * @param a_pszPrefix The value name prefix.
|
---|
214 | */
|
---|
215 | #ifdef VBOX_STRICT
|
---|
216 | # define VMSVGAINFOENUMMAP_MAKE(a_Scope, a_VarName, a_aValues, a_pszPrefix) \
|
---|
217 | static bool RT_CONCAT(a_VarName,_AssertedSorted) = false; \
|
---|
218 | a_Scope VMSVGAINFOENUMMAP const a_VarName = { \
|
---|
219 | a_aValues, RT_ELEMENTS(a_aValues), a_pszPrefix, &RT_CONCAT(a_VarName,_AssertedSorted) \
|
---|
220 | }
|
---|
221 | #else
|
---|
222 | # define VMSVGAINFOENUMMAP_MAKE(a_Scope, a_VarName, a_aValues, a_pszPrefix) \
|
---|
223 | a_Scope VMSVGAINFOENUMMAP const a_VarName = { a_aValues, RT_ELEMENTS(a_aValues), a_pszPrefix }
|
---|
224 | #endif
|
---|
225 | extern VMSVGAINFOENUMMAP const g_SVGA3dSurfaceFormat2String;
|
---|
226 | const char *vmsvgaLookupEnum(int32_t iValue, PCVMSVGAINFOENUMMAP pEnumMap);
|
---|
227 | char *vmsvgaFormatEnumValueEx(char *pszBuffer, size_t cbBuffer, const char *pszName, int32_t iValue,
|
---|
228 | bool fPrefix, PCVMSVGAINFOENUMMAP pEnumMap);
|
---|
229 | char *vmsvgaFormatEnumValue(char *pszBuffer, size_t cbBuffer, const char *pszName, uint32_t uValue,
|
---|
230 | const char *pszPrefix, const char * const *papszValues, size_t cValues);
|
---|
231 |
|
---|
232 | /**
|
---|
233 | * ASCII "art" scanline printer callback.
|
---|
234 | *
|
---|
235 | * @param pszLine The line to output.
|
---|
236 | * @param pvUser The user argument.
|
---|
237 | */
|
---|
238 | typedef DECLCALLBACKTYPE(void, FNVMSVGAASCIIPRINTLN,(const char *pszLine, void *pvUser));
|
---|
239 | /** Pointer to an ASCII "art" print line callback. */
|
---|
240 | typedef FNVMSVGAASCIIPRINTLN *PFNVMSVGAASCIIPRINTLN;
|
---|
241 | void vmsvga3dAsciiPrint(PFNVMSVGAASCIIPRINTLN pfnPrintLine, void *pvUser, void const *pvImage, size_t cbImage,
|
---|
242 | uint32_t cx, uint32_t cy, uint32_t cbScanline, SVGA3dSurfaceFormat enmFormat, bool fInvY,
|
---|
243 | uint32_t cchMaxX, uint32_t cchMaxY);
|
---|
244 | DECLCALLBACK(void) vmsvga3dAsciiPrintlnInfo(const char *pszLine, void *pvUser);
|
---|
245 | DECLCALLBACK(void) vmsvga3dAsciiPrintlnLog(const char *pszLine, void *pvUser);
|
---|
246 |
|
---|
247 | char *vmsvga3dFormatRenderState(char *pszBuffer, size_t cbBuffer, SVGA3dRenderState const *pRenderState);
|
---|
248 | char *vmsvga3dFormatTextureState(char *pszBuffer, size_t cbBuffer, SVGA3dTextureState const *pTextureState);
|
---|
249 | void vmsvga3dInfoHostWindow(PCDBGFINFOHLP pHlp, uint64_t idHostWindow);
|
---|
250 |
|
---|
251 | uint32_t vmsvga3dSurfaceFormatSize(SVGA3dSurfaceFormat format,
|
---|
252 | uint32_t *pu32BlockWidth,
|
---|
253 | uint32_t *pu32BlockHeight);
|
---|
254 |
|
---|
255 | #ifdef LOG_ENABLED
|
---|
256 | const char *vmsvga3dGetCapString(uint32_t idxCap);
|
---|
257 | const char *vmsvga3dGet3dFormatString(uint32_t format);
|
---|
258 | const char *vmsvga3dGetRenderStateName(uint32_t state);
|
---|
259 | const char *vmsvga3dTextureStateToString(SVGA3dTextureStateName textureState);
|
---|
260 | const char *vmsvgaTransformToString(SVGA3dTransformType type);
|
---|
261 | const char *vmsvgaDeclUsage2String(SVGA3dDeclUsage usage);
|
---|
262 | const char *vmsvgaDeclType2String(SVGA3dDeclType type);
|
---|
263 | const char *vmsvgaDeclMethod2String(SVGA3dDeclMethod method);
|
---|
264 | const char *vmsvgaSurfaceType2String(SVGA3dSurfaceFormat format);
|
---|
265 | const char *vmsvga3dPrimitiveType2String(SVGA3dPrimitiveType PrimitiveType);
|
---|
266 | #endif
|
---|
267 |
|
---|
268 |
|
---|
269 | #define VMSVGA3D_BACKEND_INTERFACE_NAME_GBO "GBO"
|
---|
270 | typedef struct
|
---|
271 | {
|
---|
272 | DECLCALLBACKMEMBER(int, pfnScreenTargetBind, (PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen, uint32_t sid));
|
---|
273 | DECLCALLBACKMEMBER(int, pfnScreenTargetUpdate, (PVGASTATECC pThisCC, VMSVGASCREENOBJECT *pScreen, SVGA3dRect const *pRect));
|
---|
274 | } VMSVGA3DBACKENDFUNCSGBO;
|
---|
275 |
|
---|
276 | #define VMSVGA3D_BACKEND_INTERFACE_NAME_MAP "MAP"
|
---|
277 | typedef struct
|
---|
278 | {
|
---|
279 | DECLCALLBACKMEMBER(int, pfnSurfaceMap, (PVGASTATECC pThisCC, SVGA3dSurfaceImageId const *pImage, SVGA3dBox const *pBox, VMSVGA3D_SURFACE_MAP enmMapType, VMSVGA3D_MAPPED_SURFACE *pMap));
|
---|
280 | DECLCALLBACKMEMBER(int, pfnSurfaceUnmap, (PVGASTATECC pThisCC, SVGA3dSurfaceImageId const *pImage, VMSVGA3D_MAPPED_SURFACE *pMap, bool fWritten));
|
---|
281 | } VMSVGA3DBACKENDFUNCSMAP;
|
---|
282 |
|
---|
283 | #define VMSVGA3D_BACKEND_INTERFACE_NAME_DX "DX"
|
---|
284 | typedef struct
|
---|
285 | {
|
---|
286 | DECLCALLBACKMEMBER(void, pfnDXDefineContext, (PVMSVGA3DSTATE p3dState));
|
---|
287 | DECLCALLBACKMEMBER(void, pfnDXDestroyContext, (PVMSVGA3DSTATE p3dState));
|
---|
288 | DECLCALLBACKMEMBER(void, pfnDXBindContext, (PVMSVGA3DSTATE p3dState));
|
---|
289 | DECLCALLBACKMEMBER(void, pfnDXReadbackContext, (PVMSVGA3DSTATE p3dState));
|
---|
290 | DECLCALLBACKMEMBER(void, pfnDXInvalidateContext, (PVMSVGA3DSTATE p3dState));
|
---|
291 | DECLCALLBACKMEMBER(void, pfnDXSetSingleConstantBuffer, (PVMSVGA3DSTATE p3dState));
|
---|
292 | DECLCALLBACKMEMBER(void, pfnDXSetShaderResources, (PVMSVGA3DSTATE p3dState));
|
---|
293 | DECLCALLBACKMEMBER(void, pfnDXSetShader, (PVMSVGA3DSTATE p3dState));
|
---|
294 | DECLCALLBACKMEMBER(void, pfnDXSetSamplers, (PVMSVGA3DSTATE p3dState));
|
---|
295 | DECLCALLBACKMEMBER(void, pfnDXDraw, (PVMSVGA3DSTATE p3dState));
|
---|
296 | DECLCALLBACKMEMBER(void, pfnDXDrawIndexed, (PVMSVGA3DSTATE p3dState));
|
---|
297 | DECLCALLBACKMEMBER(void, pfnDXDrawInstanced, (PVMSVGA3DSTATE p3dState));
|
---|
298 | DECLCALLBACKMEMBER(void, pfnDXDrawIndexedInstanced, (PVMSVGA3DSTATE p3dState));
|
---|
299 | DECLCALLBACKMEMBER(void, pfnDXDrawAuto, (PVMSVGA3DSTATE p3dState));
|
---|
300 | DECLCALLBACKMEMBER(void, pfnDXSetInputLayout, (PVMSVGA3DSTATE p3dState));
|
---|
301 | DECLCALLBACKMEMBER(void, pfnDXSetVertexBuffers, (PVMSVGA3DSTATE p3dState));
|
---|
302 | DECLCALLBACKMEMBER(void, pfnDXSetIndexBuffer, (PVMSVGA3DSTATE p3dState));
|
---|
303 | DECLCALLBACKMEMBER(void, pfnDXSetTopology, (PVMSVGA3DSTATE p3dState));
|
---|
304 | DECLCALLBACKMEMBER(void, pfnDXSetRenderTargets, (PVMSVGA3DSTATE p3dState));
|
---|
305 | DECLCALLBACKMEMBER(void, pfnDXSetBlendState, (PVMSVGA3DSTATE p3dState));
|
---|
306 | DECLCALLBACKMEMBER(void, pfnDXSetDepthStencilState, (PVMSVGA3DSTATE p3dState));
|
---|
307 | DECLCALLBACKMEMBER(void, pfnDXSetRasterizerState, (PVMSVGA3DSTATE p3dState));
|
---|
308 | DECLCALLBACKMEMBER(void, pfnDXDefineQuery, (PVMSVGA3DSTATE p3dState));
|
---|
309 | DECLCALLBACKMEMBER(void, pfnDXDestroyQuery, (PVMSVGA3DSTATE p3dState));
|
---|
310 | DECLCALLBACKMEMBER(void, pfnDXBindQuery, (PVMSVGA3DSTATE p3dState));
|
---|
311 | DECLCALLBACKMEMBER(void, pfnDXSetQueryOffset, (PVMSVGA3DSTATE p3dState));
|
---|
312 | DECLCALLBACKMEMBER(void, pfnDXBeginQuery, (PVMSVGA3DSTATE p3dState));
|
---|
313 | DECLCALLBACKMEMBER(void, pfnDXEndQuery, (PVMSVGA3DSTATE p3dState));
|
---|
314 | DECLCALLBACKMEMBER(void, pfnDXReadbackQuery, (PVMSVGA3DSTATE p3dState));
|
---|
315 | DECLCALLBACKMEMBER(void, pfnDXSetPredication, (PVMSVGA3DSTATE p3dState));
|
---|
316 | DECLCALLBACKMEMBER(void, pfnDXSetSOTargets, (PVMSVGA3DSTATE p3dState));
|
---|
317 | DECLCALLBACKMEMBER(void, pfnDXSetViewports, (PVMSVGA3DSTATE p3dState));
|
---|
318 | DECLCALLBACKMEMBER(void, pfnDXSetScissorRects, (PVMSVGA3DSTATE p3dState));
|
---|
319 | DECLCALLBACKMEMBER(void, pfnDXClearRenderTargetView, (PVMSVGA3DSTATE p3dState));
|
---|
320 | DECLCALLBACKMEMBER(void, pfnDXClearDepthStencilView, (PVMSVGA3DSTATE p3dState));
|
---|
321 | DECLCALLBACKMEMBER(void, pfnDXPredCopyRegion, (PVMSVGA3DSTATE p3dState));
|
---|
322 | DECLCALLBACKMEMBER(void, pfnDXPredCopy, (PVMSVGA3DSTATE p3dState));
|
---|
323 | DECLCALLBACKMEMBER(void, pfnDXStretchBlt, (PVMSVGA3DSTATE p3dState));
|
---|
324 | DECLCALLBACKMEMBER(void, pfnDXGenMips, (PVMSVGA3DSTATE p3dState));
|
---|
325 | DECLCALLBACKMEMBER(void, pfnDXUpdateSubResource, (PVMSVGA3DSTATE p3dState));
|
---|
326 | DECLCALLBACKMEMBER(void, pfnDXReadbackSubResource, (PVMSVGA3DSTATE p3dState));
|
---|
327 | DECLCALLBACKMEMBER(void, pfnDXInvalidateSubResource, (PVMSVGA3DSTATE p3dState));
|
---|
328 | DECLCALLBACKMEMBER(void, pfnDXDefineShaderResourceView, (PVMSVGA3DSTATE p3dState));
|
---|
329 | DECLCALLBACKMEMBER(void, pfnDXDestroyShaderResourceView, (PVMSVGA3DSTATE p3dState));
|
---|
330 | DECLCALLBACKMEMBER(void, pfnDXDefineRenderTargetView, (PVMSVGA3DSTATE p3dState));
|
---|
331 | DECLCALLBACKMEMBER(void, pfnDXDestroyRenderTargetView, (PVMSVGA3DSTATE p3dState));
|
---|
332 | DECLCALLBACKMEMBER(void, pfnDXDefineDepthStencilView, (PVMSVGA3DSTATE p3dState));
|
---|
333 | DECLCALLBACKMEMBER(void, pfnDXDestroyDepthStencilView, (PVMSVGA3DSTATE p3dState));
|
---|
334 | DECLCALLBACKMEMBER(void, pfnDXDefineElementLayout, (PVMSVGA3DSTATE p3dState));
|
---|
335 | DECLCALLBACKMEMBER(void, pfnDXDestroyElementLayout, (PVMSVGA3DSTATE p3dState));
|
---|
336 | DECLCALLBACKMEMBER(void, pfnDXDefineBlendState, (PVMSVGA3DSTATE p3dState));
|
---|
337 | DECLCALLBACKMEMBER(void, pfnDXDestroyBlendState, (PVMSVGA3DSTATE p3dState));
|
---|
338 | DECLCALLBACKMEMBER(void, pfnDXDefineDepthStencilState, (PVMSVGA3DSTATE p3dState));
|
---|
339 | DECLCALLBACKMEMBER(void, pfnDXDestroyDepthStencilState, (PVMSVGA3DSTATE p3dState));
|
---|
340 | DECLCALLBACKMEMBER(void, pfnDXDefineRasterizerState, (PVMSVGA3DSTATE p3dState));
|
---|
341 | DECLCALLBACKMEMBER(void, pfnDXDestroyRasterizerState, (PVMSVGA3DSTATE p3dState));
|
---|
342 | DECLCALLBACKMEMBER(void, pfnDXDefineSamplerState, (PVMSVGA3DSTATE p3dState));
|
---|
343 | DECLCALLBACKMEMBER(void, pfnDXDestroySamplerState, (PVMSVGA3DSTATE p3dState));
|
---|
344 | DECLCALLBACKMEMBER(void, pfnDXDefineShader, (PVMSVGA3DSTATE p3dState));
|
---|
345 | DECLCALLBACKMEMBER(void, pfnDXDestroyShader, (PVMSVGA3DSTATE p3dState));
|
---|
346 | DECLCALLBACKMEMBER(void, pfnDXBindShader, (PVMSVGA3DSTATE p3dState));
|
---|
347 | DECLCALLBACKMEMBER(void, pfnDXDefineStreamOutput, (PVMSVGA3DSTATE p3dState));
|
---|
348 | DECLCALLBACKMEMBER(void, pfnDXDestroyStreamOutput, (PVMSVGA3DSTATE p3dState));
|
---|
349 | DECLCALLBACKMEMBER(void, pfnDXSetStreamOutput, (PVMSVGA3DSTATE p3dState));
|
---|
350 | DECLCALLBACKMEMBER(void, pfnDXSetCOTable, (PVMSVGA3DSTATE p3dState));
|
---|
351 | DECLCALLBACKMEMBER(void, pfnDXReadbackCOTable, (PVMSVGA3DSTATE p3dState));
|
---|
352 | DECLCALLBACKMEMBER(void, pfnDXBufferCopy, (PVMSVGA3DSTATE p3dState));
|
---|
353 | DECLCALLBACKMEMBER(void, pfnDXTransferFromBuffer, (PVMSVGA3DSTATE p3dState));
|
---|
354 | DECLCALLBACKMEMBER(void, pfnDXSurfaceCopyAndReadback, (PVMSVGA3DSTATE p3dState));
|
---|
355 | DECLCALLBACKMEMBER(void, pfnDXMoveQuery, (PVMSVGA3DSTATE p3dState));
|
---|
356 | DECLCALLBACKMEMBER(void, pfnDXBindAllQuery, (PVMSVGA3DSTATE p3dState));
|
---|
357 | DECLCALLBACKMEMBER(void, pfnDXReadbackAllQuery, (PVMSVGA3DSTATE p3dState));
|
---|
358 | DECLCALLBACKMEMBER(void, pfnDXPredTransferFromBuffer, (PVMSVGA3DSTATE p3dState));
|
---|
359 | DECLCALLBACKMEMBER(void, pfnDXMobFence64, (PVMSVGA3DSTATE p3dState));
|
---|
360 | DECLCALLBACKMEMBER(void, pfnDXBindAllShader, (PVMSVGA3DSTATE p3dState));
|
---|
361 | DECLCALLBACKMEMBER(void, pfnDXHint, (PVMSVGA3DSTATE p3dState));
|
---|
362 | DECLCALLBACKMEMBER(void, pfnDXBufferUpdate, (PVMSVGA3DSTATE p3dState));
|
---|
363 | DECLCALLBACKMEMBER(void, pfnDXSetVSConstantBufferOffset, (PVMSVGA3DSTATE p3dState));
|
---|
364 | DECLCALLBACKMEMBER(void, pfnDXSetPSConstantBufferOffset, (PVMSVGA3DSTATE p3dState));
|
---|
365 | DECLCALLBACKMEMBER(void, pfnDXSetGSConstantBufferOffset, (PVMSVGA3DSTATE p3dState));
|
---|
366 | DECLCALLBACKMEMBER(void, pfnDXCondBindAllShader, (PVMSVGA3DSTATE p3dState));
|
---|
367 | } VMSVGA3DBACKENDFUNCSDX;
|
---|
368 |
|
---|
369 | int vmsvga3dQueryInterface(PVGASTATECC pThisCC, char const *pszInterfaceName, void *pvInterfaceFuncs, size_t cbInterfaceFuncs);
|
---|
370 |
|
---|
371 | #endif /* !VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA3d_h */
|
---|
372 |
|
---|