VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c@ 48341

Last change on this file since 48341 was 47972, checked in by vboxsync, 12 years ago

OpenGL/state_tracker: format specifier warning.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 20.4 KB
Line 
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
7#include "state.h"
8#include "cr_mem.h"
9#include "cr_error.h"
10#include "cr_spu.h"
11
12#ifdef CHROMIUM_THREADSAFE
13static bool __isContextTLSInited = false;
14CRtsd __contextTSD;
15#else
16CRContext *__currentContext = NULL;
17#endif
18
19CRStateBits *__currentBits = NULL;
20CRContext *g_pAvailableContexts[CR_MAX_CONTEXTS];
21uint32_t g_cContexts = 0;
22
23static CRSharedState *gSharedState=NULL;
24
25static CRContext *defaultContext = NULL;
26
27GLboolean g_bVBoxEnableDiffOnMakeCurrent = GL_TRUE;
28
29
30/**
31 * Allocate a new shared state object.
32 * Contains texture objects, display lists, etc.
33 */
34static CRSharedState *
35crStateAllocShared(void)
36{
37 CRSharedState *s = (CRSharedState *) crCalloc(sizeof(CRSharedState));
38 if (s) {
39 s->textureTable = crAllocHashtable();
40 s->dlistTable = crAllocHashtable();
41 s->buffersTable = crAllocHashtable();
42 s->fbTable = crAllocHashtable();
43 s->rbTable = crAllocHashtable();
44 s->refCount = 1; /* refcount is number of contexts using this state */
45 s->saveCount = 0;
46 }
47 return s;
48}
49
50
51
52/**
53 * Callback used for crFreeHashtable().
54 */
55DECLEXPORT(void)
56crStateDeleteTextureCallback(void *texObj)
57{
58#ifndef IN_GUEST
59 diff_api.DeleteTextures(1, &((CRTextureObj *)texObj)->hwid);
60#endif
61 crStateDeleteTextureObject((CRTextureObj *) texObj);
62}
63
64#ifndef IN_GUEST
65typedef struct CR_STATE_RELEASEOBJ
66{
67 CRContext *pCtx;
68 CRSharedState *s;
69} CR_STATE_RELEASEOBJ, *PCR_STATE_RELEASEOBJ;
70
71static void ReleaseTextureCallback(unsigned long key, void *data1, void *data2)
72{
73 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2;
74 CRTextureObj *pObj = (CRTextureObj *)data1;
75 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx);
76 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))
77 crHashtableDelete(pData->s->textureTable, key, crStateDeleteTextureCallback);
78}
79
80static void ReleaseBufferObjectCallback(unsigned long key, void *data1, void *data2)
81{
82 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2;
83 CRBufferObject *pObj = (CRBufferObject *)data1;
84 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx);
85 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))
86 crHashtableDelete(pData->s->buffersTable, key, crStateFreeBufferObject);
87}
88
89static void ReleaseFBOCallback(unsigned long key, void *data1, void *data2)
90{
91 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2;
92 CRFramebufferObject *pObj = (CRFramebufferObject *)data1;
93 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx);
94 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))
95 crHashtableDelete(pData->s->fbTable, key, crStateFreeFBO);
96}
97
98static void ReleaseRBOCallback(unsigned long key, void *data1, void *data2)
99{
100 PCR_STATE_RELEASEOBJ pData = (PCR_STATE_RELEASEOBJ)data2;
101 CRRenderbufferObject *pObj = (CRRenderbufferObject *)data1;
102 CR_STATE_SHAREDOBJ_USAGE_CLEAR(pObj, pData->pCtx);
103 if (!CR_STATE_SHAREDOBJ_USAGE_IS_USED(pObj))
104 crHashtableDelete(pData->s->rbTable, key, crStateFreeRBO);
105}
106#endif
107/**
108 * Decrement shared state's refcount and delete when it hits zero.
109 */
110DECLEXPORT(void)
111crStateFreeShared(CRContext *pContext, CRSharedState *s)
112{
113 s->refCount--;
114 Assert(s->refCount >= 0);
115 if (s->refCount <= 0) {
116 if (s==gSharedState)
117 {
118 gSharedState = NULL;
119 }
120 crFreeHashtable(s->textureTable, crStateDeleteTextureCallback);
121 crFreeHashtable(s->dlistTable, crFree); /* call crFree for each entry */
122 crFreeHashtable(s->buffersTable, crStateFreeBufferObject);
123 crFreeHashtable(s->fbTable, crStateFreeFBO);
124 crFreeHashtable(s->rbTable, crStateFreeRBO);
125 crFree(s);
126 }
127#ifndef IN_GUEST
128 else if (pContext)
129 {
130 /* evaluate usage bits*/
131 CR_STATE_RELEASEOBJ CbData;
132 CbData.pCtx = pContext;
133 CbData.s = s;
134 crHashtableWalk(s->textureTable, ReleaseTextureCallback, &CbData);
135 crHashtableWalk(s->buffersTable, ReleaseBufferObjectCallback , &CbData);
136 crHashtableWalk(s->fbTable, ReleaseFBOCallback, &CbData);
137 crHashtableWalk(s->rbTable, ReleaseRBOCallback, &CbData);
138 }
139#endif
140}
141
142DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire()
143{
144 if (!gSharedState)
145 {
146 crWarning("No Global Shared State!");
147 return NULL;
148 }
149 gSharedState->refCount++;
150 return gSharedState;
151}
152
153DECLEXPORT(void) crStateGlobalSharedRelease()
154{
155 crStateFreeShared(NULL, gSharedState);
156}
157
158DECLEXPORT(void) STATE_APIENTRY
159crStateShareContext(GLboolean value)
160{
161 CRContext *pCtx = GetCurrentContext();
162 CRASSERT(pCtx && pCtx->shared);
163
164 if (value)
165 {
166 if (pCtx->shared == gSharedState)
167 {
168 return;
169 }
170
171 crDebug("Context(%i) shared", pCtx->id);
172
173 if (!gSharedState)
174 {
175 gSharedState = pCtx->shared;
176 }
177 else
178 {
179 crStateFreeShared(pCtx, pCtx->shared);
180 pCtx->shared = gSharedState;
181 gSharedState->refCount++;
182 }
183 }
184 else
185 {
186 if (pCtx->shared != gSharedState)
187 {
188 return;
189 }
190
191 crDebug("Context(%i) unshared", pCtx->id);
192
193 if (gSharedState->refCount==1)
194 {
195 gSharedState = NULL;
196 }
197 else
198 {
199 pCtx->shared = crStateAllocShared();
200 pCtx->shared->id = pCtx->id;
201 crStateFreeShared(pCtx, gSharedState);
202 }
203 }
204}
205
206DECLEXPORT(GLboolean) STATE_APIENTRY
207crStateContextIsShared(CRContext *pCtx)
208{
209 return pCtx->shared==gSharedState;
210}
211
212DECLEXPORT(void) STATE_APIENTRY
213crStateSetSharedContext(CRContext *pCtx)
214{
215 if (gSharedState)
216 {
217 crWarning("crStateSetSharedContext: shared is being changed from %p to %p", gSharedState, pCtx->shared);
218 }
219
220 gSharedState = pCtx->shared;
221}
222
223#ifdef CHROMIUM_THREADSAFE
224static void
225crStateFreeContext(CRContext *ctx);
226static DECLCALLBACK(void) crStateContextDtor(void *pvCtx)
227{
228 crStateFreeContext((CRContext*)pvCtx);
229}
230#endif
231
232/*
233 * Helper for crStateCreateContext, below.
234 */
235static CRContext *
236crStateCreateContextId(int i, const CRLimitsState *limits,
237 GLint visBits, CRContext *shareCtx)
238{
239 CRContext *ctx;
240 int j;
241 int node32 = i >> 5;
242 int node = i & 0x1f;
243
244 if (g_pAvailableContexts[i] != NULL)
245 {
246 crWarning("trying to create context with used id");
247 return NULL;
248 }
249
250 ctx = (CRContext *) crCalloc( sizeof( *ctx ) );
251 if (!ctx)
252 {
253 crWarning("failed to allocate context");
254 return NULL;
255 }
256 g_pAvailableContexts[i] = ctx;
257 ++g_cContexts;
258 CRASSERT(g_cContexts < RT_ELEMENTS(g_pAvailableContexts));
259 ctx->id = i;
260#ifdef CHROMIUM_THREADSAFE
261 VBoxTlsRefInit(ctx, crStateContextDtor);
262#endif
263 ctx->flush_func = NULL;
264 for (j=0;j<CR_MAX_BITARRAY;j++){
265 if (j == node32) {
266 ctx->bitid[j] = (1 << node);
267 } else {
268 ctx->bitid[j] = 0;
269 }
270 ctx->neg_bitid[j] = ~(ctx->bitid[j]);
271 }
272
273 if (shareCtx) {
274 CRASSERT(shareCtx->shared);
275 ctx->shared = shareCtx->shared;
276 ctx->shared->refCount ++;
277 }
278 else {
279 ctx->shared = crStateAllocShared();
280 ctx->shared->id = ctx->id;
281 }
282
283 /* use Chromium's OpenGL defaults */
284 crStateLimitsInit( &(ctx->limits) );
285 crStateExtensionsInit( &(ctx->limits), &(ctx->extensions) );
286
287 crStateBufferObjectInit( ctx ); /* must precede client state init! */
288 crStateClientInit( ctx );
289
290 crStateBufferInit( ctx );
291 crStateCurrentInit( ctx );
292 crStateEvaluatorInit( ctx );
293 crStateFogInit( ctx );
294 crStateHintInit( ctx );
295 crStateLightingInit( ctx );
296 crStateLineInit( ctx );
297 crStateListsInit( ctx );
298 crStateMultisampleInit( ctx );
299 crStateOcclusionInit( ctx );
300 crStatePixelInit( ctx );
301 crStatePolygonInit( ctx );
302 crStatePointInit( ctx );
303 crStateProgramInit( ctx );
304 crStateRegCombinerInit( ctx );
305 crStateStencilInit( ctx );
306 crStateTextureInit( ctx );
307 crStateTransformInit( ctx );
308 crStateViewportInit ( ctx );
309 crStateFramebufferObjectInit(ctx);
310 crStateGLSLInit(ctx);
311
312 /* This has to come last. */
313 crStateAttribInit( &(ctx->attrib) );
314
315 ctx->renderMode = GL_RENDER;
316
317 /* Initialize values that depend on the visual mode */
318 if (visBits & CR_DOUBLE_BIT) {
319 ctx->limits.doubleBuffer = GL_TRUE;
320 }
321 if (visBits & CR_RGB_BIT) {
322 ctx->limits.redBits = 8;
323 ctx->limits.greenBits = 8;
324 ctx->limits.blueBits = 8;
325 if (visBits & CR_ALPHA_BIT) {
326 ctx->limits.alphaBits = 8;
327 }
328 }
329 else {
330 ctx->limits.indexBits = 8;
331 }
332 if (visBits & CR_DEPTH_BIT) {
333 ctx->limits.depthBits = 24;
334 }
335 if (visBits & CR_STENCIL_BIT) {
336 ctx->limits.stencilBits = 8;
337 }
338 if (visBits & CR_ACCUM_BIT) {
339 ctx->limits.accumRedBits = 16;
340 ctx->limits.accumGreenBits = 16;
341 ctx->limits.accumBlueBits = 16;
342 if (visBits & CR_ALPHA_BIT) {
343 ctx->limits.accumAlphaBits = 16;
344 }
345 }
346 if (visBits & CR_STEREO_BIT) {
347 ctx->limits.stereo = GL_TRUE;
348 }
349 if (visBits & CR_MULTISAMPLE_BIT) {
350 ctx->limits.sampleBuffers = 1;
351 ctx->limits.samples = 4;
352 ctx->multisample.enabled = GL_TRUE;
353 }
354
355 if (visBits & CR_OVERLAY_BIT) {
356 ctx->limits.level = 1;
357 }
358
359 return ctx;
360}
361
362/*@todo crStateAttribDestroy*/
363static void
364crStateFreeContext(CRContext *ctx)
365{
366#ifndef DEBUG_misha
367 CRASSERT(g_pAvailableContexts[ctx->id] == ctx);
368#endif
369 if (g_pAvailableContexts[ctx->id] == ctx)
370 {
371 g_pAvailableContexts[ctx->id] = NULL;
372 --g_cContexts;
373 CRASSERT(g_cContexts < RT_ELEMENTS(g_pAvailableContexts));
374 }
375 else
376 {
377#ifndef DEBUG_misha
378 crWarning("freeing context %p, id(%d) not being in the context list", ctx, ctx->id);
379#endif
380 }
381
382 crStateClientDestroy( ctx );
383 crStateLimitsDestroy( &(ctx->limits) );
384 crStateBufferObjectDestroy( ctx );
385 crStateEvaluatorDestroy( ctx );
386 crStateListsDestroy( ctx );
387 crStateLightingDestroy( ctx );
388 crStateOcclusionDestroy( ctx );
389 crStateProgramDestroy( ctx );
390 crStateTextureDestroy( ctx );
391 crStateTransformDestroy( ctx );
392 crStateFreeShared(ctx, ctx->shared);
393 crStateFramebufferObjectDestroy(ctx);
394 crStateGLSLDestroy(ctx);
395 if (ctx->buffer.pFrontImg) crFree(ctx->buffer.pFrontImg);
396 if (ctx->buffer.pBackImg) crFree(ctx->buffer.pBackImg);
397 crFree( ctx );
398}
399
400#ifdef CHROMIUM_THREADSAFE
401# ifndef RT_OS_WINDOWS
402static DECLCALLBACK(void) crStateThreadTlsDtor(void *pvValue)
403{
404 CRContext *pCtx = (CRContext*)pvValue;
405 VBoxTlsRefRelease(pCtx);
406}
407# endif
408#endif
409
410/*
411 * Allocate the state (dirty) bits data structures.
412 * This should be called before we create any contexts.
413 * We'll also create the default/NULL context at this time and make
414 * it the current context by default. This means that if someone
415 * tries to set GL state before calling MakeCurrent() they'll be
416 * modifying the default state object, and not segfaulting on a NULL
417 * pointer somewhere.
418 */
419void crStateInit(void)
420{
421 unsigned int i;
422
423 /* Purely initialize the context bits */
424 if (!__currentBits) {
425 __currentBits = (CRStateBits *) crCalloc( sizeof(CRStateBits) );
426 crStateClientInitBits( &(__currentBits->client) );
427 crStateLightingInitBits( &(__currentBits->lighting) );
428 } else
429 {
430#ifndef DEBUG_misha
431 crWarning("State tracker is being re-initialized..\n");
432#endif
433 }
434
435 for (i=0;i<CR_MAX_CONTEXTS;i++)
436 g_pAvailableContexts[i] = NULL;
437 g_cContexts = 0;
438
439#ifdef CHROMIUM_THREADSAFE
440 if (!__isContextTLSInited)
441 {
442# ifndef RT_OS_WINDOWS
443 /* tls destructor is implemented for all platforms except windows*/
444 crInitTSDF(&__contextTSD, crStateThreadTlsDtor);
445# else
446 /* windows should do cleanup via DllMain THREAD_DETACH notification */
447 crInitTSD(&__contextTSD);
448# endif
449 __isContextTLSInited = 1;
450 }
451#endif
452
453 if (defaultContext) {
454 /* Free the default/NULL context.
455 * Ensures context bits are reset */
456#ifdef CHROMIUM_THREADSAFE
457 SetCurrentContext(NULL);
458 VBoxTlsRefRelease(defaultContext);
459#else
460 crStateFreeContext(defaultContext);
461 __currentContext = NULL;
462#endif
463 }
464
465 /* Reset diff_api */
466 crMemZero(&diff_api, sizeof(SPUDispatchTable));
467
468 /* Allocate the default/NULL context */
469 CRASSERT(g_pAvailableContexts[0] == NULL);
470 defaultContext = crStateCreateContextId(0, NULL, CR_RGB_BIT, NULL);
471 CRASSERT(g_pAvailableContexts[0] == defaultContext);
472 CRASSERT(g_cContexts == 1);
473#ifdef CHROMIUM_THREADSAFE
474 SetCurrentContext(defaultContext);
475#else
476 __currentContext = defaultContext;
477#endif
478}
479
480void crStateDestroy(void)
481{
482 int i;
483 if (__currentBits)
484 {
485 crStateClientDestroyBits(&(__currentBits->client));
486 crStateLightingDestroyBits(&(__currentBits->lighting));
487 crFree(__currentBits);
488 __currentBits = NULL;
489 }
490
491 SetCurrentContext(NULL);
492
493 for (i = CR_MAX_CONTEXTS-1; i >= 0; i--)
494 {
495 if (g_pAvailableContexts[i])
496 {
497#ifdef CHROMIUM_THREADSAFE
498 if (VBoxTlsRefIsFunctional(g_pAvailableContexts[i]))
499 VBoxTlsRefRelease(g_pAvailableContexts[i]);
500#else
501 crStateFreeContext(g_pAvailableContexts[i]);
502#endif
503 }
504 }
505
506 /* default context was stored in g_pAvailableContexts[0], so it was destroyed already */
507 defaultContext = NULL;
508
509
510#ifdef CHROMIUM_THREADSAFE
511 crFreeTSD(&__contextTSD);
512 __isContextTLSInited = 0;
513#endif
514}
515
516/*
517 * Notes on context switching and the "default context".
518 *
519 * See the paper "Tracking Graphics State for Networked Rendering"
520 * by Ian Buck, Greg Humphries and Pat Hanrahan for background
521 * information about how the state tracker and context switching
522 * works.
523 *
524 * When we make a new context current, we call crStateSwitchContext()
525 * in order to transform the 'from' context into the 'to' context
526 * (i.e. the old context to the new context). The transformation
527 * is accomplished by calling GL functions through the 'diff_api'
528 * so that the downstream GL machine (represented by the __currentContext
529 * structure) is updated to reflect the new context state. Finally,
530 * we point __currentContext to the new context.
531 *
532 * A subtle problem we have to deal with is context destruction.
533 * This issue arose while testing with Glean. We found that when
534 * the currently bound context was getting destroyed that state
535 * tracking was incorrect when a subsequent new context was activated.
536 * In DestroyContext, the __hwcontext was being set to NULL and effectively
537 * going away. Later in MakeCurrent we had no idea what the state of the
538 * downstream GL machine was (since __hwcontext was gone). This meant
539 * we had nothing to 'diff' against and the downstream GL machine was
540 * in an unknown state.
541 *
542 * The solution to this problem is the "default/NULL" context. The
543 * default context is created the first time CreateContext is called
544 * and is never freed. Whenever we get a crStateMakeCurrent(NULL) call
545 * or destroy the currently bound context in crStateDestroyContext()
546 * we call crStateSwitchContext() to switch to the default context and
547 * then set the __currentContext pointer to point to the default context.
548 * This ensures that the dirty bits are updated and the diff_api functions
549 * are called to keep the downstream GL machine in a known state.
550 * Finally, the __hwcontext variable is no longer needed now.
551 *
552 * Yeah, this is kind of a mind-bender, but it really solves the problem
553 * pretty cleanly.
554 *
555 * -Brian
556 */
557
558
559CRContext *
560crStateCreateContext(const CRLimitsState *limits, GLint visBits, CRContext *share)
561{
562 return crStateCreateContextEx(limits, visBits, share, -1);
563}
564
565CRContext *
566crStateCreateContextEx(const CRLimitsState *limits, GLint visBits, CRContext *share, GLint presetID)
567{
568 /* Must have created the default context via crStateInit() first */
569 CRASSERT(defaultContext);
570
571 if (presetID>0)
572 {
573 if(g_pAvailableContexts[presetID])
574 {
575 crWarning("requesting to create context with already allocated id");
576 return NULL;
577 }
578 }
579 else
580 {
581 int i;
582
583 for (i = 1 ; i < CR_MAX_CONTEXTS ; i++)
584 {
585 if (!g_pAvailableContexts[i])
586 {
587 presetID = i;
588 break;
589 }
590 }
591
592 if (presetID<=0)
593 {
594 crError( "Out of available contexts in crStateCreateContexts (max %d)",
595 CR_MAX_CONTEXTS );
596 /* never get here */
597 return NULL;
598 }
599 }
600
601 return crStateCreateContextId(presetID, limits, visBits, share);
602}
603
604void crStateDestroyContext( CRContext *ctx )
605{
606 CRContext *current = GetCurrentContext();
607
608 if (current == ctx) {
609 /* destroying the current context - have to be careful here */
610 CRASSERT(defaultContext);
611 /* Check to see if the differencer exists first,
612 we may not have one, aka the packspu */
613 if (diff_api.AlphaFunc)
614 crStateSwitchContext(current, defaultContext);
615#ifdef CHROMIUM_THREADSAFE
616 SetCurrentContext(defaultContext);
617#else
618 __currentContext = defaultContext;
619#endif
620 /* ensure matrix state is also current */
621 crStateMatrixMode(defaultContext->transform.matrixMode);
622 }
623
624#ifdef CHROMIUM_THREADSAFE
625 VBoxTlsRefMarkDestroy(ctx);
626 VBoxTlsRefRelease(ctx);
627#else
628 crStateFreeContext(ctx);
629#endif
630}
631
632GLboolean crStateEnableDiffOnMakeCurrent(GLboolean fEnable)
633{
634 GLboolean bOld = g_bVBoxEnableDiffOnMakeCurrent;
635 g_bVBoxEnableDiffOnMakeCurrent = fEnable;
636 return bOld;
637}
638
639void crStateMakeCurrent( CRContext *ctx )
640{
641 CRContext *current = GetCurrentContext();
642
643 if (ctx == NULL)
644 ctx = defaultContext;
645
646 if (current == ctx)
647 return; /* no-op */
648
649 CRASSERT(ctx);
650
651 if (g_bVBoxEnableDiffOnMakeCurrent && current) {
652 /* Check to see if the differencer exists first,
653 we may not have one, aka the packspu */
654 if (diff_api.AlphaFunc)
655 crStateSwitchContext( current, ctx );
656 }
657
658#ifdef CHROMIUM_THREADSAFE
659 SetCurrentContext(ctx);
660#else
661 __currentContext = ctx;
662#endif
663
664 /* ensure matrix state is also current */
665 crStateMatrixMode(ctx->transform.matrixMode);
666}
667
668
669/*
670 * As above, but don't call crStateSwitchContext().
671 */
672void crStateSetCurrent( CRContext *ctx )
673{
674 CRContext *current = GetCurrentContext();
675
676 if (ctx == NULL)
677 ctx = defaultContext;
678
679 if (current == ctx)
680 return; /* no-op */
681
682 CRASSERT(ctx);
683
684#ifdef CHROMIUM_THREADSAFE
685 SetCurrentContext(ctx);
686#else
687 __currentContext = ctx;
688#endif
689
690 /* ensure matrix state is also current */
691 crStateMatrixMode(ctx->transform.matrixMode);
692}
693
694
695CRContext *crStateGetCurrent(void)
696{
697 return GetCurrentContext();
698}
699
700
701void crStateUpdateColorBits(void)
702{
703 /* This is a hack to force updating the 'current' attribs */
704 CRStateBits *sb = GetCurrentBits();
705 FILLDIRTY(sb->current.dirty);
706 FILLDIRTY(sb->current.vertexAttrib[VERT_ATTRIB_COLOR0]);
707}
708
709
710void STATE_APIENTRY
711crStateChromiumParameteriCR( GLenum target, GLint value )
712{
713 /* This no-op function helps smooth code-gen */
714}
715
716void STATE_APIENTRY
717crStateChromiumParameterfCR( GLenum target, GLfloat value )
718{
719 /* This no-op function helps smooth code-gen */
720}
721
722void STATE_APIENTRY
723crStateChromiumParametervCR( GLenum target, GLenum type, GLsizei count, const GLvoid *values )
724{
725 /* This no-op function helps smooth code-gen */
726}
727
728void STATE_APIENTRY
729crStateGetChromiumParametervCR( GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values )
730{
731 /* This no-op function helps smooth code-gen */
732}
733
734void STATE_APIENTRY
735crStateReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
736 GLenum format, GLenum type, GLvoid *pixels )
737{
738 /* This no-op function helps smooth code-gen */
739}
740
741void crStateVBoxDetachThread()
742{
743 /* release the context ref so that it can be freed */
744 SetCurrentContext(NULL);
745}
746
747
748void crStateVBoxAttachThread()
749{
750}
751
752GLint crStateVBoxCreateContext( GLint con, const char * dpyName, GLint visual, GLint shareCtx )
753{
754 return 0;
755}
756
757GLint crStateVBoxWindowCreate( GLint con, const char *dpyName, GLint visBits )
758{
759 return 0;
760}
761
762void crStateVBoxWindowDestroy( GLint con, GLint window )
763{
764}
765
766GLint crStateVBoxConCreate(struct VBOXUHGSMI *pHgsmi)
767{
768 return 0;
769}
770
771void crStateVBoxConDestroy(GLint con)
772{
773}
774
775void crStateVBoxConFlush(GLint con)
776{
777}
Note: See TracBrowser for help on using the repository browser.

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