Skip to content
This repository
Browse code

Cleanup/comment/format code.

  • Loading branch information...
commit 54f304ad1c3ec54649f83ddf769746d433cd612d 1 parent 34c7d42
José Fonseca jrfonseca authored
6 cgltrace.py
@@ -35,7 +35,7 @@
35 35
36 36 class CglTracer(GlTracer):
37 37
38   - def is_public_function(self, function):
  38 + def isFunctionPublic(self, function):
39 39 # The symbols visible in libGL.dylib can vary, so expose them all
40 40 return True
41 41
@@ -55,8 +55,8 @@ def is_public_function(self, function):
55 55 print
56 56
57 57 api = API()
58   - api.add_api(cglapi)
59   - api.add_api(glapi)
  58 + api.addApi(cglapi)
  59 + api.addApi(glapi)
60 60 tracer = CglTracer()
61 61 tracer.trace_api(api)
62 62
2  d3d10trace.py
@@ -25,7 +25,7 @@
25 25
26 26
27 27 from specs.d3d10misc import d3d10
28   -from trace import DllTracer
  28 +from dlltrace import DllTracer
29 29
30 30
31 31 if __name__ == '__main__':
6 d3d8trace.py
@@ -25,18 +25,18 @@
25 25
26 26
27 27 from specs.d3d8 import d3d8
28   -from trace import DllTracer
  28 +from dlltrace import DllTracer
29 29
30 30
31 31 class D3D8Tracer(DllTracer):
32 32
33   - def dump_arg_instance(self, function, arg):
  33 + def serializeArgValue(self, function, arg):
34 34 # Dump shaders as strings
35 35 if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction':
36 36 print ' DumpShader(trace::localWriter, %s);' % (arg.name)
37 37 return
38 38
39   - DllTracer.dump_arg_instance(self, function, arg)
  39 + DllTracer.serializeArgValue(self, function, arg)
40 40
41 41
42 42 if __name__ == '__main__':
6 d3d9trace.py
@@ -24,19 +24,19 @@
24 24 ##########################################################################/
25 25
26 26
27   -from trace import DllTracer
  27 +from dlltrace import DllTracer
28 28 from specs.d3d9 import d3d9
29 29
30 30
31 31 class D3D9Tracer(DllTracer):
32 32
33   - def dump_arg_instance(self, function, arg):
  33 + def serializeArgValue(self, function, arg):
34 34 # Dump shaders as strings
35 35 if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction':
36 36 print ' DumpShader(trace::localWriter, %s);' % (arg.name)
37 37 return
38 38
39   - DllTracer.dump_arg_instance(self, function, arg)
  39 + DllTracer.serializeArgValue(self, function, arg)
40 40
41 41
42 42 if __name__ == '__main__':
12 ddrawtrace.py
@@ -25,19 +25,19 @@
25 25
26 26
27 27 from specs.d3d import ddraw, interfaces
28   -from trace import DllTracer
  28 +from dlltrace import DllTracer
29 29
30 30
31 31 class DDrawTracer(DllTracer):
32 32
33   - def trace_function_impl_body(self, function):
  33 + def traceFunctionImplBody(self, function):
34 34 if function.name in ('AcquireDDThreadLock', 'ReleaseDDThreadLock'):
35   - self.dispatch_function(function)
  35 + self.invokeFunction(function)
36 36 return
37 37
38   - DllTracer.trace_function_impl_body(self, function)
  38 + DllTracer.traceFunctionImplBody(self, function)
39 39
40   - def wrap_arg(self, function, arg):
  40 + def serializeArg(self, function, arg):
41 41 if function.name == 'DirectDrawCreateEx' and arg.name == 'lplpDD':
42 42 print ' if (*lplpDD) {'
43 43 for iface in interfaces:
@@ -46,7 +46,7 @@ def wrap_arg(self, function, arg):
46 46 print ' }'
47 47 print ' }'
48 48
49   - DllTracer.wrap_arg(self, function, arg)
  49 + DllTracer.serializeArg(self, function, arg)
50 50
51 51
52 52 if __name__ == '__main__':
12 dispatch.py
@@ -54,7 +54,7 @@ def header(self):
54 54
55 55 def dispatch_api(self, api):
56 56 for function in api.functions:
57   - self.dispatch_function(function)
  57 + self.invokeFunction(function)
58 58
59 59 # define standard name aliases for convenience, but only when not
60 60 # tracing, as that would cause symbol clashing with the tracing
@@ -65,7 +65,7 @@ def dispatch_api(self, api):
65 65 print '#endif /* RETRACE */'
66 66 print
67 67
68   - def dispatch_function(self, function):
  68 + def invokeFunction(self, function):
69 69 ptype = function_pointer_type(function)
70 70 pvalue = function_pointer_value(function)
71 71 print 'typedef ' + function.prototype('* %s' % ptype) + ';'
@@ -82,24 +82,24 @@ def dispatch_function(self, function):
82 82 print '}'
83 83 print
84 84
85   - def is_public_function(self, function):
  85 + def isFunctionPublic(self, function):
86 86 return True
87 87
88 88 def get_true_pointer(self, function):
89 89 ptype = function_pointer_type(function)
90 90 pvalue = function_pointer_value(function)
91   - if self.is_public_function(function):
  91 + if self.isFunctionPublic(function):
92 92 get_proc_address = '__getPublicProcAddress'
93 93 else:
94 94 get_proc_address = '__getPrivateProcAddress'
95 95 print ' if (!%s) {' % (pvalue,)
96 96 print ' %s = (%s)%s(__name);' % (pvalue, ptype, get_proc_address)
97 97 print ' if (!%s) {' % (pvalue,)
98   - self.fail_function(function)
  98 + self.failFunction(function)
99 99 print ' }'
100 100 print ' }'
101 101
102   - def fail_function(self, function):
  102 + def failFunction(self, function):
103 103 if function.type is stdapi.Void or function.fail is not None:
104 104 print r' os::log("warning: ignoring call to unavailable function %s\n", __name);'
105 105 if function.type is stdapi.Void:
69 dlltrace.py
... ... @@ -0,0 +1,69 @@
  1 +##########################################################################
  2 +#
  3 +# Copyright 2008-2010 VMware, Inc.
  4 +# All Rights Reserved.
  5 +#
  6 +# Permission is hereby granted, free of charge, to any person obtaining a copy
  7 +# of this software and associated documentation files (the "Software"), to deal
  8 +# in the Software without restriction, including without limitation the rights
  9 +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 +# copies of the Software, and to permit persons to whom the Software is
  11 +# furnished to do so, subject to the following conditions:
  12 +#
  13 +# The above copyright notice and this permission notice shall be included in
  14 +# all copies or substantial portions of the Software.
  15 +#
  16 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 +# THE SOFTWARE.
  23 +#
  24 +##########################################################################/
  25 +
  26 +"""Trace code generation for Windows DLLs."""
  27 +
  28 +
  29 +from dispatch import Dispatcher
  30 +from trace import Tracer
  31 +
  32 +
  33 +class DllTracer(Tracer):
  34 +
  35 + def __init__(self, dllname):
  36 + self.dllname = dllname
  37 +
  38 + def header(self, api):
  39 + print '''
  40 +static HINSTANCE g_hDll = NULL;
  41 +
  42 +static PROC
  43 +__getPublicProcAddress(LPCSTR lpProcName)
  44 +{
  45 + if (!g_hDll) {
  46 + char szDll[MAX_PATH] = {0};
  47 +
  48 + if (!GetSystemDirectoryA(szDll, MAX_PATH)) {
  49 + return NULL;
  50 + }
  51 +
  52 + strcat(szDll, "\\\\%s");
  53 +
  54 + g_hDll = LoadLibraryA(szDll);
  55 + if (!g_hDll) {
  56 + return NULL;
  57 + }
  58 + }
  59 +
  60 + return GetProcAddress(g_hDll, lpProcName);
  61 +}
  62 +
  63 +''' % self.dllname
  64 +
  65 + dispatcher = Dispatcher()
  66 + dispatcher.dispatch_api(api)
  67 +
  68 + Tracer.header(self, api)
  69 +
16 egltrace.py
@@ -42,12 +42,12 @@
42 42
43 43 class EglTracer(GlTracer):
44 44
45   - def is_public_function(self, function):
  45 + def isFunctionPublic(self, function):
46 46 # The symbols visible in libEGL.so can vary, so expose them all
47 47 return True
48 48
49   - def trace_function_impl_body(self, function):
50   - GlTracer.trace_function_impl_body(self, function)
  49 + def traceFunctionImplBody(self, function):
  50 + GlTracer.traceFunctionImplBody(self, function)
51 51
52 52 if function.name == 'eglMakeCurrent':
53 53 print ' // update the profile'
@@ -64,8 +64,8 @@ def trace_function_impl_body(self, function):
64 64 print ' tr->profile = PROFILE_ES2;'
65 65 print ' }'
66 66
67   - def wrap_ret(self, function, instance):
68   - GlTracer.wrap_ret(self, function, instance)
  67 + def wrapRet(self, function, instance):
  68 + GlTracer.wrapRet(self, function, instance)
69 69
70 70 if function.name == "eglGetProcAddress":
71 71 print ' %s = __unwrap_proc_addr(procname, %s);' % (instance, instance)
@@ -89,9 +89,9 @@ def wrap_ret(self, function, instance):
89 89 print
90 90
91 91 api = API()
92   - api.add_api(eglapi)
93   - api.add_api(glapi)
94   - api.add_api(glesapi)
  92 + api.addApi(eglapi)
  93 + api.addApi(glapi)
  94 + api.addApi(glesapi)
95 95 tracer = EglTracer()
96 96 tracer.trace_api(api)
97 97
2  glproc.py
@@ -503,7 +503,7 @@ def header(self):
503 503 void * __getPrivateProcAddress(const char *procName);
504 504 '''
505 505
506   - def is_public_function(self, function):
  506 + def isFunctionPublic(self, function):
507 507 return function.name in public_symbols or function.name.startswith('CGL')
508 508
509 509
28 glretrace.py
@@ -37,8 +37,8 @@ class GlRetracer(Retracer):
37 37
38 38 table_name = 'glretrace::gl_callbacks'
39 39
40   - def retrace_function(self, function):
41   - Retracer.retrace_function(self, function)
  40 + def retraceFunction(self, function):
  41 + Retracer.retraceFunction(self, function)
42 42
43 43 array_pointer_function_names = set((
44 44 "glVertexPointer",
@@ -165,7 +165,7 @@ def retrace_function(self, function):
165 165 'glUnmapNamedBufferEXT',
166 166 ])
167 167
168   - def retrace_function_body(self, function):
  168 + def retraceFunctionBody(self, function):
169 169 is_array_pointer = function.name in self.array_pointer_function_names
170 170 is_draw_array = function.name in self.draw_array_function_names
171 171 is_draw_elements = function.name in self.draw_elements_function_names
@@ -178,14 +178,14 @@ def retrace_function_body(self, function):
178 178 print ' GLint __array_buffer = 0;'
179 179 print ' glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &__array_buffer);'
180 180 print ' if (!__array_buffer) {'
181   - self.fail_function(function)
  181 + self.failFunction(function)
182 182 print ' }'
183 183
184 184 if is_draw_elements:
185 185 print ' GLint __element_array_buffer = 0;'
186 186 print ' glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);'
187 187 print ' if (!__element_array_buffer) {'
188   - self.fail_function(function)
  188 + self.failFunction(function)
189 189 print ' }'
190 190
191 191 print ' }'
@@ -213,7 +213,7 @@ def retrace_function_body(self, function):
213 213 print ' glretrace::frame_complete(call);'
214 214 return
215 215
216   - Retracer.retrace_function_body(self, function)
  216 + Retracer.retraceFunctionBody(self, function)
217 217
218 218 # Post-snapshots
219 219 if function.name in ('glFlush', 'glFinish'):
@@ -226,7 +226,7 @@ def retrace_function_body(self, function):
226 226 print ' }'
227 227
228 228
229   - def call_function(self, function):
  229 + def invokeFunction(self, function):
230 230 # Infer the drawable size from GL calls
231 231 if function.name == "glViewport":
232 232 print ' glretrace::updateDrawable(x + width, y + height);'
@@ -241,7 +241,7 @@ def call_function(self, function):
241 241 if function.name == 'memcpy':
242 242 print ' if (!dest || !src || !n) return;'
243 243
244   - Retracer.call_function(self, function)
  244 + Retracer.invokeFunction(self, function)
245 245
246 246 # Error checking
247 247 if function.name == "glBegin":
@@ -348,20 +348,20 @@ def call_function(self, function):
348 348 print r' retrace::delRegionByPointer(ptr);'
349 349 print r' }'
350 350
351   - def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
  351 + def extractArg(self, function, arg, arg_type, lvalue, rvalue):
352 352 if function.name in self.array_pointer_function_names and arg.name == 'pointer':
353 353 print ' %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
354 354 return
355 355
356 356 if function.name in self.draw_elements_function_names and arg.name == 'indices' or\
357 357 function.name in self.draw_indirect_function_names and arg.name == 'indirect':
358   - self.extract_opaque_arg(function, arg, arg_type, lvalue, rvalue)
  358 + self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
359 359 return
360 360
361 361 # Handle pointer with offsets into the current pack pixel buffer
362 362 # object.
363 363 if function.name in self.pack_function_names and arg.output:
364   - self.extract_opaque_arg(function, arg, arg_type, lvalue, rvalue)
  364 + self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
365 365 return
366 366
367 367 if arg.type is glapi.GLlocation \
@@ -373,7 +373,7 @@ def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
373 373 and 'programObj' not in [arg.name for arg in function.args]:
374 374 print ' GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'
375 375
376   - Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue)
  376 + Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
377 377
378 378 # Don't try to use more samples than the implementation supports
379 379 if arg.name == 'samples':
@@ -396,6 +396,6 @@ def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
396 396
397 397 '''
398 398 api = glapi.glapi
399   - api.add_api(glesapi.glesapi)
  399 + api.addApi(glesapi.glesapi)
400 400 retracer = GlRetracer()
401   - retracer.retrace_api(api)
  401 + retracer.retraceApi(api)
32 glstate.py
@@ -117,10 +117,10 @@ def temp_name(self, args):
117 117
118 118 return pname[3:].lower()
119 119
120   - def visit_const(self, const, args):
  120 + def visitConst(self, const, args):
121 121 return self.visit(const.type, args)
122 122
123   - def visit_scalar(self, type, args):
  123 + def visitScalar(self, type, args):
124 124 temp_name = self.temp_name(args)
125 125 elem_type = self.inflector.reduced_type(type)
126 126 inflection = self.inflector.inflect(type)
@@ -131,23 +131,23 @@ def visit_scalar(self, type, args):
131 131 print ' %s %s = %s(%s);' % (elem_type, temp_name, inflection + self.suffix, ', '.join(args))
132 132 return temp_name
133 133
134   - def visit_string(self, string, args):
  134 + def visitString(self, string, args):
135 135 temp_name = self.temp_name(args)
136 136 inflection = self.inflector.inflect(string)
137 137 assert not inflection.endswith('v')
138 138 print ' %s %s = (%s)%s(%s);' % (string, temp_name, string, inflection + self.suffix, ', '.join(args))
139 139 return temp_name
140 140
141   - def visit_alias(self, alias, args):
142   - return self.visit_scalar(alias, args)
  141 + def visitAlias(self, alias, args):
  142 + return self.visitScalar(alias, args)
143 143
144   - def visit_enum(self, enum, args):
  144 + def visitEnum(self, enum, args):
145 145 return self.visit(GLint, args)
146 146
147   - def visit_bitmask(self, bitmask, args):
  147 + def visitBitmask(self, bitmask, args):
148 148 return self.visit(GLint, args)
149 149
150   - def visit_array(self, array, args):
  150 + def visitArray(self, array, args):
151 151 temp_name = self.temp_name(args)
152 152 if array.length == '1':
153 153 return self.visit(array.type)
@@ -162,7 +162,7 @@ def visit_array(self, array, args):
162 162 print ' assert(%s[%s] == (%s)0xdeadc0de);' % (temp_name, array.length, elem_type)
163 163 return temp_name
164 164
165   - def visit_opaque(self, pointer, args):
  165 + def visitOpaque(self, pointer, args):
166 166 temp_name = self.temp_name(args)
167 167 inflection = self.inflector.inflect(pointer)
168 168 assert inflection.endswith('v')
@@ -198,7 +198,7 @@ class JsonWriter(Visitor):
198 198
199 199 It expects a previously declared JSONWriter instance named "json".'''
200 200
201   - def visit_literal(self, literal, instance):
  201 + def visitLiteral(self, literal, instance):
202 202 if literal.kind == 'Bool':
203 203 print ' json.writeBool(%s);' % instance
204 204 elif literal.kind in ('SInt', 'Uint', 'Float', 'Double'):
@@ -206,28 +206,28 @@ def visit_literal(self, literal, instance):
206 206 else:
207 207 raise NotImplementedError
208 208
209   - def visit_string(self, string, instance):
  209 + def visitString(self, string, instance):
210 210 assert string.length is None
211 211 print ' json.writeString((const char *)%s);' % instance
212 212
213   - def visit_enum(self, enum, instance):
  213 + def visitEnum(self, enum, instance):
214 214 if enum.expr == 'GLenum':
215 215 print ' dumpEnum(json, %s);' % instance
216 216 else:
217 217 print ' json.writeNumber(%s);' % instance
218 218
219   - def visit_bitmask(self, bitmask, instance):
  219 + def visitBitmask(self, bitmask, instance):
220 220 raise NotImplementedError
221 221
222   - def visit_alias(self, alias, instance):
  222 + def visitAlias(self, alias, instance):
223 223 self.visit(alias.type, instance)
224 224
225   - def visit_opaque(self, opaque, instance):
  225 + def visitOpaque(self, opaque, instance):
226 226 print ' json.writeNumber((size_t)%s);' % instance
227 227
228 228 __index = 0
229 229
230   - def visit_array(self, array, instance):
  230 + def visitArray(self, array, instance):
231 231 index = '__i%u' % JsonWriter.__index
232 232 JsonWriter.__index += 1
233 233 print ' json.beginArray();'
54 gltrace.py
@@ -31,7 +31,7 @@
31 31 import specs.glapi as glapi
32 32 import specs.glparams as glparams
33 33 from specs.glxapi import glxapi
34   -from trace import Tracer, dump_instance
  34 +from trace import Tracer
35 35
36 36
37 37 class TypeGetter(stdapi.Visitor):
@@ -42,10 +42,10 @@ def __init__(self, prefix = 'glGet', long_suffix = True, ext_suffix = ''):
42 42 self.long_suffix = long_suffix
43 43 self.ext_suffix = ext_suffix
44 44
45   - def visit_const(self, const):
  45 + def visitConst(self, const):
46 46 return self.visit(const.type)
47 47
48   - def visit_alias(self, alias):
  48 + def visitAlias(self, alias):
49 49 if alias.expr == 'GLboolean':
50 50 if self.long_suffix:
51 51 suffix = 'Booleanv'
@@ -80,13 +80,13 @@ def visit_alias(self, alias):
80 80 function_name = self.prefix + suffix + self.ext_suffix
81 81 return function_name, arg_type
82 82
83   - def visit_enum(self, enum):
  83 + def visitEnum(self, enum):
84 84 return self.visit(glapi.GLint)
85 85
86   - def visit_bitmask(self, bitmask):
  86 + def visitBitmask(self, bitmask):
87 87 return self.visit(glapi.GLint)
88 88
89   - def visit_opaque(self, pointer):
  89 + def visitOpaque(self, pointer):
90 90 return self.prefix + 'Pointerv' + self.ext_suffix, 'GLvoid *'
91 91
92 92
@@ -406,7 +406,7 @@ def header(self, api):
406 406 'GL_T4F_C4F_N3F_V4F',
407 407 ]
408 408
409   - def trace_function_impl_body(self, function):
  409 + def traceFunctionImplBody(self, function):
410 410 # Defer tracing of user array pointers...
411 411 if function.name in self.array_pointer_function_names:
412 412 print ' GLint __array_buffer = 0;'
@@ -418,7 +418,7 @@ def trace_function_impl_body(self, function):
418 418 print ' ctx->user_arrays_arb = true;'
419 419 if function.name == "glVertexAttribPointerNV":
420 420 print ' ctx->user_arrays_nv = true;'
421   - self.dispatch_function(function)
  421 + self.invokeFunction(function)
422 422
423 423 # And also break down glInterleavedArrays into the individual calls
424 424 if function.name == 'glInterleavedArrays':
@@ -454,7 +454,7 @@ def trace_function_impl_body(self, function):
454 454 print ' static const trace::FunctionSig &__sig = %s ? __glEnableClientState_sig : __glDisableClientState_sig;' % flag_name
455 455 print ' unsigned __call = trace::localWriter.beginEnter(&__sig);'
456 456 print ' trace::localWriter.beginArg(0);'
457   - dump_instance(glapi.GLenum, enable_name)
  457 + self.serializeValue(glapi.GLenum, enable_name)
458 458 print ' trace::localWriter.endArg();'
459 459 print ' trace::localWriter.endEnter();'
460 460 print ' trace::localWriter.beginLeave(__call);'
@@ -495,7 +495,7 @@ def trace_function_impl_body(self, function):
495 495 # be an herculian task given that vertex attrib locations appear in
496 496 # many entry-points, including non-shader related ones.
497 497 if function.name == 'glLinkProgram':
498   - Tracer.dispatch_function(self, function)
  498 + Tracer.invokeFunction(self, function)
499 499 print ' GLint active_attributes = 0;'
500 500 print ' __glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &active_attributes);'
501 501 print ' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {'
@@ -513,7 +513,7 @@ def trace_function_impl_body(self, function):
513 513 print ' }'
514 514 print ' }'
515 515 if function.name == 'glLinkProgramARB':
516   - Tracer.dispatch_function(self, function)
  516 + Tracer.invokeFunction(self, function)
517 517 print ' GLint active_attributes = 0;'
518 518 print ' __glGetObjectParameterivARB(programObj, GL_OBJECT_ACTIVE_ATTRIBUTES_ARB, &active_attributes);'
519 519 print ' for (GLint attrib = 0; attrib < active_attributes; ++attrib) {'
@@ -531,14 +531,14 @@ def trace_function_impl_body(self, function):
531 531 print ' }'
532 532 print ' }'
533 533
534   - Tracer.trace_function_impl_body(self, function)
  534 + Tracer.traceFunctionImplBody(self, function)
535 535
536 536 gremedy_functions = [
537 537 'glStringMarkerGREMEDY',
538 538 'glFrameTerminatorGREMEDY',
539 539 ]
540 540
541   - def dispatch_function(self, function):
  541 + def invokeFunction(self, function):
542 542 if function.name in ('glLinkProgram', 'glLinkProgramARB'):
543 543 # These functions have been dispatched already
544 544 return
@@ -555,16 +555,16 @@ def dispatch_function(self, function):
555 555 print ' }'
556 556 if_ = 'else if'
557 557 print ' else {'
558   - Tracer.dispatch_function(self, function)
  558 + Tracer.invokeFunction(self, function)
559 559 print ' }'
560 560 return
561 561
562 562 # Override GL extensions
563 563 if function.name in ('glGetString', 'glGetIntegerv', 'glGetStringi'):
564   - Tracer.dispatch_function(self, function, prefix = 'gltrace::__', suffix = '_override')
  564 + Tracer.invokeFunction(self, function, prefix = 'gltrace::__', suffix = '_override')
565 565 return
566 566
567   - Tracer.dispatch_function(self, function)
  567 + Tracer.invokeFunction(self, function)
568 568
569 569 def emit_memcpy(self, dest, src, length):
570 570 print ' unsigned __call = trace::localWriter.beginEnter(&trace::memcpy_sig);'
@@ -595,8 +595,8 @@ def emit_memcpy(self, dest, src, length):
595 595 'ATOMIC_COUNTER_BUFFER',
596 596 ]
597 597
598   - def wrap_ret(self, function, instance):
599   - Tracer.wrap_ret(self, function, instance)
  598 + def wrapRet(self, function, instance):
  599 + Tracer.wrapRet(self, function, instance)
600 600
601 601
602 602 if function.name in ('glMapBuffer', 'glMapBufferARB'):
@@ -672,7 +672,7 @@ def gl_boolean(self, value):
672 672 'glTextureSubImage3DEXT',
673 673 ])
674 674
675   - def dump_arg_instance(self, function, arg):
  675 + def serializeArgValue(self, function, arg):
676 676 if function.name in self.draw_function_names and arg.name == 'indices':
677 677 print ' GLint __element_array_buffer = 0;'
678 678 print ' __glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);'
@@ -688,7 +688,7 @@ def dump_arg_instance(self, function, arg):
688 688 else:
689 689 print ' trace::localWriter.writeBlob(%s, count*__gl_type_size(type));' % (arg.name)
690 690 print ' } else {'
691   - Tracer.dump_arg_instance(self, function, arg)
  691 + Tracer.serializeArgValue(self, function, arg)
692 692 print ' }'
693 693 return
694 694
@@ -705,7 +705,7 @@ def dump_arg_instance(self, function, arg):
705 705 print ' if (__unpack_buffer) {'
706 706 print ' trace::localWriter.writeOpaque(%s);' % arg.name
707 707 print ' } else {'
708   - Tracer.dump_arg_instance(self, function, arg)
  708 + Tracer.serializeArgValue(self, function, arg)
709 709 print ' }'
710 710 print ' }'
711 711 return
@@ -719,13 +719,13 @@ def dump_arg_instance(self, function, arg):
719 719 assert function.args[arg.index - 1].name == 'pname'
720 720 assert function.args[arg.index - 1].type == glapi.GLenum
721 721 print ' if (is_symbolic_pname(pname) && is_symbolic_param(%s)) {' % arg.name
722   - dump_instance(glapi.GLenum, arg.name)
  722 + self.serializeValue(glapi.GLenum, arg.name)
723 723 print ' } else {'
724   - Tracer.dump_arg_instance(self, function, arg)
  724 + Tracer.serializeArgValue(self, function, arg)
725 725 print ' }'
726 726 return
727 727
728   - Tracer.dump_arg_instance(self, function, arg)
  728 + Tracer.serializeArgValue(self, function, arg)
729 729
730 730 def footer(self, api):
731 731 Tracer.footer(self, api)
@@ -773,7 +773,7 @@ def footer(self, api):
773 773 assert not arg.output
774 774 print ' trace::localWriter.beginArg(%u);' % (arg.index,)
775 775 if arg.name != 'pointer':
776   - dump_instance(arg.type, arg.name)
  776 + self.serializeValue(arg.type, arg.name)
777 777 else:
778 778 print ' trace::localWriter.writeBlob((const void *)%s, __size);' % (arg.name)
779 779 print ' trace::localWriter.endArg();'
@@ -851,7 +851,7 @@ def footer(self, api):
851 851 assert not arg.output
852 852 print ' trace::localWriter.beginArg(%u);' % (arg.index,)
853 853 if arg.name != 'pointer':
854   - dump_instance(arg.type, arg.name)
  854 + self.serializeValue(arg.type, arg.name)
855 855 else:
856 856 print ' trace::localWriter.writeBlob((const void *)%s, __size);' % (arg.name)
857 857 print ' trace::localWriter.endArg();'
@@ -921,7 +921,7 @@ def fake_call(self, function, args):
921 921 for arg, instance in zip(function.args, args):
922 922 assert not arg.output
923 923 print ' trace::localWriter.beginArg(%u);' % (arg.index,)
924   - dump_instance(arg.type, instance)
  924 + self.serializeValue(arg.type, instance)
925 925 print ' trace::localWriter.endArg();'
926 926 print ' trace::localWriter.endEnter();'
927 927 print ' trace::localWriter.beginLeave(__fake_call);'
10 glxtrace.py
@@ -37,12 +37,12 @@
37 37
38 38 class GlxTracer(GlTracer):
39 39
40   - def is_public_function(self, function):
  40 + def isFunctionPublic(self, function):
41 41 # The symbols visible in libGL.so can vary, so expose them all
42 42 return True
43 43
44   - def wrap_ret(self, function, instance):
45   - GlTracer.wrap_ret(self, function, instance)
  44 + def wrapRet(self, function, instance):
  45 + GlTracer.wrapRet(self, function, instance)
46 46
47 47 if function.name in ("glXGetProcAddress", "glXGetProcAddressARB"):
48 48 print ' %s = __unwrap_proc_addr(procName, %s);' % (instance, instance)
@@ -71,8 +71,8 @@ def wrap_ret(self, function, instance):
71 71 print
72 72
73 73 api = API()
74   - api.add_api(glxapi)
75   - api.add_api(glapi)
  74 + api.addApi(glxapi)
  75 + api.addApi(glapi)
76 76 tracer = GlxTracer()
77 77 tracer.trace_api(api)
78 78
109 retrace.py
@@ -34,15 +34,16 @@
34 34
35 35
36 36 class ConstRemover(stdapi.Rebuilder):
  37 + '''Type visitor which strips out const qualifiers from types.'''
37 38
38   - def visit_const(self, const):
  39 + def visitConst(self, const):
39 40 return const.type
40 41
41   - def visit_opaque(self, opaque):
  42 + def visitOpaque(self, opaque):
42 43 return opaque
43 44
44 45
45   -def handle_entry(handle, value):
  46 +def lookupHandle(handle, value):
46 47 if handle.key is None:
47 48 return "__%s_map[%s]" % (handle.name, value)
48 49 else:
@@ -50,24 +51,24 @@ def handle_entry(handle, value):
50 51 return "__%s_map[%s][%s]" % (handle.name, key_name, value)
51 52
52 53
53   -class ValueExtractor(stdapi.Visitor):
  54 +class ValueDeserializer(stdapi.Visitor):
54 55
55   - def visit_literal(self, literal, lvalue, rvalue):
  56 + def visitLiteral(self, literal, lvalue, rvalue):
56 57 print ' %s = (%s).to%s();' % (lvalue, rvalue, literal.kind)
57 58
58   - def visit_const(self, const, lvalue, rvalue):
  59 + def visitConst(self, const, lvalue, rvalue):
59 60 self.visit(const.type, lvalue, rvalue)
60 61
61   - def visit_alias(self, alias, lvalue, rvalue):
  62 + def visitAlias(self, alias, lvalue, rvalue):
62 63 self.visit(alias.type, lvalue, rvalue)
63 64
64   - def visit_enum(self, enum, lvalue, rvalue):
  65 + def visitEnum(self, enum, lvalue, rvalue):
65 66 print ' %s = (%s).toSInt();' % (lvalue, rvalue)
66 67
67   - def visit_bitmask(self, bitmask, lvalue, rvalue):
  68 + def visitBitmask(self, bitmask, lvalue, rvalue):
68 69 self.visit(bitmask.type, lvalue, rvalue)
69 70
70   - def visit_array(self, array, lvalue, rvalue):
  71 + def visitArray(self, array, lvalue, rvalue):
71 72 print ' const trace::Array *__a%s = dynamic_cast<const trace::Array *>(&%s);' % (array.tag, rvalue)
72 73 print ' if (__a%s) {' % (array.tag)
73 74 length = '__a%s->values.size()' % array.tag
@@ -82,7 +83,7 @@ def visit_array(self, array, lvalue, rvalue):
82 83 print ' %s = NULL;' % lvalue
83 84 print ' }'
84 85
85   - def visit_pointer(self, pointer, lvalue, rvalue):
  86 + def visitPointer(self, pointer, lvalue, rvalue):
86 87 print ' const trace::Array *__a%s = dynamic_cast<const trace::Array *>(&%s);' % (pointer.tag, rvalue)
87 88 print ' if (__a%s) {' % (pointer.tag)
88 89 print ' %s = new %s;' % (lvalue, pointer.type)
@@ -93,46 +94,48 @@ def visit_pointer(self, pointer, lvalue, rvalue):
93 94 print ' %s = NULL;' % lvalue
94 95 print ' }'
95 96
96   - def visit_handle(self, handle, lvalue, rvalue):
97   - OpaqueValueExtractor().visit(handle.type, lvalue, rvalue);
98   - new_lvalue = handle_entry(handle, lvalue)
  97 + def visitHandle(self, handle, lvalue, rvalue):
  98 + OpaqueValueDeserializer().visit(handle.type, lvalue, rvalue);
  99 + new_lvalue = lookupHandle(handle, lvalue)
99 100 print ' if (retrace::verbosity >= 2) {'
100 101 print ' std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue)
101 102 print ' }'
102 103 print ' %s = %s;' % (lvalue, new_lvalue)
103 104
104   - def visit_blob(self, blob, lvalue, rvalue):
  105 + def visitBlob(self, blob, lvalue, rvalue):
105 106 print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, blob, rvalue)
106 107
107   - def visit_string(self, string, lvalue, rvalue):
  108 + def visitString(self, string, lvalue, rvalue):
108 109 print ' %s = (%s)((%s).toString());' % (lvalue, string.expr, rvalue)
109 110
110 111
111   -class OpaqueValueExtractor(ValueExtractor):
  112 +class OpaqueValueDeserializer(ValueDeserializer):
112 113 '''Value extractor that also understands opaque values.
113 114
114 115 Normally opaque values can't be retraced, unless they are being extracted
115 116 in the context of handles.'''
116 117
117   - def visit_opaque(self, opaque, lvalue, rvalue):
  118 + def visitOpaque(self, opaque, lvalue, rvalue):
118 119 print ' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, opaque, rvalue)
119 120
120 121
121   -class ValueWrapper(stdapi.Visitor):
  122 +class SwizzledValueRegistrator(stdapi.Visitor):
  123 + '''Type visitor which will register (un)swizzled value pairs, to later be
  124 + swizzled.'''
122 125
123   - def visit_literal(self, literal, lvalue, rvalue):
  126 + def visitLiteral(self, literal, lvalue, rvalue):
124 127 pass
125 128
126   - def visit_alias(self, alias, lvalue, rvalue):
  129 + def visitAlias(self, alias, lvalue, rvalue):
127 130 self.visit(alias.type, lvalue, rvalue)
128 131
129   - def visit_enum(self, enum, lvalue, rvalue):
  132 + def visitEnum(self, enum, lvalue, rvalue):
130 133 pass
131 134
132   - def visit_bitmask(self, bitmask, lvalue, rvalue):
  135 + def visitBitmask(self, bitmask, lvalue, rvalue):
133 136 pass
134 137
135   - def visit_array(self, array, lvalue, rvalue):
  138 + def visitArray(self, array, lvalue, rvalue):
136 139 print ' const trace::Array *__a%s = dynamic_cast<const trace::Array *>(&%s);' % (array.tag, rvalue)
137 140 print ' if (__a%s) {' % (array.tag)
138 141 length = '__a%s->values.size()' % array.tag
@@ -144,7 +147,7 @@ def visit_array(self, array, lvalue, rvalue):
144 147 print ' }'
145 148 print ' }'
146 149
147   - def visit_pointer(self, pointer, lvalue, rvalue):
  150 + def visitPointer(self, pointer, lvalue, rvalue):
148 151 print ' const trace::Array *__a%s = dynamic_cast<const trace::Array *>(&%s);' % (pointer.tag, rvalue)
149 152 print ' if (__a%s) {' % (pointer.tag)
150 153 try:
@@ -152,12 +155,12 @@ def visit_pointer(self, pointer, lvalue, rvalue):
152 155 finally:
153 156 print ' }'
154 157
155   - def visit_handle(self, handle, lvalue, rvalue):
  158 + def visitHandle(self, handle, lvalue, rvalue):
156 159 print ' %s __orig_result;' % handle.type
157   - OpaqueValueExtractor().visit(handle.type, '__orig_result', rvalue);
  160 + OpaqueValueDeserializer().visit(handle.type, '__orig_result', rvalue);
158 161 if handle.range is None:
159 162 rvalue = "__orig_result"
160   - entry = handle_entry(handle, rvalue)
  163 + entry = lookupHandle(handle, rvalue)
161 164 print " %s = %s;" % (entry, lvalue)
162 165 print ' if (retrace::verbosity >= 2) {'
163 166 print ' std::cout << "{handle.name} " << {rvalue} << " -> " << {lvalue} << "\\n";'.format(**locals())
@@ -166,7 +169,7 @@ def visit_handle(self, handle, lvalue, rvalue):
166 169 i = '__h' + handle.tag
167 170 lvalue = "%s + %s" % (lvalue, i)
168 171 rvalue = "__orig_result + %s" % (i,)
169   - entry = handle_entry(handle, rvalue)
  172 + entry = lookupHandle(handle, rvalue)
170 173 print ' for ({handle.type} {i} = 0; {i} < {handle.range}; ++{i}) {{'.format(**locals())
171 174 print ' {entry} = {lvalue};'.format(**locals())
172 175 print ' if (retrace::verbosity >= 2) {'
@@ -174,22 +177,22 @@ def visit_handle(self, handle, lvalue, rvalue):
174 177 print ' }'
175 178 print ' }'
176 179
177   - def visit_blob(self, blob, lvalue, rvalue):
  180 + def visitBlob(self, blob, lvalue, rvalue):
178 181 pass
179 182
180   - def visit_string(self, string, lvalue, rvalue):
  183 + def visitString(self, string, lvalue, rvalue):
181 184 pass
182 185
183 186
184 187 class Retracer:
185 188
186   - def retrace_function(self, function):
  189 + def retraceFunction(self, function):
187 190 print 'static void retrace_%s(trace::Call &call) {' % function.name
188   - self.retrace_function_body(function)
  191 + self.retraceFunctionBody(function)
189 192 print '}'
190 193 print
191 194
192   - def retrace_function_body(self, function):
  195 + def retraceFunctionBody(self, function):
193 196 if not function.sideeffects:
194 197 print ' (void)call;'
195 198 return
@@ -202,48 +205,52 @@ def retrace_function_body(self, function):
202 205 rvalue = 'call.arg(%u)' % (arg.index,)
203 206 lvalue = arg.name
204 207 try:
205   - self.extract_arg(function, arg, arg_type, lvalue, rvalue)
  208 + self.extractArg(function, arg, arg_type, lvalue, rvalue)
206 209 except NotImplementedError:
207 210 success = False
208 211 print ' %s = 0; // FIXME' % arg.name
209 212 if not success:
210 213 print ' if (1) {'
211   - self.fail_function(function)
  214 + self.failFunction(function)
212 215 print ' }'
213   - self.call_function(function)
  216 + self.invokeFunction(function)
214 217 for arg in function.args:
215 218 if arg.output:
216 219 arg_type = ConstRemover().visit(arg.type)
217 220 rvalue = 'call.arg(%u)' % (arg.index,)
218 221 lvalue = arg.name
219 222 try:
220   - ValueWrapper().visit(arg_type, lvalue, rvalue)
  223 + self.regiterSwizzledValue(arg_type, lvalue, rvalue)
221 224 except NotImplementedError:
222 225 print ' // XXX: %s' % arg.name
223 226 if function.type is not stdapi.Void:
224 227 rvalue = '*call.ret'
225 228 lvalue = '__result'
226 229 try:
227   - ValueWrapper().visit(function.type, lvalue, rvalue)
  230 + self.regiterSwizzledValue(function.type, lvalue, rvalue)
228 231 except NotImplementedError:
229 232 print ' // XXX: result'
230 233 if not success:
231 234 if function.name[-1].islower():
232 235 sys.stderr.write('warning: unsupported %s call\n' % function.name)
233 236
234   - def fail_function(self, function):
  237 + def failFunction(self, function):
235 238 print ' if (retrace::verbosity >= 0) {'
236 239 print ' retrace::unsupported(call);'
237 240 print ' }'
238 241 print ' return;'
239 242
240   - def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
241   - ValueExtractor().visit(arg_type, lvalue, rvalue)
  243 + def extractArg(self, function, arg, arg_type, lvalue, rvalue):
  244 + ValueDeserializer().visit(arg_type, lvalue, rvalue)
242 245
243   - def extract_opaque_arg(self, function, arg, arg_type, lvalue, rvalue):
244   - OpaqueValueExtractor().visit(arg_type, lvalue, rvalue)
  246 + def extractOpaqueArg(self, function, arg, arg_type, lvalue, rvalue):
  247 + OpaqueValueDeserializer().visit(arg_type, lvalue, rvalue)
245 248
246   - def call_function(self, function):
  249 + def regiterSwizzledValue(self, type, lvalue, rvalue):
  250 + visitor = SwizzledValueRegistrator()
  251 + visitor.visit(type, lvalue, rvalue)
  252 +
  253 + def invokeFunction(self, function):
247 254 arg_names = ", ".join([arg.name for arg in function.args])
248 255 if function.type is not stdapi.Void:
249 256 print ' %s __result;' % (function.type)
@@ -252,16 +259,16 @@ def call_function(self, function):
252 259 else:
253 260 print ' %s(%s);' % (function.name, arg_names)
254 261
255   - def filter_function(self, function):
  262 + def filterFunction(self, function):
256 263 return True
257 264
258 265 table_name = 'retrace::callbacks'
259 266
260   - def retrace_functions(self, functions):
261   - functions = filter(self.filter_function, functions)
  267 + def retraceFunctions(self, functions):
  268 + functions = filter(self.filterFunction, functions)
262 269
263 270 for function in functions:
264   - self.retrace_function(function)
  271 + self.retraceFunction(function)
265 272
266 273 print 'const retrace::Entry %s[] = {' % self.table_name
267 274 for function in functions:
@@ -271,7 +278,7 @@ def retrace_functions(self, functions):
271 278 print
272 279
273 280
274   - def retrace_api(self, api):
  281 + def retraceApi(self, api):
275 282
276 283 print '#include "trace_parser.hpp"'
277 284 print '#include "retrace.hpp"'
@@ -290,5 +297,5 @@ def retrace_api(self, api):
290 297 handle_names.add(handle.name)
291 298 print
292 299
293   - self.retrace_functions(api.functions)
  300 + self.retraceFunctions(api.functions)
294 301
30 scripts/jsondiff.py
@@ -44,19 +44,19 @@ class Visitor:
44 44
45 45 def visit(self, node, *args, **kwargs):
46 46 if isinstance(node, dict):
47   - return self.visit_object(node, *args, **kwargs)
  47 + return self.visitObject(node, *args, **kwargs)
48 48 elif isinstance(node, list):
49   - return self.visit_array(node, *args, **kwargs)
  49 + return self.visitArray(node, *args, **kwargs)
50 50 else:
51   - return self.visit_value(node, *args, **kwargs)
  51 + return self.visitValue(node, *args, **kwargs)
52 52
53   - def visit_object(self, node, *args, **kwargs):
  53 + def visitObject(self, node, *args, **kwargs):
54 54 pass
55 55
56   - def visit_array(self, node, *args, **kwargs):
  56 + def visitArray(self, node, *args, **kwargs):
57 57 pass
58 58
59   - def visit_value(self, node, *args, **kwargs):
  59 + def visitValue(self, node, *args, **kwargs):
60 60 pass
61 61
62 62
@@ -75,7 +75,7 @@ def _indent(self):
75 75 def _newline(self):
76 76 self._write('\n')
77 77
78   - def visit_object(self, node):
  78 + def visitObject(self, node):
79 79 self.enter_object()
80 80
81 81 members = node.keys()
@@ -109,7 +109,7 @@ def leave_object(self):
109 109 if self.level <= 0:
110 110 self._newline()
111 111
112   - def visit_array(self, node):
  112 + def visitArray(self, node):
113 113 self.enter_array()
114 114 for i in range(len(node)):
115 115 value = node[i]
@@ -130,7 +130,7 @@ def leave_array(self):
130 130 self._indent()
131 131 self._write(']')
132 132
133   - def visit_value(self, node):
  133 + def visitValue(self, node):
134 134 self._write(json.dumps(node))
135 135
136 136
@@ -141,7 +141,7 @@ def __init__(self, ignore_added = False, tolerance = 2.0 ** -24):
141 141 self.ignore_added = ignore_added
142 142 self.tolerance = tolerance
143 143
144   - def visit_object(self, a, b):
  144 + def visitObject(self, a, b):
145 145 if not isinstance(b, dict):
146 146 return False
147 147 if len(a) != len(b) and not self.ignore_added:
@@ -162,7 +162,7 @@ def visit_object(self, a, b):
162 162 return False
163 163 return True
164 164
165   - def visit_array(self, a, b):
  165 + def visitArray(self, a, b):
166 166 if not isinstance(b, list):
167 167 return False
168 168 if len(a) != len(b):
@@ -172,7 +172,7 @@ def visit_array(self, a, b):
172 172 return False
173 173 return True
174 174
175   - def visit_value(self, a, b):
  175 + def visitValue(self, a, b):
176 176 if isinstance(a, float) or isinstance(b, float):
177 177 if a == 0:
178 178 return abs(b) < self.tolerance
@@ -193,7 +193,7 @@ def visit(self, a, b):
193 193 return
194 194 Visitor.visit(self, a, b)
195 195
196   - def visit_object(self, a, b):
  196 + def visitObject(self, a, b):
197 197 if not isinstance(b, dict):
198 198 self.replace(a, b)
199 199 else:
@@ -215,7 +215,7 @@ def visit_object(self, a, b):
215 215
216 216 self.dumper.leave_object()
217 217
218   - def visit_array(self, a, b):
  218 + def visitArray(self, a, b):
219 219 if not isinstance(b, list):
220 220 self.replace(a, b)
221 221 else:
@@ -241,7 +241,7 @@ def visit_array(self, a, b):
241 241
242 242 self.dumper.leave_array()
243 243
244   - def visit_value(self, a, b):
  244 + def visitValue(self, a, b):
245 245 if a != b:
246 246 self.replace(a, b)
247 247
2  specs/cglapi.py
@@ -182,7 +182,7 @@
182 182
183 183 cglapi = API("CGL")
184 184
185   -cglapi.add_functions([
  185 +cglapi.addFunctions([
186 186 # CGLCurrent.h, libGL.dylib
187 187 Function(CGLError, "CGLSetCurrentContext", [(CGLContextObj, "ctx")]),
188 188 Function(CGLContextObj, "CGLGetCurrentContext", []),
2  specs/d3d.py
@@ -471,5 +471,5 @@ def OutPointer(type):
471 471 IDirect3D7,
472 472 ]
473 473
474   -ddraw.add_interfaces(interfaces)
  474 +ddraw.addInterfaces(interfaces)
475 475
2  specs/d3d10misc.py
@@ -47,7 +47,7 @@
47 47
48 48
49 49 d3d10 = API("d3d10")
50   -d3d10.add_functions([
  50 +d3d10.addFunctions([
51 51 StdFunction(HRESULT, "D3D10CreateDevice", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (UINT, "SDKVersion"), Out(Pointer(Pointer(ID3D10Device)), "ppDevice")]),
52 52 StdFunction(HRESULT, "D3D10CreateDeviceAndSwapChain", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), Out(Pointer(Pointer(IDXGISwapChain)), "ppSwapChain"), Out(Pointer(Pointer(ID3D10Device)), "ppDevice")]),
53 53 StdFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), Out(Pointer(LPD3D10BLOB), "ppBuffer")]),
2  specs/d3d8.py
@@ -277,6 +277,6 @@
277 277 ]
278 278
279 279 d3d8 = API("d3d8")
280   -d3d8.add_functions([
  280 +d3d8.addFunctions([
281 281 StdFunction(PDIRECT3D8, "Direct3DCreate8", [(UINT, "SDKVersion")]),
282 282 ])
2  specs/d3d9.py
@@ -437,7 +437,7 @@
437 437 ]
438 438
439 439 d3d9 = API("d3d9")
440   -d3d9.add_functions([
  440 +d3d9.addFunctions([
441 441 StdFunction(PDIRECT3D9, "Direct3DCreate9", [(UINT, "SDKVersion")], fail='NULL'),
442 442 StdFunction(HRESULT, "Direct3DCreate9Ex", [(UINT, "SDKVersion"), Out(Pointer(PDIRECT3D9EX), "ppD3D")], fail='D3DERR_NOTAVAILABLE'),
443 443 StdFunction(Int, "D3DPERF_BeginEvent", [(D3DCOLOR, "col"), (LPCWSTR, "wszName")], fail='-1'),
6 specs/d3d9types.py
<
@@ -405,7 +405,7 @@
405 405 ])
406 406
407 407 D3DRENDERSTATETYPE = Enum("D3DRENDERSTATETYPE", [
408   - expr for expr, types in D3DRENDERSTATEVALUE.switch_types
  408 + expr for expr, types in D3DRENDERSTATEVALUE.switchTypes
409 409 ])
410 410
411 411 D3DTSS_TCI = Flags(DWORD, [
@@ -490,7 +490,7 @@
490 490 ])
491 491
492 492 D3DTEXTURESTAGESTATETYPE = Enum("D3DTEXTURESTAGESTATETYPE", [
493   - expr for expr, types in D3DTEXTURESTAGESTATEVALUE.switch_types
  493 + expr for expr, types in D3DTEXTURESTAGESTATEVALUE.switchTypes
494 494 ])
495 495