VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_spu.h@ 78190

最後變更 在這個檔案從78190是 78190,由 vboxsync 提交於 6 年 前

Merge first stage of the Chromium cleanup from the branch:

  • r129818 (Remove VBOX_WITH_CR_DISPLAY_LISTS and accompanying code as it was disabled since r108676 and was never brought back (see ​bugref:3456 and ​bugref:8485))
  • r129819 (HostServices/SharedOpenGL: Remove unused main entry point from upstream server process based implementation)
  • r129820 (HostServices/SharedOpenGL: Started eliminating all backends other than HGCM. They are not used and probably wouldn't work anymore anyway)
  • r129821 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crTimer* API as it is not used anywhere)
  • r129822 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill most from cr_process.h apart from two used methods)
  • r129823 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crList* API as it is unused)
  • r129824 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crHullInteriorBox API as it is unused)
  • r129825 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crWarpPoint API as it is unused)
  • r129826 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill CrSa* API as it is unused and not even compiled in)
  • r129827 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill cr_bbox.h as it is unused)
  • r129828 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove a few crParseUrl() two uses)
  • r129829 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove last crParseURL() use)
  • r129830 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove crParseURL())
  • r129831 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove VBOX_WITH_COCOA_QT and related code when not set as it is the default for years now and we don't support anything else anymore)
  • r129832 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_logo.h)
  • r129833 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused crut_api.h and crut_clientapi.h)
  • r129834 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_dmx.h)
  • r129835 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_perf.h)
  • r129836 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove cr_rand.h and friends as it is not actively used anywhere)
  • r129837 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of all the swapped versions in the packer SPU, we never change endianess from guest to host and don't need it)
  • r129838 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129839 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129840 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused pack_pica.c)
  • r129841 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129842 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_endianess.h and friends)
  • r129843 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused lowercase.py)
  • r129844 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_calllists.h and friends)
  • r129845 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of completely unused idpool.c, not even compiled in)
  • r129846 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_debugopcodes.h and friends)
  • r129847 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the cr_mem.h API inline and get rid of the implementation in the util library)
  • r129848 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of SPUOptions and related code as it is of no use for us)
  • r129849 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_environment.h and friends and convert usage to RTEnv* APIs)
  • r129850 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused renderspu_agl.c)
  • r129851 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused code in cr_htable.h)
  • r129853 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Introduce a state paremeter for the unpacker workers instead of reyling on global variables, work in progress)
  • r129854 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Let the caller of crUnpack set up the initial state. This allows to get rid of the global return_ptr and writeback_ptr as they get supplied in the unpacker state by the server)
  • r129855 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the cr_lastDispatch and cr_unpackDispatch as they are of no use now)
  • r129856 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the global cr_unpackData and cr_unpackDataEnd symbols by indtroducing another hack to make it possible for certail server dispatch callbacks to access the data buffer)
  • r129857 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: build fix for release builds)
  • r129858 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the pointer to the unpacker state non const (is required for the access verification))
  • r129859 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: First iteration of the buffer size validation to prevent out of bound read access + added todos for places where additional checks are needed)
  • r129860 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129861 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129871 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129872 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Stop as soon as the unpacker encountered an error)
  • r129876 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129880 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129882 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Fixed some offsets in unpack_texture.c, 3DMark03 renders correctly again)
  • r130013 (HostServices/SharedOpenGL: Convert files to C++ so we can use C99 featuers on Windows with cl.exe)
  • r130014 (HostServices/SharedOpenGL,GuestHost/OpenGL: WIndows build fixes)
  • r130015 (HostServices/SharedOpenGL,GuestHost/OpenGL: More Windows build fixes)
  • r130036 (Config.kmk: Fix linker error on Windows by temporarily disabling the use of VBoxGuestR3DllMinW2K)
  • r130094 (src/VBox/GuestHost/OpenGL: Revert inlining the allocation/free functions in R3 completely as it doesn't work on Windows if memory is allocated and freed across different DLLs which don't share a common CRT, causes crashes in RtlValidtaeHeap())
  • r130095 (src/VBox/GuestHost/OpenGL,src/VBox/Additions/common/crOpenGL/pack: Don't use floating point specifiers in packspu_GetString() to avoid R6002 errors (couldn't fully understand why they occur suddenly after the rework but this gets rid of it))
  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 17.0 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6#ifndef CR_SPU_H
7#define CR_SPU_H
8
9#ifdef WINDOWS
10#define SPULOAD_APIENTRY __stdcall
11#else
12#define SPULOAD_APIENTRY
13#endif
14
15#include "cr_dll.h"
16#include "spu_dispatch_table.h"
17#include "cr_net.h"
18
19#include <iprt/types.h>
20
21#ifdef DARWIN
22# include <OpenGL/OpenGL.h>
23#endif
24
25#define SPU_ENTRY_POINT_NAME "SPULoad"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define MAX_THREADS 32 /**< max threads per spu */
32
33typedef struct _SPUSTRUCT SPU;
34
35typedef void (*SPUGenericFunction)(void);
36
37/**
38 * SPU Named function descriptor
39 */
40typedef struct {
41 char *name;
42 SPUGenericFunction fn;
43} SPUNamedFunctionTable;
44
45/**
46 * SPU function table descriptor
47 */
48typedef struct {
49 SPUDispatchTable *childCopy;
50 void *data;
51 SPUNamedFunctionTable *table;
52} SPUFunctions;
53
54/** Init spu */
55typedef SPUFunctions *(*SPUInitFuncPtr)(int id, SPU *child,
56 SPU *super, unsigned int, unsigned int );
57typedef void (*SPUSelfDispatchFuncPtr)(SPUDispatchTable *);
58/** Cleanup spu */
59typedef int (*SPUCleanupFuncPtr)(void);
60/** Load spu */
61typedef int (*SPULoadFunction)(char **, char **, void *, void *, void *, int *);
62
63
64/**
65 * masks for spu_flags
66 */
67#define SPU_PACKER_MASK 0x1
68#define SPU_NO_PACKER 0x0
69#define SPU_HAS_PACKER 0x1
70#define SPU_TERMINAL_MASK 0x2
71#define SPU_NOT_TERMINAL 0x0
72#define SPU_IS_TERMINAL 0x2
73#define SPU_MAX_SERVERS_MASK 0xc
74#define SPU_MAX_SERVERS_ZERO 0x0
75#define SPU_MAX_SERVERS_ONE 0x4
76#define SPU_MAX_SERVERS_UNLIMITED 0x8
77
78
79/**
80 * SPU descriptor
81 */
82struct _SPUSTRUCT {
83 char *name; /**< Name of the spu */
84 char *super_name; /**< Name of the super class of the spu */
85 int id; /**< Id num of the spu */
86 int spu_flags; /**< options fags for the SPU */
87 struct _SPUSTRUCT *superSPU; /**< Pointer to the descriptor for the super class */
88 CRDLL *dll; /**< pointer to shared lib for spu */
89 SPULoadFunction entry_point; /**< SPU's entry point (SPULoad()) */
90 SPUInitFuncPtr init; /**< SPU init function */
91 SPUSelfDispatchFuncPtr self; /**< */
92 SPUCleanupFuncPtr cleanup; /**< SPU cleanup func */
93 SPUFunctions *function_table; /**< Function table for spu */
94 SPUDispatchTable dispatch_table;
95 void *privatePtr; /**< pointer to SPU-private data */
96};
97
98
99/**
100 * These are the OpenGL / window system interface functions
101 */
102#if defined(WINDOWS)
103/**
104 * Windows/WGL
105 */
106/*@{*/
107typedef HGLRC (WGL_APIENTRY *wglCreateContextFunc_t)(HDC);
108typedef void (WGL_APIENTRY *wglDeleteContextFunc_t)(HGLRC);
109typedef BOOL (WGL_APIENTRY *wglShareListsFunc_t)(HGLRC,HGLRC);
110typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
111typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
112typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
113typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
114typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
115typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
116typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)();
117typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)();
118typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
119typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
120typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, float *);
121typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
122typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)();
123typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringARBFunc_t)(HDC);
124/*@}*/
125#elif defined(DARWIN)
126typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
127/*@}*/
128
129/**
130 * Apple/CGL
131 */
132/*@{*/
133typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
134typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
135
136typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
137typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
138typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
139
140typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
141typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
142typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
143
144typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
145typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
146typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
147
148typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
149typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
150typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
151typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
152
153typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
154typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
155typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
156
157typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
158typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
159
160typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
161typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
162
163typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
164typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
165typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
166
167typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
168typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
169
170typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
171typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
172
173typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
174typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
175typedef void (*CGLGetVersionFunc_t)( long *, long * );
176
177typedef const char * (*CGLErrorStringFunc_t)( CGLError );
178
179/** XXX \todo Undocumented CGL functions. Are these all correct? */
180typedef void *CGSConnectionID;
181typedef int CGSWindowID;
182typedef int CGSSurfaceID;
183
184typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
185typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
186typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
187/*@}*/
188#else
189/**
190 * X11/GLX
191 */
192/*@{*/
193typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
194typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
195typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
196typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
197typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
198typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
199typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
200typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
201typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
202typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
203typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
204typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
205typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
206typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
207typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
208typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
209typedef void (*glXWaitGLFunc_t)(void);
210typedef void (*glXWaitXFunc_t)(void);
211typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
212typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
213typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
214typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
215typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
216typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
217typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
218typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
219#ifdef GLX_VERSION_1_3
220typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
221typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
222typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
223typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
224typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
225typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
226typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
227typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
228typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
229typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
230typedef void (*glXQueryDrawableFunc_t)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
231#endif /* GLX_VERSION_1_3 */
232/*@}*/
233#endif
234
235
236/**
237 * Package up the WGL/AGL/CGL/GLX function pointers into a struct. We use
238 * this in a few different places.
239 */
240typedef struct {
241#if defined(WINDOWS)
242 wglGetProcAddressFunc_t wglGetProcAddress;
243 wglCreateContextFunc_t wglCreateContext;
244 wglDeleteContextFunc_t wglDeleteContext;
245 wglShareListsFunc_t wglShareLists;
246 wglMakeCurrentFunc_t wglMakeCurrent;
247 wglSwapBuffersFunc_t wglSwapBuffers;
248 wglGetCurrentContextFunc_t wglGetCurrentContext;
249 wglChoosePixelFormatFunc_t wglChoosePixelFormat;
250 wglDescribePixelFormatFunc_t wglDescribePixelFormat;
251 wglSetPixelFormatFunc_t wglSetPixelFormat;
252 wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT;
253 wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT;
254 wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT;
255 wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT;
256#elif defined(DARWIN)
257 CGLChoosePixelFormatFunc_t CGLChoosePixelFormat;
258 CGLDestroyPixelFormatFunc_t CGLDestroyPixelFormat;
259 CGLDescribePixelFormatFunc_t CGLDescribePixelFormat;
260 CGLQueryRendererInfoFunc_t CGLQueryRendererInfo;
261 CGLDestroyRendererInfoFunc_t CGLDestroyRendererInfo;
262 CGLDescribeRendererFunc_t CGLDescribeRenderer;
263 CGLCreateContextFunc_t CGLCreateContext;
264 CGLDestroyContextFunc_t CGLDestroyContext;
265 CGLCopyContextFunc_t CGLCopyContext;
266 CGLSetCurrentContextFunc_t CGLSetCurrentContext;
267 CGLGetCurrentContextFunc_t CGLGetCurrentContext;
268 CGLCreatePBufferFunc_t CGLCreatePBuffer;
269 CGLDestroyPBufferFunc_t CGLDestroyPBuffer;
270 CGLDescribePBufferFunc_t CGLDescribePBuffer;
271 CGLTexImagePBufferFunc_t CGLTexImagePBuffer;
272 CGLSetOffScreenFunc_t CGLSetOffScreen;
273 CGLGetOffScreenFunc_t CGLGetOffScreen;
274 CGLSetFullScreenFunc_t CGLSetFullScreen;
275 CGLSetPBufferFunc_t CGLSetPBuffer;
276 CGLGetPBufferFunc_t CGLGetPBuffer;
277 CGLClearDrawableFunc_t CGLClearDrawable;
278 CGLFlushDrawableFunc_t CGLFlushDrawable;
279 CGLEnableFunc_t CGLEnable;
280 CGLDisableFunc_t CGLDisable;
281 CGLIsEnabledFunc_t CGLIsEnabled;
282 CGLSetParameterFunc_t CGLSetParameter;
283 CGLGetParameterFunc_t CGLGetParameter;
284 CGLSetVirtualScreenFunc_t CGLSetVirtualScreen;
285 CGLGetVirtualScreenFunc_t CGLGetVirtualScreen;
286 CGLSetOptionFunc_t CGLSetOption;
287 CGLGetOptionFunc_t CGLGetOption;
288 CGLGetVersionFunc_t CGLGetVersion;
289 CGLErrorStringFunc_t CGLErrorString;
290
291 CGLSetSurfaceFunc_t CGLSetSurface;
292 CGLGetSurfaceFunc_t CGLGetSurface;
293 CGLUpdateContextFunc_t CGLUpdateContext;
294#else
295 glXGetConfigFunc_t glXGetConfig;
296 glXQueryExtensionFunc_t glXQueryExtension;
297 glXQueryVersionFunc_t glXQueryVersion;
298 glXQueryExtensionsStringFunc_t glXQueryExtensionsString;
299 glXChooseVisualFunc_t glXChooseVisual;
300 glXCreateContextFunc_t glXCreateContext;
301 glXDestroyContextFunc_t glXDestroyContext;
302 glXUseXFontFunc_t glXUseXFont;
303 glXIsDirectFunc_t glXIsDirect;
304 glXMakeCurrentFunc_t glXMakeCurrent;
305 glXSwapBuffersFunc_t glXSwapBuffers;
306 glXGetProcAddressARBFunc_t glXGetProcAddressARB;
307 glXGetCurrentDisplayFunc_t glXGetCurrentDisplay;
308 glXGetCurrentContextFunc_t glXGetCurrentContext;
309 glXGetCurrentDrawableFunc_t glXGetCurrentDrawable;
310 glXGetClientStringFunc_t glXGetClientString;
311 glXWaitGLFunc_t glXWaitGL;
312 glXWaitXFunc_t glXWaitX;
313 glXCopyContextFunc_t glXCopyContext;
314 /* GLX_NV_swap_group */
315 glXJoinSwapGroupNVFunc_t glXJoinSwapGroupNV;
316 glXBindSwapBarrierNVFunc_t glXBindSwapBarrierNV;
317 glXQuerySwapGroupNVFunc_t glXQuerySwapGroupNV;
318 glXQueryMaxSwapGroupsNVFunc_t glXQueryMaxSwapGroupsNV;
319 glXQueryFrameCountNVFunc_t glXQueryFrameCountNV;
320 glXResetFrameCountNVFunc_t glXResetFrameCountNV;
321#ifdef GLX_VERSION_1_3
322 glXCreateNewContextFunc_t glXCreateNewContext;
323 glXCreateWindowFunc_t glXCreateWindow;
324 glXMakeContextCurrentFunc_t glXMakeContextCurrent;
325 glXChooseFBConfigFunc_t glXChooseFBConfig;
326 glXGetFBConfigsFunc_t glXGetFBConfigs;
327 glXGetFBConfigAttribFunc_t glXGetFBConfigAttrib;
328 glXGetVisualFromFBConfigFunc_t glXGetVisualFromFBConfig;
329 glXCreatePbufferFunc_t glXCreatePbuffer;
330 glXDestroyPbufferFunc_t glXDestroyPbuffer;
331 glXQueryContextFunc_t glXQueryContext;
332 glXQueryDrawableFunc_t glXQueryDrawable;
333#endif
334#endif
335 glGetStringFunc_t glGetString;
336} crOpenGLInterface;
337
338
339/** This is the one required function in _all_ SPUs */
340DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
341 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
342 int *flags );
343
344DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
345DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
346DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
347
348DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
349DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
350DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
351
352
353DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
354DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
355DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
356
357DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
358DECLEXPORT(void) crUnloadOpenGL( void );
359DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
360DECLEXPORT(void) crSPUChangeDispatch(SPUDispatchTable *dispatch, const SPUNamedFunctionTable *newtable);
361
362#if defined(GLX)
363DECLEXPORT(XVisualInfo *)
364crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
365 GLboolean directColor, int visBits);
366#else
367DECLEXPORT(int)
368crChooseVisual(const crOpenGLInterface *ws, int visBits);
369#endif
370
371
372#ifdef USE_OSMESA
373DECLEXPORT(int)
374crLoadOSMesa( OSMesaContext (**createContext)( GLenum format, OSMesaContext sharelist ),
375 GLboolean (**makeCurrent)( OSMesaContext ctx, GLubyte *buffer,
376 GLenum type, GLsizei width, GLsizei height ),
377 void (**destroyContext)( OSMesaContext ctx ));
378#endif
379
380#ifdef __cplusplus
381}
382#endif
383
384#endif /* CR_SPU_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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