VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/pack/packspu_init.c@ 16241

Last change on this file since 16241 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 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_mem.h"
8#include "cr_spu.h"
9#include "cr_glstate.h"
10#include "packspu.h"
11#include "cr_packfunctions.h"
12#include <stdio.h>
13
14extern SPUNamedFunctionTable _cr_pack_table[];
15
16SPUFunctions pack_functions = {
17 NULL, /* CHILD COPY */
18 NULL, /* DATA */
19 _cr_pack_table /* THE ACTUAL FUNCTIONS */
20};
21
22PackSPU pack_spu;
23
24#ifdef CHROMIUM_THREADSAFE
25CRtsd _PackTSD;
26CRmutex _PackMutex;
27#endif
28
29static SPUFunctions *
30packSPUInit( int id, SPU *child, SPU *self,
31 unsigned int context_id,
32 unsigned int num_contexts )
33{
34 ThreadInfo *thread;
35
36 (void) context_id;
37 (void) num_contexts;
38 (void) child;
39 (void) self;
40
41#ifdef CHROMIUM_THREADSAFE
42 crInitMutex(&_PackMutex);
43#endif
44
45 pack_spu.id = id;
46
47 packspuSetVBoxConfiguration( child );
48
49 /* This connects to the server, sets up the packer, etc. */
50 thread = packspuNewThread( crThreadID() );
51
52 if (!thread) {
53 return NULL;
54 }
55 CRASSERT( thread == &(pack_spu.thread[0]) );
56
57 packspuCreateFunctions();
58 crStateInit();
59
60 return &pack_functions;
61}
62
63static void
64packSPUSelfDispatch(SPUDispatchTable *self)
65{
66 (void)self;
67}
68
69static int
70packSPUCleanup(void)
71{
72 return 1;
73}
74
75extern SPUOptions packSPUOptions[];
76
77int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
78 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
79 SPUOptionsPtr *options, int *flags )
80{
81 *name = "pack";
82 *super = NULL;
83 *init = packSPUInit;
84 *self = packSPUSelfDispatch;
85 *cleanup = packSPUCleanup;
86 *options = packSPUOptions;
87 *flags = (SPU_HAS_PACKER|SPU_IS_TERMINAL|SPU_MAX_SERVERS_ONE);
88
89 return 1;
90}
Note: See TracBrowser for help on using the repository browser.

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