blob: 5742bcb04b7a9e635224c1f14a8c0cee9275f671 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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')
|