예제 #1
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)
예제 #2
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)
예제 #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))
예제 #4
0
#else
#define PACK_APIENTRY
#endif

#ifdef __cplusplus
extern "C" {
#endif
"""

keys = apiutil.GetDispatchedFunctions()

for func_name in keys:
    if ("pack" in apiutil.ChromiumProps(func_name)
            or "extpack" in apiutil.ChromiumProps(func_name)
            or apiutil.NonVectorFunction(func_name) != ''
            or apiutil.FindSpecial('packer', func_name)):

        # OK, generate a crPackFooBar() prototype for this function
        return_type = apiutil.ReturnType(func_name)
        args = apiutil.Parameters(func_name)
        if return_type != 'void':
            if apiutil.IsPointer(return_type):
                args.append(("return_value", return_type, 0))
            else:
                args.append(("return_value", return_type + "*", 0))
        elif "pixelstore" in apiutil.Properties(func_name):
            args.append(("packstate", "const CRPixelPackState *", 0))

        if "get" in apiutil.Properties(func_name):
            args.append(("writeback", "int *", 0))
예제 #5
0
		cat == "1.2" or
		cat == "Chromium" or
		cat == "GL_chromium"):
		return ''
	elif cat[0] =='1':
		# i.e. OpenGL 1.3 or 1.4 or 1.5
		return "OPENGL_VERSION_" + string.replace(cat, ".", "_")
	else:
		assert cat != ''
		return string.replace(cat, "GL_", "")



for func_name in apiutil.AllSpecials( "../state_tracker/state" ):
	params = apiutil.Parameters(func_name)
	if (apiutil.FindSpecial( "server", func_name ) or
		"get" in apiutil.Properties(func_name)):
		continue

	wrap = GetTestWrapper(func_name)
	if wrap:
		print '#if defined(CR_%s)' % wrap
	print 'void SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % ( func_name, apiutil.MakeDeclarationString( params ) )
	print '{'
	print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString( params ) )
	print '\tcr_server.head_spu->dispatch_table.%s( %s );' % (func_name, apiutil.MakeCallString( params ) )
	print '}'
	if wrap:
		print '#endif'

예제 #6
0
#include "state/cr_statetypes.h"
#include "nopspu.h"
#include "cr_mem.h"

#if defined(WINDOWS)
#define NOP_APIENTRY __stdcall
#else
#define NOP_APIENTRY
#endif

#define NOP_UNUSED(x) ((void)x)"""

keys = apiutil.GetDispatchedFunctions("../../glapi_parser/APIspec.txt")

for func_name in keys:
    if not (apiutil.FindSpecial("nop", func_name)
            or "get" in apiutil.Properties(func_name)):
        return_type = apiutil.ReturnType(func_name)
        params = apiutil.Parameters(func_name)
        print '\nstatic %s NOP_APIENTRY nop%s( %s )' % (
            return_type, func_name, apiutil.MakeDeclarationString(params))
        print '{'
        # Handle the void parameter list
        for (name, type, vecSize) in params:
            print '\tNOP_UNUSED(%s);' % name

        if return_type != "void":
            print '\treturn (%s)0;' % return_type
        print '}'

print """
예제 #7
0
print("""
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_dispatch.py SCRIPT */
#include "cr_spu.h"
#include "chromium.h"
#include "cr_error.h"
#include "server_dispatch.h"
#include "server.h"
#include "cr_unpack.h"

CRCurrentStatePointers crServerCurrent;
""")

for func_name in apiutil.AllSpecials(sys.argv[1] + "/../state_tracker/state"):
    params = apiutil.Parameters(func_name)
    if (apiutil.FindSpecial("server", func_name)
            or "get" in apiutil.Properties(func_name)):
        continue

    wrap = apiutil.GetCategoryWrapper(func_name)
    if wrap:
        print('#if defined(CR_%s)' % wrap)
    print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' %
          (func_name, apiutil.MakeDeclarationString(params)))
    print('{')
    print('\tcrState%s(%s);' % (func_name, apiutil.MakeCallString(params)))
    print('\tcr_server.head_spu->dispatch_table.%s(%s);' %
          (func_name, apiutil.MakeCallString(params)))
    print('}')
    if wrap:
        print('#endif')
예제 #8
0
                print(",", end=" ")
        print(");")
        print("#endif")
    else:
        print("\tpState->pDispatchTbl->%s((%s) pState->pbUnpackData);" %
              (vec_func, vecType))


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

#
# Generate unpack functions for all the simple functions.
#
for func_name in keys:
    if (not "pack" in apiutil.ChromiumProps(func_name)
            or apiutil.FindSpecial("unpacker", func_name)):
        continue

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

    packet_length = apiutil.PacketLength(params)
    print("static void crUnpack%s(PCrUnpackerState pState)" % func_name)
    print("{")
    if ("get" in apiutil.Properties(func_name)):
        print("\tCHECK_BUFFER_SIZE_STATIC(pState, %s);" %
              getWritebackPointerOffset(return_type, params))
    elif packet_length != 0:
        print("\tCHECK_BUFFER_SIZE_STATIC(pState, %s);" % packet_length)

    vector_func = apiutil.VectorFunction(func_name)
예제 #9
0
#include "cr_string.h"
#include "cr_spu.h"
#include "packspu.h"
#include "cr_packfunctions.h"
"""

pack_specials = []

keys = apiutil.GetDispatchedFunctions("../glapi_parser/APIspec.txt")

# make list of special functions
## VMGL: Because of state resume, a few more functions have specialized
## implementations by the new autogen script
for func_name in keys:
    if ("get" in apiutil.Properties(func_name)
            or apiutil.FindSpecial("packspu", func_name)
            or apiutil.FindSpecial("packspu_flush", func_name)
            or apiutil.FindSpecial("packspu_vertex", func_name)
            or apiutil.CanCompile(func_name)
            or apiutil.SetsTrackedState(func_name)):

        pack_specials.append(func_name)

for func_name in keys:
    if apiutil.FindSpecial("packspu_unimplemented", func_name):
        continue
    if func_name in pack_specials:
        return_type = apiutil.ReturnType(func_name)
        params = apiutil.Parameters(func_name)
        print 'extern %s PACKSPU_APIENTRY packspu_%s( %s );' % (
            return_type, func_name, apiutil.MakeDeclarationString(params))
예제 #10
0
keys = apiutil.GetDispatchedFunctions("../../glapi_parser/APIspec.txt")


apiutil.CopyrightC()

print """
#include <stdio.h>
#include "cr_server.h"
#include "cr_packfunctions.h"
#include "replicatespu.h"
"""

for func_name in keys:
	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)
	if (apiutil.FindSpecial( "replicatespu_state", func_name ) or apiutil.FindSpecial( "replicatespu_get", func_name)):
		print 'extern %s REPLICATESPU_APIENTRY replicatespu_%s( %s );' % ( return_type, func_name, apiutil.MakeDeclarationString( params ) )

for func_name in keys:
	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)
	if (apiutil.FindSpecial( "replicatespu_state", func_name ) or apiutil.FindSpecial( "replicatespu_get", func_name)):
		print '%s REPLICATESPU_APIENTRY replicatespu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString( params ) )
		print '{'
		if apiutil.FindSpecial( "replicatespu_state", func_name ):
			print '\tif (replicate_spu.swap)'
			print '\t{'
			print '\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ) )
			print '\t}'
			print '\telse'
			print '\t{'
예제 #11
0
파일: diffapi.py 프로젝트: raptoravis/cr19
    print '\t\tcrPack%sSWAP( %s );' % (func_name,
                                       apiutil.MakeCallString(params))
    print '\t}'
    print '\telse'
    print '\t{'
    print '\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString(params))
    print '\t}'
    print '}'

print """
void replicatespuCreateDiffAPI( void )
{
"""

for func_name in keys:
    props = apiutil.Properties(func_name)

    if "get" in props:
        print '\treplicate_spu.diff_dispatch.%s = NULL;' % func_name
    elif apiutil.FindSpecial("replicatespu_diff", func_name):
        print '\treplicate_spu.diff_dispatch.%s = crState%s;' % (func_name,
                                                                 func_name)
    elif apiutil.FindSpecial("replicatespu_pixel", func_name):
        print '\treplicate_spu.diff_dispatch.%s = replicatespu_Diff%s;' % (
            func_name, func_name)
    else:
        print '\treplicate_spu.diff_dispatch.%s = (replicate_spu.swap ? crPack%sSWAP : crPack%s);' % (
            func_name, func_name, func_name)
print '\tcrStateDiffAPI( &replicate_spu.diff_dispatch );'
print '}'
예제 #12
0
#include "cr_packfunctions.h"
#include "replicatespu.h"
#include "cr_dlm.h"
#include "replicatespu_proto.h"

/* DO NOT EDIT.  This code is generated by replicatespu_generate.py. */
"""

lastWasComment = 0
for func_name in keys:
    return_type = apiutil.ReturnType(func_name)
    chromiumProps = apiutil.ChromiumProps(func_name)
    params = apiutil.Parameters(func_name)

    # Skip this function if we have a non-generated implementation
    if apiutil.FindSpecial("replicate", func_name):
        print '/* %s not generated: special implementation exists */' % func_name
        lastWasComment = 1
        continue

    # Also skip this function if there's a trivial implementation
    # (i.e. one that degenerates to solely the use of crPack functions)

    # Otherwise, generate the function body.

    # The outgoing call string is based on the parameters.  State-based
    # functions and pixelstore-based functions will require extended
    # call strings.
    basicCallString = apiutil.MakeCallString(params)
    needDL = 0
    needThread = 0
예제 #13
0
elif mode == 'header':
    pass
else:
    raise "unknown generation mode '%s'" % mode

for func_name in keys:
    return_type = apiutil.ReturnType(func_name)
    chromiumProps = apiutil.ChromiumProps(func_name)
    params = apiutil.Parameters(func_name)
    declarationString = apiutil.MakeDeclarationString(params)
    basicCallString = apiutil.MakeCallString(params)

    # These functions will never appear in a display list (they
    # are expanded into other function calls while they're being
    # compiled), so we need not implement them.
    if apiutil.FindSpecial("tilesort_dlpack_ignore", func_name):
        if mode == 'source':
            print '/* %s not generated: ignored */' % func_name
            lastWasComment = 1
        elif mode == 'table':
            print '\tt->%s = NULL;' % (func_name)
        elif mode == 'header':
            pass
        continue

    # Two special functions that are not compilable but are still
    # required for display list creation exist; we have to make sure
    # their pack versions end up in the pack dispatch table.
    if func_name in ['NewList', 'EndList']:
        if mode == 'table':
            print '\tt->%s = tilesort_spu.swap ? crPack%sSWAP : crPack%s;' % (
예제 #14
0
    'GetTexEnviv': 'SWAP32',
    'GetTexGendv': 'SWAPDOUBLE',
    'GetTexGenfv': 'SWAPFLOAT',
    'GetTexGeniv': 'SWAP32',
    'GetTexLevelParameterfv': 'SWAPFLOAT',
    'GetTexLevelParameteriv': 'SWAP32',
    'GetTexParameterfv': 'SWAPFLOAT',
    'GetTexParameteriv': 'SWAP32'
}

keys = apiutil.GetDispatchedFunctions("../../glapi_parser/APIspec.txt")

for func_name in keys:
    params = apiutil.Parameters(func_name)
    return_type = apiutil.ReturnType(func_name)
    if apiutil.FindSpecial("packspu", func_name):
        continue

    if "get" in apiutil.Properties(func_name):
        print '%s PACKSPU_APIENTRY packspu_%s( %s )' % (
            return_type, func_name, apiutil.MakeDeclarationString(params))
        print '{'
        print '\tGET_THREAD(thread);'
        print '\tint writeback = 1;'
        if return_type != 'void':
            print '\t%s return_val = (%s) 0;' % (return_type, return_type)
            params.append(("&return_val", "foo", 0))
        if (func_name in easy_swaps.keys() and easy_swaps[func_name] != '0'
            ) or func_name in simple_funcs or func_name in hard_funcs.keys():
            print '\tunsigned int i;'
        print '\tif (!(pack_spu.thread[0].netServer.conn->actual_network))'
예제 #15
0
keys = apiutil.GetDispatchedFunctions("../glapi_parser/APIspec.txt")

## This will generate a heap of new code. What we basically will do is
## annotate everything with the appropriate DLM calls. If necessary we
## will also keep track of state, to later diff and obtain it during
## OpengGL state resume. Depending on the function properties we will
## pack and ship, and writebak and obtain return vals.

for func_name in keys:
    # Precomp some useful tidbits
    return_type = apiutil.ReturnType(func_name)
    chromiumProps = apiutil.ChromiumProps(func_name)
    params = apiutil.Parameters(func_name)

    # Skip this function if we have a specialized implementation
    if apiutil.FindSpecial("packspu", func_name) or apiutil.FindSpecial(
            "packspu_vertex", func_name):
        continue

    if "get" in apiutil.Properties(func_name):
        continue

    # Ok, need to find out more about this function. Apiutil to our rescue

    # Initialize
    functionCouldDL = 0
    functionUsesClientState = 0
    functionTracksState = 0
    functionPacks = apiutil.CanPack(func_name)
    functionFlushes = 0
    functionReadsBack = 0
예제 #16
0
apiutil.CopyrightC()

print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY expando.py SCRIPT */
#include <stdio.h>
#include "cr_error.h"
#include "cr_spu.h"
#include "cr_dlm.h"
#include "expandospu.h"
"""

allFunctions = []
generatedFunctions = []

for func_name in apiutil.GetDispatchedFunctions(sys.argv[1] + "/APIspec.txt"):
    if apiutil.FindSpecial("expando", func_name):
        allFunctions.append(func_name)
    elif apiutil.CanCompile(func_name) or apiutil.SetsClientState(func_name):
        generatedFunctions.append(func_name)
        allFunctions.append(func_name)

for func_name in generatedFunctions:
    params = apiutil.Parameters(func_name)
    return_type = apiutil.ReturnType(func_name)
    basicCallString = apiutil.MakeCallString(params)
    declarationString = apiutil.MakeDeclarationString(params)
    dlmCallString = basicCallString
    chromiumProps = apiutil.ChromiumProps(func_name)

    needClientState = 0
    if apiutil.UsesClientState(func_name):
예제 #17
0
파일: feedback.py 프로젝트: raptoravis/cr19
/* DO NOT EDIT - generated by feedback.py */
#include <stdio.h>
#include "cr_spu.h"
#include "feedbackspu.h"
#include "feedbackspu_proto.h"
#include "cr_packfunctions.h"
#include "cr_glstate.h"

"""

keys = apiutil.GetDispatchedFunctions("../../glapi_parser/APIspec.txt")

for func_name in keys:
	return_type = apiutil.ReturnType(func_name)
	params = apiutil.Parameters(func_name)
	if apiutil.FindSpecial( "feedback", func_name ):
		print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )
		print '{'
		print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
		print '}'



print """
#define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) )
#define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) )

static void __loadFeedbackAPI( void )
{
"""
for func_name in keys:
예제 #18
0
        crFree( rb );
        return;
    }
#ifdef DEBUG_misha
    WARN(("Pending command returns value"));
#endif
    CRDBGPTR_SETZ(&cr_server.writeback_ptr);
    CRDBGPTR_SETZ(&cr_server.return_ptr);
}
""")

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

for func_name in keys:
    params = apiutil.Parameters(func_name)
    return_type = apiutil.ReturnType(func_name)
    if apiutil.FindSpecial("server", func_name):
        continue
    if "VBox" == apiutil.Category(func_name):
        continue
    if return_type != 'void':
        print('%s SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' %
              (return_type, func_name, apiutil.MakeDeclarationString(params)))
        print('{')
        print('\t%s retval;' % return_type)
        print('\tretval = cr_server.head_spu->dispatch_table.%s(%s);' %
              (func_name, apiutil.MakeCallString(params)))
        print('\tcrServerReturnValue( &retval, sizeof(retval) );')
        print('\treturn retval; /* WILL PROBABLY BE IGNORED */')
        print('}')
예제 #19
0
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.

import sys

sys.path.append( "../glapi_parser" )
import apiutil


apiutil.CopyrightC()

print """
#include "cr_server.h"
#include "feedbackspu.h"
#include "feedbackspu_proto.h"
"""

keys = apiutil.GetDispatchedFunctions("../glapi_parser/APIspec.txt")

for func_name in keys:
	if apiutil.FindSpecial( "feedback_state", func_name ):
		return_type = apiutil.ReturnType(func_name)
		params = apiutil.Parameters(func_name)
		print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
		print '{'
		print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
		print ''
		print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
		print '}'
예제 #20
0
	print '%s PACKSPU_APIENTRY packspu_Diff%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString( params ) )
	print '{'
	params.append( ('&defaultPacking', 'blah', 0) )
	print '\tif (pack_spu.swap)'
	print '\t{'
	print '\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ) )
	print '\t}'
	print '\telse'
	print '\t{'
	print '\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString( params ) )
	print '\t}'
	print '}\n'

print """
void packspuCreateDiffTable( void )
{"""

for func_name in keys:
	props = apiutil.Properties(func_name)

	if "get" in props:
		print '\tpack_spu.diff_DT.%s = NULL;' % func_name
	elif apiutil.FindSpecial( "packspu_diff", func_name ):
		print '\tpack_spu.diff_DT.%s = crState%s;' % (func_name, func_name)
	elif apiutil.FindSpecial( "packspu_diffpixel", func_name ):
		print '\tpack_spu.diff_DT.%s = packspu_Diff%s;' % (func_name, func_name)
	else:
		print '\tpack_spu.diff_DT.%s = (pack_spu.swap ? crPack%sSWAP : crPack%s);' % (func_name, func_name, func_name)
print '\tcrStateDiffAPI( &pack_spu.diff_DT );'
print '}'
예제 #21
0
print 'SPUNamedFunctionTable _cr_tilesort_table[%d];' % (num_funcs + 1)

print """
static void __fillin( int offset, char *name, SPUGenericFunction func )
{
	_cr_tilesort_table[offset].name = crStrdup( name );
	_cr_tilesort_table[offset].fn = func;
}
"""

print 'void tilesortspuCreateFunctions( void )'
print '{'
table_index = 0
# XXX NOTE: this should basically be identical to code in tilesort_lists.py
for func_name in keys:
    if apiutil.FindSpecial("tilesort", func_name):
        print '\t__fillin( %3d, "%s", (SPUGenericFunction) tilesortspu_%s );' % (
            table_index, func_name, func_name)
    elif apiutil.FindSpecial("tilesort_unimplemented", func_name):
        print '\t__fillin( %3d, "%s", (SPUGenericFunction) tilesortspu_%s );' % (
            table_index, func_name, func_name)
    elif apiutil.FindSpecial("tilesort_state", func_name):
        print '\t__fillin( %3d, "%s", (SPUGenericFunction) crState%s );' % (
            table_index, func_name, func_name)
    elif apiutil.FindSpecial("tilesort_bbox", func_name):
        print '\t__fillin( %3d, "%s", (SPUGenericFunction) (tilesort_spu.swap ? crPack%sBBOX_COUNTSWAP : crPack%sBBOX_COUNT) );' % (
            table_index, func_name, func_name, func_name)
    else:
        print '\t__fillin( %3d, "%s", (SPUGenericFunction) (tilesort_spu.swap ? crPack%sSWAP : crPack%s) );' % (
            table_index, func_name, func_name, func_name)
    table_index += 1
예제 #22
0
    'GetProgramiv', 'GetShaderiv', 'GetObjectParameterfvARB',
    'GetObjectParameterivARB', 'GetRenderbufferParameterivEXT',
    'GetFramebufferAttachmentParameterivEXT'
]

convert_bufferid = [
    'GetVertexAttribdvARB', 'GetVertexAttribdvNV', 'GetVertexAttribfvARB',
    'GetVertexAttribfvNV', 'GetVertexAttribivARB', 'GetVertexAttribivNV'
]

keys = apiutil.GetDispatchedFunctions(sys.argv[1] + "/APIspec.txt")
for func_name in keys:
    #(return_type, arg_names, arg_types) = gl_mapping[func_name]
    if ("get" in apiutil.Properties(func_name)
            and apiutil.ReturnType(func_name) == "void"
            and not apiutil.FindSpecial("server", func_name)):

        params = apiutil.Parameters(func_name)

        print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' %
              (func_name, apiutil.MakeDeclarationString(params)))
        print('{')

        lastParam = params[-1]
        assert apiutil.IsPointer(lastParam[1])
        local_argtype = apiutil.PointerType(lastParam[1])
        local_argname = 'local_%s' % lastParam[0]

        if not func_name in no_pnames:
            print('\tunsigned int cComponents = 0;')
        print('\t%s %s[%d] = { 0 };' %
예제 #23
0
    print """) {
    CRDLMContextState *state = CURRENT_STATE();
    instance->execute = executeFunc;"""

    # Add in the common code for adding the instance to the display list
    AddInstanceToList("    ")

    print '}'
    print ''

# Now generate the functions that won't use the crdlm_add_to_list utility.
# These all directly add their own instances to the current display list
# themselves, without using the crdlm_add_to_list() function.
keys = apiutil.GetDispatchedFunctions()
for func_name in keys:
    if apiutil.CanCompile(func_name):
        print "\n/*** %s ***/" % func_name
        # Auto-generate an appropriate DL function.  First, functions
        # that go into the display list but that rely on state will
        # have to have their argument strings expanded, to take pointers
        # to that appropriate state.
        if whichfile == "headers":
            wrap_struct(func_name)
        elif not apiutil.FindSpecial("dlm", func_name):
            wrap_execute(func_name)
            wrap_compile(func_name)
        # All others just pass through

if whichfile == 'headers':
    print "#endif /* _DLM_GENERATED_H */"
예제 #24
0
    print ''

# Now generate the functions that won't use the crdlm_add_to_list utility.
# These all directly add their own instances to the current display list
# themselves, without using the crdlm_add_to_list() function.
keys = apiutil.GetDispatchedFunctions(sys.argv[3] + "/APIspec.txt")
for func_name in keys:
    if apiutil.CanCompile(func_name):
        print "\n/*** %s ***/" % func_name
        # Auto-generate an appropriate DL function.  First, functions
        # that go into the display list but that rely on state will
        # have to have their argument strings expanded, to take pointers
        # to that appropriate state.
        if whichfile == "headers":
            wrap_struct(func_name)
        elif not apiutil.FindSpecial("dlm", func_name):
            wrap_execute(func_name)
            wrap_compile(func_name)

# Generate mapping between OPCODE and routines to be executed.

if whichfile == "headers":
    # Execute routine prototype needed to add static array of routines.
    print ''
    print 'struct DLMInstanceList;'
    print 'typedef void (*VBoxDLMExecuteFn)(struct DLMInstanceList *instance, SPUDispatchTable *dispatchTable);'
    print ''
    print 'extern VBoxDLMExecuteFn g_VBoxDLMExecuteFns[VBOX_DL_OPCODE_MAX];'
    print ''
else:
    print ''
예제 #25
0
    'GLclampd': ('%f', 'float'),
    'GLbitfield': ('0x%x', 'int'),
    'GLboolean': ('%s', ''),
    'GLsizei': ('%u', 'unsigned')
}

returnvalue_mapping = {
    'GLint': ('%d', 'int'),
    'GLuint': ('%u', 'unsigned'),
    'GLboolean': ('%hhd', 'char'),
}

keys = apiutil.GetDispatchedFunctions("../../glapi_parser/APIspec.txt")

for func_name in keys:
    if (apiutil.FindSpecial('printspu_unimplemented', func_name)
            or apiutil.FindSpecial('printspu', func_name)):
        continue

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

    print '\nstatic %s PRINT_APIENTRY print%s( %s )' % (
        return_type, func_name, apiutil.MakeDeclarationString(params))
    print '{'
    print '\tfprintf( print_spu.fp, "%s(' % func_name,

    printfstr = ""
    if len(params) == 0:
        argstr = ""
    else: