VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/expando/expandospu_init.c@ 55998

Last change on this file since 55998 was 54905, checked in by vboxsync, 10 years ago

Host 3D: Chromium server: add Expando SPU and DLM module in order to record and save OpenGL Display Lists (currently disabled).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/* $Id: expandospu_init.c 54905 2015-03-23 11:20:58Z vboxsync $ */
2/* Copyright (c) 2001, Stanford University
3 * All rights reserved
4 *
5 * See the file LICENSE.txt for information on redistributing this software.
6 */
7
8#include <stdio.h>
9#include "cr_spu.h"
10#include "cr_dlm.h"
11#include "cr_hash.h"
12#include "expandospu.h"
13
14ExpandoSPU expando_spu;
15
16static SPUFunctions expando_functions = {
17 NULL, /* CHILD COPY */
18 NULL, /* DATA */
19 _cr_expando_table /* THE ACTUAL FUNCTIONS */
20};
21
22static SPUFunctions *
23expandoSPUInit( int id, SPU *child, SPU *self,
24 unsigned int context_id,
25 unsigned int num_contexts )
26{
27
28 (void) self;
29 (void) context_id;
30 (void) num_contexts;
31
32 expando_spu.id = id;
33 expando_spu.has_child = 0;
34 expando_spu.server = NULL;
35 if (child)
36 {
37 crSPUInitDispatchTable( &(expando_spu.child) );
38 crSPUCopyDispatchTable( &(expando_spu.child), &(child->dispatch_table) );
39 expando_spu.has_child = 1;
40 }
41 crSPUInitDispatchTable( &(expando_spu.super) );
42 crSPUCopyDispatchTable( &(expando_spu.super), &(self->superSPU->dispatch_table) );
43 expandospuGatherConfiguration();
44
45 /* Expando-specific initialization */
46 expando_spu.contextTable = crAllocHashtable();
47
48 /* We'll be using the state tracker for each context */
49 crStateInit();
50
51 return &expando_functions;
52}
53
54static void
55expandoSPUSelfDispatch(SPUDispatchTable *self)
56{
57 crSPUInitDispatchTable( &(expando_spu.self) );
58 crSPUCopyDispatchTable( &(expando_spu.self), self );
59
60 expando_spu.server = (CRServer *)(self->server);
61}
62
63
64static int
65expandoSPUCleanup(void)
66{
67 crFreeHashtable(expando_spu.contextTable, expando_free_context_state);
68 crStateDestroy();
69 return 1;
70}
71
72int
73SPULoad( char **name, char **super, SPUInitFuncPtr *init,
74 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
75 SPUOptionsPtr *options, int *flags )
76{
77 *name = "expando";
78 //*super = "passthrough";
79 *super = "render";
80 *init = expandoSPUInit;
81 *self = expandoSPUSelfDispatch;
82 *cleanup = expandoSPUCleanup;
83 *options = expandoSPUOptions;
84 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
85
86 return 1;
87}
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