Changeset 43652 in vbox
- Timestamp:
- Oct 16, 2012 9:40:24 AM (12 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 2 edited
-
glapi_parser/apiutil.py (modified) (6 diffs)
-
packer/opcodes.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py
r43647 r43652 47 47 self.props = [] 48 48 self.chromium = [] 49 self.chrelopcode = -1 49 50 50 51 … … 162 163 break 163 164 165 elif tokens[0] == 'chrelopcode': 166 record.chrelopcode = int(tokens[1]) 167 164 168 else: 165 169 print 'Invalid token %s after function %s' % (tokens[0], record.name) … … 312 316 d = GetFunctionDict() 313 317 return d[funcName].chromium 318 319 def ChromiumRelOpCode(funcName): 320 """Return list of Chromium-specific properties of the named GL function.""" 321 d = GetFunctionDict() 322 return d[funcName].chrelopcode 323 314 324 315 325 def ParamProps(funcName): … … 368 378 return '' 369 379 elif (cat == '1.3' or 370 cat == '1.4' or371 cat == '1.5' or372 cat == '2.0' or373 cat == '2.1'):380 cat == '1.4' or 381 cat == '1.5' or 382 cat == '2.0' or 383 cat == '2.1'): 374 384 # i.e. OpenGL 1.3 or 1.4 or 1.5 375 385 return "OPENGL_VERSION_" + string.replace(cat, ".", "_") … … 580 590 581 591 def MakeDeclarationStringWithContext(ctx_macro_prefix, params): 582 """Same as MakeDeclarationString, but adds a context macro583 """584 585 n = len(params)586 if n == 0:587 return ctx_macro_prefix + '_ARGSINGLEDECL'588 else:589 result = MakeDeclarationString(params)590 return ctx_macro_prefix + '_ARGDECL ' + result591 #endif592 """Same as MakeDeclarationString, but adds a context macro 593 """ 594 595 n = len(params) 596 if n == 0: 597 return ctx_macro_prefix + '_ARGSINGLEDECL' 598 else: 599 result = MakeDeclarationString(params) 600 return ctx_macro_prefix + '_ARGDECL ' + result 601 #endif 592 602 #enddef 593 603 … … 639 649 'GLhandleARB': 4, 640 650 'GLcharARB': 1, 641 'uintptr_t': 4651 'uintptr_t': 4 642 652 } 643 653 -
trunk/src/VBox/GuestHost/OpenGL/packer/opcodes.py
r15532 r43652 51 51 # count up number of extended opcode commands 52 52 num_extends = 0 53 num_auto_codes = 0 53 54 for func in keys: 54 55 if "extpack" in apiutil.ChromiumProps(func): 55 56 num_extends += 1 57 if apiutil.ChromiumRelOpCode(func) < 0: 58 num_auto_codes += 1 59 60 # sanity check for compatibility breakage 61 # we currently have 304 62 if num_auto_codes != 304: 63 print >> sys.stderr, "number of auto-generated op-codes should be 304, but is " + str(num_auto_codes) 64 print >> sys.stderr, "which breaks backwards compatibility" 65 print >> sys.stderr, "if this is really what you want to do, please adjust this script" 66 print >> sys.stderr, "to handle a new auto-generated opcodes count" 67 print "#error -- num_auto_codes should be 304, but is " + str(num_auto_codes) 68 sys.exit(-1) 56 69 57 70 print "/* Functions with a return value or output parameters */" 58 71 print "typedef enum {" 59 72 73 opcode_index = 0 60 74 enum_index = 0 75 chrelopcodes = {} 61 76 for func in keys: 62 77 if "extpack" in apiutil.ChromiumProps(func): 63 78 opcodeName = apiutil.ExtendedOpcodeName(func) 79 chrelopcode = apiutil.ChromiumRelOpCode(func) 80 opcode = -1 81 if chrelopcode >= 0: 82 if not chrelopcode in chrelopcodes.keys(): 83 chrelopcodes[chrelopcode] = chrelopcode 84 else: 85 print >> sys.stderr, "non-unique chrelopcode: " + str(chrelopcode) 86 print "#error -- non-unique chrelopcode: " + str(num_auto_codes) 87 sys.exit(-1) 88 opcode = num_auto_codes + chrelopcode 89 else: 90 opcode = opcode_index 91 opcode_index = opcode_index + 1 92 64 93 if enum_index != num_extends-1: 65 print "\t%s = %d," % (opcodeName, enum_index)94 print "\t%s = %d," % (opcodeName, opcode ) 66 95 else: 67 print "\t%s = %d" % (opcodeName, enum_index)96 print "\t%s = %d" % (opcodeName, opcode ) 68 97 enum_index = enum_index + 1 69 98 print "} CRExtendOpcode;\n"
Note:
See TracChangeset
for help on using the changeset viewer.

