summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c
blob: 9682a8cf8adfee9e0335eabe5ac83e5d10b6d2da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* Copyright (c) 2001, Stanford University
 * All rights reserved
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#include "cr_error.h"
#include "passthroughspu.h"

static SPUFunctions passthrough_functions = {
	NULL, /* CHILD COPY */
	NULL, /* DATA */
	_cr_passthrough_table /* THE ACTUAL FUNCTIONS */
};

static SPUFunctions *
passthroughSPUInit( int id, SPU *child, SPU *self,
										unsigned int context_id,
										unsigned int num_contexts )
{
	(void) id;
	(void) self;
	(void) context_id;
	(void) num_contexts;

	if (child == NULL)
	{
		crError( "You can't load the passthrough SPU as the last SPU in a chain!" );
	}
	BuildPassthroughTable( child );
	return &passthrough_functions;
}

static void
passthroughSPUSelfDispatch(SPUDispatchTable *parent)
{
	(void)parent;
}

static int
passthroughSPUCleanup(void)
{
	return 1;
}

static SPUOptions passthroughSPUOptions[] = {
   { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
};


int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
	     SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
	     SPUOptionsPtr *options, int *flags )
{
	*name = "passthrough";
	*super = NULL;
	*init = passthroughSPUInit;
	*self = passthroughSPUSelfDispatch;
	*cleanup = passthroughSPUCleanup;
	*options = passthroughSPUOptions;
	*flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
	
	return 1;
}