VirtualBox

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

Last change on this file since 78341 was 78341, checked in by vboxsync, 6 years ago

Config.kmk,Additions/common/crOpenGL,VBox/GuestHost/OpenGL,HostServices/SharedOpenGL: Remove CHROMIUM_THREADSAFE define and apply the current default

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