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
|
---|
30 | extern "C" {
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | typedef 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 |
|
---|
75 | struct pipe_context;
|
---|
76 | struct pipe_screen;
|
---|
77 | struct pipe_resource;
|
---|
78 |
|
---|
79 | typedef struct pipe_screen * WINAPI FNGaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
|
---|
80 | typedef FNGaDrvScreenCreate *PFNGaDrvScreenCreate;
|
---|
81 |
|
---|
82 | typedef void WINAPI FNGaDrvScreenDestroy(struct pipe_screen *s);
|
---|
83 | typedef FNGaDrvScreenDestroy *PFNGaDrvScreenDestroy;
|
---|
84 |
|
---|
85 | typedef const WDDMGalliumDriverEnv * WINAPI FNGaDrvGetWDDMEnv(struct pipe_screen *pScreen);
|
---|
86 | typedef FNGaDrvGetWDDMEnv *PFNGaDrvGetWDDMEnv;
|
---|
87 |
|
---|
88 | typedef uint32_t WINAPI FNGaDrvGetContextId(struct pipe_context *pPipeContext);
|
---|
89 | typedef FNGaDrvGetContextId *PFNGaDrvGetContextId;
|
---|
90 |
|
---|
91 | typedef uint32_t WINAPI FNGaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource);
|
---|
92 | typedef FNGaDrvGetSurfaceId *PFNGaDrvGetSurfaceId;
|
---|
93 |
|
---|
94 | typedef void WINAPI FNGaDrvContextFlush(struct pipe_context *pPipeContext);
|
---|
95 | typedef FNGaDrvContextFlush *PFNGaDrvContextFlush;
|
---|
96 |
|
---|
97 | #ifdef __cplusplus
|
---|
98 | }
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | #endif /* !GA_INCLUDED_3D_WIN_VBoxGaDriver_h */
|
---|
102 |
|
---|