VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/win/include/VBoxGaDriver.h@ 85121

Last change on this file since 85121 was 85121, checked in by vboxsync, 5 years ago

iprt/cdefs.h: Refactored the typedef use of DECLCALLBACK as well as DECLCALLBACKMEMBER to wrap the whole expression, similar to the DECLR?CALLBACKMEMBER macros. This allows adding a throw() at the end when compiling with the VC++ compiler to indicate that the callbacks won't throw anything, so we can stop supressing the C5039 warning about passing functions that can potential throw C++ exceptions to extern C code that can't necessarily cope with such (unwind,++). Introduced a few _EX variations that allows specifying different/no calling convention too, as that's handy when dynamically resolving host APIs. Fixed numerous places missing DECLCALLBACK and such. Left two angry @todos regarding use of CreateThread. bugref:9794

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/* $Id: VBoxGaDriver.h 85121 2020-07-08 19:33:26Z vboxsync $ */
2/** @file
3 * VirtualBox Windows Guest Mesa3D - Gallium driver interface.
4 */
5
6/*
7 * Copyright (C) 2016-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 GA_INCLUDED_3D_WIN_VBoxGaDriver_h
19#define GA_INCLUDED_3D_WIN_VBoxGaDriver_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBoxGaHWInfo.h>
25#include <VBoxGaTypes.h>
26
27#include <iprt/win/windows.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33typedef struct WDDMGalliumDriverEnv
34{
35 /* Size of the structure. */
36 DWORD cb;
37 const VBOXGAHWINFO *pHWInfo;
38 /* The environment context pointer to use in the following callbacks. */
39 void *pvEnv;
40 /* The callbacks to use by the driver. */
41 DECLCALLBACKMEMBER(uint32_t, pfnContextCreate,(void *pvEnv,
42 boolean extended,
43 boolean vgpu10));
44 DECLCALLBACKMEMBER(void, pfnContextDestroy,(void *pvEnv,
45 uint32_t u32Cid));
46 DECLCALLBACKMEMBER(int, pfnSurfaceDefine,(void *pvEnv,
47 GASURFCREATE *pCreateParms,
48 GASURFSIZE *paSizes,
49 uint32_t cSizes,
50 uint32_t *pu32Sid));
51 DECLCALLBACKMEMBER(void, pfnSurfaceDestroy,(void *pvEnv,
52 uint32_t u32Sid));
53 DECLCALLBACKMEMBER(int, pfnRender,(void *pvEnv,
54 uint32_t u32Cid,
55 void *pvCommands,
56 uint32_t cbCommands,
57 GAFENCEQUERY *pFenceQuery));
58 DECLCALLBACKMEMBER(void, pfnFenceUnref,(void *pvEnv,
59 uint32_t u32FenceHandle));
60 DECLCALLBACKMEMBER(int, pfnFenceQuery,(void *pvEnv,
61 uint32_t u32FenceHandle,
62 GAFENCEQUERY *pFenceQuery));
63 DECLCALLBACKMEMBER(int, pfnFenceWait,(void *pvEnv,
64 uint32_t u32FenceHandle,
65 uint32_t u32TimeoutUS));
66 DECLCALLBACKMEMBER(int, pfnRegionCreate,(void *pvEnv,
67 uint32_t u32RegionSize,
68 uint32_t *pu32GmrId,
69 void **ppvMap));
70 DECLCALLBACKMEMBER(void, pfnRegionDestroy,(void *pvEnv,
71 uint32_t u32GmrId,
72 void *pvMap));
73} WDDMGalliumDriverEnv;
74
75struct pipe_context;
76struct pipe_screen;
77struct pipe_resource;
78
79typedef struct pipe_screen * WINAPI FNGaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
80typedef FNGaDrvScreenCreate *PFNGaDrvScreenCreate;
81
82typedef void WINAPI FNGaDrvScreenDestroy(struct pipe_screen *s);
83typedef FNGaDrvScreenDestroy *PFNGaDrvScreenDestroy;
84
85typedef const WDDMGalliumDriverEnv * WINAPI FNGaDrvGetWDDMEnv(struct pipe_screen *pScreen);
86typedef FNGaDrvGetWDDMEnv *PFNGaDrvGetWDDMEnv;
87
88typedef uint32_t WINAPI FNGaDrvGetContextId(struct pipe_context *pPipeContext);
89typedef FNGaDrvGetContextId *PFNGaDrvGetContextId;
90
91typedef uint32_t WINAPI FNGaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource);
92typedef FNGaDrvGetSurfaceId *PFNGaDrvGetSurfaceId;
93
94typedef void WINAPI FNGaDrvContextFlush(struct pipe_context *pPipeContext);
95typedef FNGaDrvContextFlush *PFNGaDrvContextFlush;
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* !GA_INCLUDED_3D_WIN_VBoxGaDriver_h */
102
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette