VirtualBox

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

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

crOpenGL: fix stack corruption leading to crash when running call of duty

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 21.1 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#include <AGL/agl.h>
24#endif
25
26#define SPU_ENTRY_POINT_NAME "SPULoad"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define MAX_THREADS 32 /**< max threads per spu */
33
34typedef struct _SPUSTRUCT SPU;
35
36typedef void (*SPUGenericFunction)(void);
37
38/**
39 * SPU Named function descriptor
40 */
41typedef struct {
42 char *name;
43 SPUGenericFunction fn;
44} SPUNamedFunctionTable;
45
46/**
47 * SPU function table descriptor
48 */
49typedef struct {
50 SPUDispatchTable *childCopy;
51 void *data;
52 SPUNamedFunctionTable *table;
53} SPUFunctions;
54
55/**
56 * SPU Option callback
57 * \param spu
58 * \param response
59 */
60typedef void (*SPUOptionCB)( void *spu, const char *response );
61
62typedef enum { CR_BOOL, CR_INT, CR_FLOAT, CR_STRING, CR_ENUM } cr_type;
63
64/**
65 * SPU Options table
66 */
67typedef struct {
68 const char *option; /**< Name of the option */
69 cr_type type; /**< Type of option */
70 int numValues; /**< usually 1 */
71 const char *deflt; /**< comma-separated string of [numValues] defaults */
72 const char *min; /**< comma-separated string of [numValues] minimums */
73 const char *max; /**< comma-separated string of [numValues] maximums */
74 const char *description; /**< Textual description of the option */
75 SPUOptionCB cb; /**< Callback function */
76} SPUOptions, *SPUOptionsPtr;
77
78
79/** Init spu */
80typedef SPUFunctions *(*SPUInitFuncPtr)(int id, SPU *child,
81 SPU *super, unsigned int, unsigned int );
82typedef void (*SPUSelfDispatchFuncPtr)(SPUDispatchTable *);
83/** Cleanup spu */
84typedef int (*SPUCleanupFuncPtr)(void);
85/** Load spu */
86typedef int (*SPULoadFunction)(char **, char **, void *, void *, void *,
87 SPUOptionsPtr *, int *);
88
89
90/**
91 * masks for spu_flags
92 */
93#define SPU_PACKER_MASK 0x1
94#define SPU_NO_PACKER 0x0
95#define SPU_HAS_PACKER 0x1
96#define SPU_TERMINAL_MASK 0x2
97#define SPU_NOT_TERMINAL 0x0
98#define SPU_IS_TERMINAL 0x2
99#define SPU_MAX_SERVERS_MASK 0xc
100#define SPU_MAX_SERVERS_ZERO 0x0
101#define SPU_MAX_SERVERS_ONE 0x4
102#define SPU_MAX_SERVERS_UNLIMITED 0x8
103
104
105/**
106 * SPU descriptor
107 */
108struct _SPUSTRUCT {
109 char *name; /**< Name of the spu */
110 char *super_name; /**< Name of the super class of the spu */
111 int id; /**< Id num of the spu */
112 int spu_flags; /**< options fags for the SPU */
113 struct _SPUSTRUCT *superSPU; /**< Pointer to the descriptor for the super class */
114 CRDLL *dll; /**< pointer to shared lib for spu */
115 SPULoadFunction entry_point; /**< SPU's entry point (SPULoad()) */
116 SPUInitFuncPtr init; /**< SPU init function */
117 SPUSelfDispatchFuncPtr self; /**< */
118 SPUCleanupFuncPtr cleanup; /**< SPU cleanup func */
119 SPUFunctions *function_table; /**< Function table for spu */
120 SPUOptions *options; /**< Options table */
121 SPUDispatchTable dispatch_table;
122 void *privatePtr; /**< pointer to SPU-private data */
123};
124
125
126/**
127 * These are the OpenGL / window system interface functions
128 */
129#if defined(WINDOWS)
130/**
131 * Windows/WGL
132 */
133/*@{*/
134typedef HGLRC (WGL_APIENTRY *wglCreateContextFunc_t)(HDC);
135typedef void (WGL_APIENTRY *wglDeleteContextFunc_t)(HGLRC);
136typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
137typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
138typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
139typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
140typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
141typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
142typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)();
143typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)();
144typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
145typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
146typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, float *);
147typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
148typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)();
149typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringARBFunc_t)(HDC);
150/*@}*/
151#elif defined(DARWIN)
152/**
153 * Apple/AGL
154 */
155/*@{*/
156typedef AGLContext (*aglCreateContextFunc_t)( AGLPixelFormat, AGLContext );
157typedef GLboolean (*aglDestroyContextFunc_t)( AGLContext );
158typedef GLboolean (*aglSetCurrentContextFunc_t)( AGLContext );
159typedef void (*aglSwapBuffersFunc_t)( AGLContext );
160typedef AGLPixelFormat (*aglChoosePixelFormatFunc_t) (const AGLDevice *, GLint, const GLint *);
161typedef GLboolean (*aglDescribePixelFormatFunc_t)( AGLPixelFormat, GLint, GLint * );
162/* <--set pixel format */
163typedef AGLContext (*aglGetCurrentContextFunc_t)();
164/* <--get proc address -- none exists */
165typedef void* (*aglGetProcAddressFunc_t)( const GLubyte *name );
166
167/* These are here just in case */
168typedef GLboolean (*aglDescribeRendererFunc_t)( AGLRendererInfo, GLint, GLint * );
169typedef void (*aglDestroyPixelFormatFunc_t)( AGLPixelFormat );
170typedef void (*aglDestroyRendererInfoFunc_t)( AGLRendererInfo );
171typedef AGLDevice* (*aglDevicesOfPixelFormatFunc_t)( AGLPixelFormat, GLint );
172typedef GLboolean (*aglDisableFunc_t)( AGLContext, GLenum );
173typedef GLboolean (*aglEnableFunc_t)( AGLContext, GLenum );
174typedef const GLubyte* (*aglErrorStringFunc_t)( GLenum );
175typedef AGLDrawable (*aglGetDrawableFunc_t)( AGLContext );
176typedef GLenum (*aglGetErrorFunc_t)();
177typedef GLboolean (*aglGetIntegerFunc_t)( AGLContext, GLenum, GLint* );
178typedef void (*aglGetVersionFunc_t)( GLint *, GLint * );
179typedef GLint (*aglGetVirtualScreenFunc_t)( AGLContext );
180typedef GLboolean (*aglIsEnabledFunc_t)( AGLContext, GLenum );
181typedef AGLPixelFormat (*aglNextPixelFormatFunc_t)( AGLPixelFormat );
182typedef AGLRendererInfo (*aglNextRendererInfoFunc_t)( AGLRendererInfo );
183typedef AGLRendererInfo (*aglQueryRendererInfoFunc_t)( const AGLDevice *, GLint );
184typedef void (*aglReserLibraryFunc_t)();
185typedef GLboolean (*aglSetDrawableFunc_t)( AGLContext, AGLDrawable );
186typedef GLboolean (*aglSetFullScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, GLint );
187typedef GLboolean (*aglSetIntegerFunc_t)( AGLContext, GLenum, const GLint * );
188typedef GLboolean (*aglSetOffScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, void * );
189typedef GLboolean (*aglSetVirtualScreenFunc_t)( AGLContext, GLint );
190typedef GLboolean (*aglUpdateContextFunc_t)( AGLContext );
191typedef GLboolean (*aglUseFontFunc_t)( AGLContext, GLint, Style, GLint, GLint, GLint, GLint );
192
193typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
194/*@}*/
195
196/**
197 * Apple/CGL
198 */
199/*@{*/
200typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
201typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
202
203typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
204typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
205typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
206
207typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
208typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
209typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
210
211typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
212typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
213typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
214
215typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
216typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
217typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
218typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
219
220typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
221typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
222typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
223
224typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
225typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
226
227typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
228typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
229
230typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
231typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
232typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
233
234typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
235typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
236
237typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
238typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
239
240typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
241typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
242typedef void (*CGLGetVersionFunc_t)( long *, long * );
243
244typedef const char * (*CGLErrorStringFunc_t)( CGLError );
245
246/** XXX \todo Undocumented CGL functions. Are these all correct? */
247typedef void *CGSConnectionID;
248typedef int CGSWindowID;
249typedef int CGSSurfaceID;
250
251typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
252typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
253typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
254/*@}*/
255#else
256/**
257 * X11/GLX
258 */
259/*@{*/
260typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
261typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
262typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
263typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
264typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
265typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
266typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
267typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
268typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
269typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
270typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
271typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
272typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
273typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
274typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
275typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
276typedef void (*glXWaitGLFunc_t)(void);
277typedef void (*glXWaitXFunc_t)(void);
278typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
279typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
280typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
281typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
282typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
283typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
284typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
285typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
286#ifdef GLX_VERSION_1_3
287typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
288typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
289typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
290typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
291typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
292typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
293typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
294typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
295typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
296typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
297typedef void (*glXQueryDrawableFunc_t)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
298#endif /* GLX_VERSION_1_3 */
299/*@}*/
300#endif
301
302
303/**
304 * Package up the WGL/AGL/CGL/GLX function pointers into a struct. We use
305 * this in a few different places.
306 */
307typedef struct {
308#if defined(WINDOWS)
309 wglGetProcAddressFunc_t wglGetProcAddress;
310 wglCreateContextFunc_t wglCreateContext;
311 wglDeleteContextFunc_t wglDeleteContext;
312 wglMakeCurrentFunc_t wglMakeCurrent;
313 wglSwapBuffersFunc_t wglSwapBuffers;
314 wglGetCurrentContextFunc_t wglGetCurrentContext;
315 wglChoosePixelFormatFunc_t wglChoosePixelFormat;
316 wglDescribePixelFormatFunc_t wglDescribePixelFormat;
317 wglSetPixelFormatFunc_t wglSetPixelFormat;
318 wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT;
319 wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT;
320 wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT;
321 wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT;
322#elif defined(DARWIN)
323 aglCreateContextFunc_t aglCreateContext;
324 aglDestroyContextFunc_t aglDestroyContext;
325 aglSetCurrentContextFunc_t aglSetCurrentContext;
326 aglSwapBuffersFunc_t aglSwapBuffers;
327 aglChoosePixelFormatFunc_t aglChoosePixelFormat;
328 aglDestroyPixelFormatFunc_t aglDestroyPixelFormat;
329 aglDescribePixelFormatFunc_t aglDescribePixelFormat;
330 aglGetCurrentContextFunc_t aglGetCurrentContext;
331 aglSetDrawableFunc_t aglSetDrawable;
332 aglGetDrawableFunc_t aglGetDrawable;
333 aglSetFullScreenFunc_t aglSetFullScreen;
334 aglGetProcAddressFunc_t aglGetProcAddress;
335 aglUpdateContextFunc_t aglUpdateContext;
336 aglUseFontFunc_t aglUseFont;
337 aglSetIntegerFunc_t aglSetInteger;
338 aglGetErrorFunc_t aglGetError;
339 aglGetIntegerFunc_t aglGetInteger;
340 aglEnableFunc_t aglEnable;
341 aglDisableFunc_t aglDisable;
342
343 CGLChoosePixelFormatFunc_t CGLChoosePixelFormat;
344 CGLDestroyPixelFormatFunc_t CGLDestroyPixelFormat;
345 CGLDescribePixelFormatFunc_t CGLDescribePixelFormat;
346 CGLQueryRendererInfoFunc_t CGLQueryRendererInfo;
347 CGLDestroyRendererInfoFunc_t CGLDestroyRendererInfo;
348 CGLDescribeRendererFunc_t CGLDescribeRenderer;
349 CGLCreateContextFunc_t CGLCreateContext;
350 CGLDestroyContextFunc_t CGLDestroyContext;
351 CGLCopyContextFunc_t CGLCopyContext;
352 CGLSetCurrentContextFunc_t CGLSetCurrentContext;
353 CGLGetCurrentContextFunc_t CGLGetCurrentContext;
354 CGLCreatePBufferFunc_t CGLCreatePBuffer;
355 CGLDestroyPBufferFunc_t CGLDestroyPBuffer;
356 CGLDescribePBufferFunc_t CGLDescribePBuffer;
357 CGLTexImagePBufferFunc_t CGLTexImagePBuffer;
358 CGLSetOffScreenFunc_t CGLSetOffScreen;
359 CGLGetOffScreenFunc_t CGLGetOffScreen;
360 CGLSetFullScreenFunc_t CGLSetFullScreen;
361 CGLSetPBufferFunc_t CGLSetPBuffer;
362 CGLGetPBufferFunc_t CGLGetPBuffer;
363 CGLClearDrawableFunc_t CGLClearDrawable;
364 CGLFlushDrawableFunc_t CGLFlushDrawable;
365 CGLEnableFunc_t CGLEnable;
366 CGLDisableFunc_t CGLDisable;
367 CGLIsEnabledFunc_t CGLIsEnabled;
368 CGLSetParameterFunc_t CGLSetParameter;
369 CGLGetParameterFunc_t CGLGetParameter;
370 CGLSetVirtualScreenFunc_t CGLSetVirtualScreen;
371 CGLGetVirtualScreenFunc_t CGLGetVirtualScreen;
372 CGLSetOptionFunc_t CGLSetOption;
373 CGLGetOptionFunc_t CGLGetOption;
374 CGLGetVersionFunc_t CGLGetVersion;
375 CGLErrorStringFunc_t CGLErrorString;
376
377 CGLSetSurfaceFunc_t CGLSetSurface;
378 CGLGetSurfaceFunc_t CGLGetSurface;
379 CGLUpdateContextFunc_t CGLUpdateContext;
380#else
381 glXGetConfigFunc_t glXGetConfig;
382 glXQueryExtensionFunc_t glXQueryExtension;
383 glXQueryVersionFunc_t glXQueryVersion;
384 glXQueryExtensionsStringFunc_t glXQueryExtensionsString;
385 glXChooseVisualFunc_t glXChooseVisual;
386 glXCreateContextFunc_t glXCreateContext;
387 glXDestroyContextFunc_t glXDestroyContext;
388 glXUseXFontFunc_t glXUseXFont;
389 glXIsDirectFunc_t glXIsDirect;
390 glXMakeCurrentFunc_t glXMakeCurrent;
391 glXSwapBuffersFunc_t glXSwapBuffers;
392 glXGetProcAddressARBFunc_t glXGetProcAddressARB;
393 glXGetCurrentDisplayFunc_t glXGetCurrentDisplay;
394 glXGetCurrentContextFunc_t glXGetCurrentContext;
395 glXGetCurrentDrawableFunc_t glXGetCurrentDrawable;
396 glXGetClientStringFunc_t glXGetClientString;
397 glXWaitGLFunc_t glXWaitGL;
398 glXWaitXFunc_t glXWaitX;
399 glXCopyContextFunc_t glXCopyContext;
400 /* GLX_NV_swap_group */
401 glXJoinSwapGroupNVFunc_t glXJoinSwapGroupNV;
402 glXBindSwapBarrierNVFunc_t glXBindSwapBarrierNV;
403 glXQuerySwapGroupNVFunc_t glXQuerySwapGroupNV;
404 glXQueryMaxSwapGroupsNVFunc_t glXQueryMaxSwapGroupsNV;
405 glXQueryFrameCountNVFunc_t glXQueryFrameCountNV;
406 glXResetFrameCountNVFunc_t glXResetFrameCountNV;
407#ifdef GLX_VERSION_1_3
408 glXCreateNewContextFunc_t glXCreateNewContext;
409 glXCreateWindowFunc_t glXCreateWindow;
410 glXMakeContextCurrentFunc_t glXMakeContextCurrent;
411 glXChooseFBConfigFunc_t glXChooseFBConfig;
412 glXGetFBConfigsFunc_t glXGetFBConfigs;
413 glXGetFBConfigAttribFunc_t glXGetFBConfigAttrib;
414 glXGetVisualFromFBConfigFunc_t glXGetVisualFromFBConfig;
415 glXCreatePbufferFunc_t glXCreatePbuffer;
416 glXDestroyPbufferFunc_t glXDestroyPbuffer;
417 glXQueryContextFunc_t glXQueryContext;
418 glXQueryDrawableFunc_t glXQueryDrawable;
419#endif
420#endif
421 glGetStringFunc_t glGetString;
422} crOpenGLInterface;
423
424
425/** This is the one required function in _all_ SPUs */
426DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
427 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
428 SPUOptionsPtr *options, int *flags );
429
430DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
431DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
432DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
433
434DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
435DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
436DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
437
438
439DECLEXPORT(void) crSPUSetDefaultParams( void *spu, SPUOptions *options );
440DECLEXPORT(int) crSPUGetEnumIndex( const SPUOptions *option, const char *optName, const char *value );
441
442
443DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
444DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
445DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
446
447DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
448DECLEXPORT(void) crUnloadOpenGL( void );
449DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
450
451#if defined(GLX)
452DECLEXPORT(XVisualInfo *)
453crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
454 GLboolean directColor, int visBits);
455#else
456DECLEXPORT(int)
457crChooseVisual(const crOpenGLInterface *ws, int visBits);
458#endif
459
460
461#ifdef USE_OSMESA
462DECLEXPORT(int)
463crLoadOSMesa( OSMesaContext (**createContext)( GLenum format, OSMesaContext sharelist ),
464 GLboolean (**makeCurrent)( OSMesaContext ctx, GLubyte *buffer,
465 GLenum type, GLsizei width, GLsizei height ),
466 void (**destroyContext)( OSMesaContext ctx ));
467#endif
468
469#ifdef __cplusplus
470}
471#endif
472
473#endif /* CR_SPU_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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