Index: /trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py	(revision 43651)
+++ /trunk/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py	(revision 43652)
@@ -47,4 +47,5 @@
 		self.props = []
 		self.chromium = []
+		self.chrelopcode = -1
 
 
@@ -162,4 +163,7 @@
 						break
 
+			elif tokens[0] == 'chrelopcode':
+				record.chrelopcode = int(tokens[1])
+
 			else:
 				print 'Invalid token %s after function %s' % (tokens[0], record.name)
@@ -312,4 +316,10 @@
 	d = GetFunctionDict()
 	return d[funcName].chromium
+	
+def ChromiumRelOpCode(funcName):
+	"""Return list of Chromium-specific properties of the named GL function."""
+	d = GetFunctionDict()
+	return d[funcName].chrelopcode
+	
 
 def ParamProps(funcName):
@@ -368,8 +378,8 @@
 		return ''
 	elif (cat == '1.3' or
-          cat == '1.4' or
-          cat == '1.5' or
-          cat == '2.0' or
-          cat == '2.1'):
+		  cat == '1.4' or
+		  cat == '1.5' or
+		  cat == '2.0' or
+		  cat == '2.1'):
 		# i.e. OpenGL 1.3 or 1.4 or 1.5
 		return "OPENGL_VERSION_" + string.replace(cat, ".", "_")
@@ -580,14 +590,14 @@
 
 def MakeDeclarationStringWithContext(ctx_macro_prefix, params):
-    """Same as MakeDeclarationString, but adds a context macro
-    """
-    
-    n = len(params)
-    if n == 0:
-        return ctx_macro_prefix + '_ARGSINGLEDECL'
-    else:
-        result = MakeDeclarationString(params)
-        return ctx_macro_prefix + '_ARGDECL ' + result
-    #endif
+	"""Same as MakeDeclarationString, but adds a context macro
+	"""
+	
+	n = len(params)
+	if n == 0:
+		return ctx_macro_prefix + '_ARGSINGLEDECL'
+	else:
+		result = MakeDeclarationString(params)
+		return ctx_macro_prefix + '_ARGDECL ' + result
+	#endif
 #enddef
 
@@ -639,5 +649,5 @@
 	'GLhandleARB': 4,
 	'GLcharARB': 1,
-    'uintptr_t': 4
+	'uintptr_t': 4
 }
 
Index: /trunk/src/VBox/GuestHost/OpenGL/packer/opcodes.py
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/packer/opcodes.py	(revision 43651)
+++ /trunk/src/VBox/GuestHost/OpenGL/packer/opcodes.py	(revision 43652)
@@ -51,19 +51,48 @@
 # count up number of extended opcode commands
 num_extends = 0
+num_auto_codes = 0
 for func in keys:
 	if "extpack" in apiutil.ChromiumProps(func):
 		num_extends += 1
+		if apiutil.ChromiumRelOpCode(func) < 0:
+			num_auto_codes += 1
+
+# sanity check for compatibility breakage
+# we currently have 304
+if num_auto_codes != 304:
+	print >> sys.stderr, "number of auto-generated op-codes should be 304, but is " + str(num_auto_codes)
+	print >> sys.stderr, "which breaks backwards compatibility"
+	print >> sys.stderr, "if this is really what you want to do, please adjust this script"
+	print >> sys.stderr, "to handle a new auto-generated opcodes count"
+	print "#error -- num_auto_codes should be 304, but is " + str(num_auto_codes)
+	sys.exit(-1)
 
 print "/* Functions with a return value or output parameters */"
 print "typedef enum {"
 
+opcode_index = 0
 enum_index = 0
+chrelopcodes = {}
 for func in keys:
 	if "extpack" in apiutil.ChromiumProps(func):
 		opcodeName = apiutil.ExtendedOpcodeName(func)
+		chrelopcode = apiutil.ChromiumRelOpCode(func)
+		opcode = -1
+		if chrelopcode >= 0:
+			if not chrelopcode in chrelopcodes.keys():
+				chrelopcodes[chrelopcode] = chrelopcode
+			else:
+				print >> sys.stderr, "non-unique chrelopcode: " + str(chrelopcode)
+				print "#error -- non-unique chrelopcode:  " + str(num_auto_codes)
+				sys.exit(-1)
+			opcode = num_auto_codes + chrelopcode
+		else:
+			opcode = opcode_index
+			opcode_index = opcode_index + 1
+
 		if enum_index != num_extends-1:
-			print "\t%s = %d," % (opcodeName, enum_index )
+			print "\t%s = %d," % (opcodeName, opcode )
 		else:
-			print "\t%s = %d" % (opcodeName, enum_index )
+			print "\t%s = %d" % (opcodeName, opcode )
 		enum_index = enum_index + 1
 print "} CRExtendOpcode;\n"
