VirtualBox

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

最後變更 在這個檔案從17543是 17269,由 vboxsync 提交於 16 年 前

export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.9 KB
 
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 CRContext *ctx;
32 (void) context_id;
33 (void) num_contexts;
34
35 feedback_spu.id = id;
36 feedback_spu.has_child = 0;
37 if (child)
38 {
39 crSPUInitDispatchTable( &(feedback_spu.child) );
40 crSPUCopyDispatchTable( &(feedback_spu.child), &(child->dispatch_table) );
41 feedback_spu.has_child = 1;
42 }
43 crSPUInitDispatchTable( &(feedback_spu.super) );
44 crSPUCopyDispatchTable( &(feedback_spu.super), &(self->superSPU->dispatch_table) );
45 feedbackspuGatherConfiguration();
46
47 /* create/init default state tracker */
48 crStateInit();
49 ctx = crStateGetCurrent();
50 CRASSERT(ctx);
51 crStateSetCurrentPointers(ctx, &feedback_spu.current);
52
53 return &feedback_functions;
54}
55
56static void feedbackSPUSelfDispatch(SPUDispatchTable *self)
57{
58 crSPUInitDispatchTable( &(feedback_spu.self) );
59 crSPUCopyDispatchTable( &(feedback_spu.self), self );
60}
61
62static int feedbackSPUCleanup(void)
63{
64 return 1;
65}
66
67int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
68 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
69 SPUOptionsPtr *options, int *flags )
70{
71 *name = "feedback";
72 *super = "passthrough";
73 *init = feedbackSPUInit;
74 *self = feedbackSPUSelfDispatch;
75 *cleanup = feedbackSPUCleanup;
76 *options = feedbackSPUOptions;
77 *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
78
79 return 1;
80}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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