Exemple #1
0
def PrintProto(func_name,f,no_special):
	if no_special == 1:
		if apiutil.FindSpecial( "packertest", func_name ):
			return

	if not allfuncs:
		if not apiutil.HasPackOpcode(func_name):
			return

	pointers_ok = 0

	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)

	if "Chromium" == apiutil.Category(func_name):
		is_extended = 1
	else:
		is_extended = 0

	if is_extended:
		f.write( "gl%s gl%s_func = (gl%s_t)crGetProcAddress(\"gl%s\");\n" % (func_name,func_name,func_name,func_name))

	if return_type != 'void':
		# Yet another gross hack for glGetString
		if string.find( return_type, '*' ) == -1:
			return_type = return_type + " *"

	#if "get" in apiutil.Properties(func_name):
			#pointers_ok = 1

	if func_name == 'Writeback':
		pointers_ok = 1

	f.write( 'void crPackTest%s (void);\n' % func_name)
Exemple #2
0
def PrintBodies(func_name,f,no_special, gentables):
	#print "func_name = %s  no_special = %d" % (func_name, no_special)
	if no_special == 1:
		if apiutil.FindSpecial( "packertest", func_name ):
			return

	if not allfuncs:
		if not apiutil.HasPackOpcode(func_name):
			return

	pointers_ok = 0

	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)

	if "get" in apiutil.Properties(func_name):
		pointers_ok = 1

	if func_name == 'Writeback':
		pointers_ok = 1

	#print "func_name = %s pointers_ok = %d no_special = %d" % (func_name, pointers_ok,no_special)
	#print params
	if gentables == 1:
		PrintTableFunc( func_name, params, pointers_ok ,f)
	else:
		PrintFunc( func_name, params, pointers_ok ,f)
Exemple #3
0
def PrintDynProto(func_name, f):
	if apiutil.FindSpecial( "packertest", func_name ):
		return

	if not allfuncs:
		if not apiutil.HasPackOpcode(func_name):
			return

	pointers_ok = 0
	params = apiutil.Parameters(func_name)

	if "Chromium" ==  apiutil.Category(func_name):
		is_extended = 1
	else:
		is_extended = 0

	if is_extended:
		f.write( "typedef %s (APIENTRY *gl%s_t) (%s);\n" % (return_type,func_name,apiutil.MakeDeclarationString(params)))
		f.write( "static gl%s_t %s_func;\n" % (func_name,func_name))
Exemple #4
0
/* For each of the OpenGL functions we have a packer function which
 * packs the function's opcode and arguments into a buffer.
 */

#include "packer.h"
#include "cr_opcodes.h"

""")

keys = apiutil.GetDispatchedFunctions(sys.argv[1] + "/APIspec.txt")

for func_name in keys:
    if apiutil.FindSpecial("packer", func_name):
        continue

    if not apiutil.HasPackOpcode(func_name):
        continue

    pointers_ok = 0

    return_type = apiutil.ReturnType(func_name)
    params = apiutil.Parameters(func_name)

    if return_type != 'void':
        # Yet another gross hack for glGetString
        if return_type.find('*') == -1:
            return_type = return_type + " *"
        params.append(("return_value", return_type, 0))

    if "get" in apiutil.Properties(func_name):
        pointers_ok = 1