VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_init.c@ 63206

Last change on this file since 63206 was 40431, checked in by vboxsync, 12 years ago

crOpenGL: more TLS data handling fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 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 "cr_spu.h"
8#include "cr_environment.h"
9#include "cr_string.h"
10#include "cr_error.h"
11#include "cr_mem.h"
12#include "cr_server.h"
13#include "feedbackspu.h"
14#include <fcntl.h>
15#ifndef WINDOWS
16#include <unistd.h>
17#endif
18
19feedbackSPU feedback_spu;
20
21static SPUFunctions feedback_functions = {
22 NULL, /* CHILD COPY */
23 NULL, /* DATA */
24 _cr_feedback_table /* THE ACTUAL FUNCTIONS */
25};
26
27static SPUFunctions *feedbackSPUInit( int id, SPU *child, SPU *self,
28 unsigned int context_id,
29 unsigned int num_contexts )
30{
31 (void) context_id;
32 (void) num_contexts;
33
34#ifdef CHROMIUM_THREADSAFE
35 crInitMutex(&feedback_spu.mutex);
36#endif
37
38 feedback_spu.id = id;
39 feedback_spu.has_child = 0;
40 if (child)
41 {
42 crSPUInitDispatchTable( &(feedback_spu.child) );
43 crSPUCopyDispatchTable( &(feedback_spu.child), &(child->dispatch_table) );
44 feedback_spu.has_child = 1;
45 }
46 crSPUInitDispatchTable( &(feedback_spu.super) );
47 crSPUCopyDispatchTable( &(feedback_spu.super), &(self->superSPU->dispatch_table) );
48 feedbackspuGatherConfiguration();
49
50 /* create/init default state tracker */
51 crStateInit();
52
53 feedback_spu.defaultctx = crStateCreateContext(NULL, 0, NULL);
54 crStateSetCurrent(feedback_spu.defaultctx);
55
56 feedback_spu.numContexts = 0;
57 crMemZero(feedback_spu.context, CR_MAX_CONTEXTS * sizeof(ContextInfo));
58
59 return &feedback_functions;
60}
61
62static void feedbackSPUSelfDispatch(SPUDispatchTable *self)
63{
64 crSPUInitDispatchTable( &(feedback_spu.self) );
65 crSPUCopyDispatchTable( &(feedback_spu.self), self );
66}
67
68static int feedbackSPUCleanup(void)
69{
70 return 1;
71}
72
73int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
74 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
75 SPUOptionsPtr *options, int *flags )
76{
77 *name = "feedback";
78 *super = "passthrough";
79 *init = feedbackSPUInit;
80 *self = feedbackSPUSelfDispatch;
81 *cleanup = feedbackSPUCleanup;
82 *options = feedbackSPUOptions;
83 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
84
85 return 1;
86}
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use