diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
commit | f8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch) | |
tree | 26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py | |
parent | Initial commit. (diff) | |
download | virtualbox-upstream.tar.xz virtualbox-upstream.zip |
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py')
-rwxr-xr-x | src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py b/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py new file mode 100755 index 00000000..5742bcb0 --- /dev/null +++ b/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py @@ -0,0 +1,42 @@ +# Copyright (c) 2001, Stanford University +# All rights reserved. +# +# See the file LICENSE.txt for information on redistributing this software. + +from __future__ import print_function +import sys + +import apiutil + + +apiutil.CopyrightC() + +print(""" +/* DO NOT EDIT - this file generated by packspu_flush.py script */ + +/* These are otherwise ordinary functions which require that the buffer be + * flushed immediately after packing the function. + */ +#include "cr_glstate.h" +#include "cr_packfunctions.h" +#include "packspu.h" +#include "packspu_proto.h" +""") + +keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") + +for func_name in apiutil.AllSpecials( "packspu_flush" ): + params = apiutil.Parameters(func_name) + print('void PACKSPU_APIENTRY packspu_%s(%s)' % ( func_name, apiutil.MakeDeclarationString(params))) + print('{') + print('\tGET_THREAD(thread);') + 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('\tpackspuFlush( (void *) thread );') + print('}\n') |