VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py@ 25154

Last change on this file since 25154 was 22155, checked in by vboxsync, 15 years ago

crOpenGL: add GL_EXT_framebuffer_object support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.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
6import sys
7
8import apiutil
9
10
11apiutil.CopyrightC()
12
13print """
14#include "cr_spu.h"
15#include "chromium.h"
16#include "cr_error.h"
17#include "cr_mem.h"
18#include "cr_net.h"
19#include "server_dispatch.h"
20#include "server.h"
21"""
22
23max_components = {
24 'GetClipPlane': 4,
25 'GetCombinerStageParameterfvNV': 4,
26 'GetCombinerStageParameterivNV': 4,
27 'GetCombinerOutputParameterfvNV': 4,
28 'GetCombinerOutputParameterivNV': 4,
29 'GetCombinerInputParameterfvNV': 4,
30 'GetCombinerInputParameterivNV': 4,
31 'GetFinalCombinerInputParameterfvNV': 4,
32 'GetFinalCombinerInputParameterivNV': 4,
33 'GetLightfv': 4,
34 'GetLightiv': 4,
35 'GetMaterialfv': 4,
36 'GetMaterialiv': 4,
37 'GetPolygonStipple': 32*32/8,
38 'GetTexEnvfv': 4,
39 'GetTexEnviv': 4,
40 'GetTexGendv': 4,
41 'GetTexGenfv': 4,
42 'GetTexGeniv': 4,
43 'GetTexLevelParameterfv': 1,
44 'GetTexLevelParameteriv': 1,
45 'GetTexParameterfv': 4,
46 'GetTexParameteriv': 4,
47 'GetProgramParameterdvNV': 4,
48 'GetProgramParameterfvNV': 4,
49 'GetProgramivNV': 1,
50 'GetTrackMatrixivNV': 1,
51 'GetVertexAttribPointervNV': 1,
52 'GetVertexAttribdvNV': 4,
53 'GetVertexAttribfvNV': 4,
54 'GetVertexAttribivNV': 4,
55 'GetFenceivNV': 1,
56 'GetVertexAttribdvARB': 4,
57 'GetVertexAttribfvARB': 4,
58 'GetVertexAttribivARB': 4,
59 'GetVertexAttribPointervARB': 1,
60 'GetProgramNamedParameterdvNV': 4,
61 'GetProgramNamedParameterfvNV': 4,
62 'GetProgramLocalParameterdvARB': 4,
63 'GetProgramLocalParameterfvARB': 4,
64 'GetProgramEnvParameterdvARB': 4,
65 'GetProgramEnvParameterfvARB': 4,
66 'GetProgramivARB': 1,
67 'AreProgramsResidentNV': 1,
68 'GetBufferParameterivARB': 1,
69 'GetBufferPointervARB': 1,
70 'GetQueryObjectivARB' : 1,
71 'GetQueryObjectuivARB' : 1,
72 'GetQueryivARB' : 1,
73 'GetProgramiv' : 1,
74 'GetShaderiv' : 1,
75 'GetObjectParameterfvARB': 1,
76 'GetObjectParameterivARB': 1,
77 'GetRenderbufferParameterivEXT': 1,
78 'GetFramebufferAttachmentParameterivEXT': 1
79}
80
81no_pnames = [
82 'GetClipPlane',
83 'GetPolygonStipple',
84 'GetProgramLocalParameterdvARB',
85 'GetProgramLocalParameterfvARB',
86 'GetProgramNamedParameterdvNV',
87 'GetProgramNamedParameterfvNV',
88 'GetProgramNamedParameterdvNV',
89 'GetProgramNamedParameterfvNV',
90 'GetProgramEnvParameterdvARB',
91 'GetProgramEnvParameterfvARB',
92 'GetProgramivARB',
93 'AreProgramsResidentNV',
94 'GetProgramiv',
95 'GetShaderiv',
96 'GetObjectParameterfvARB',
97 'GetObjectParameterivARB',
98 'GetRenderbufferParameterivEXT',
99 'GetFramebufferAttachmentParameterivEXT'
100];
101
102from get_components import *;
103
104keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
105for func_name in keys:
106 #(return_type, arg_names, arg_types) = gl_mapping[func_name]
107 if ("get" in apiutil.Properties(func_name) and
108 apiutil.ReturnType(func_name) == "void" and
109 not apiutil.FindSpecial( "server", func_name )):
110
111 params = apiutil.Parameters(func_name)
112
113 print 'void SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % (func_name, apiutil.MakeDeclarationString( params ) )
114 print '{'
115
116 lastParam = params[-1]
117 assert apiutil.IsPointer(lastParam[1])
118 local_argtype = apiutil.PointerType(lastParam[1])
119 local_argname = 'local_%s' % lastParam[0]
120
121 print '\t%s %s[%d];' % ( local_argtype, local_argname, max_components[func_name] )
122 print '\t(void) %s;' % lastParam[0]
123
124 params[-1] = (local_argname, local_argtype, 0)
125
126 print '\tcr_server.head_spu->dispatch_table.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
127 if func_name in no_pnames:
128 print '\tcrServerReturnValue( &(%s[0]), %d*sizeof(%s) );' % (local_argname, max_components[func_name], local_argtype );
129 else:
130 print '\tcrServerReturnValue( &(%s[0]), lookupComponents(pname)*sizeof(%s) );' % (local_argname, local_argtype );
131 print '}\n'
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