"""
+file_index = 0
+file_count = 1
current_indent = 0
out('')
def printBody(self, api):
- async_funcs = []
+ # The first file only contains the dispatch tables
+ if file_index == 0:
+ self.print_unmarshal_dispatch_cmd(api)
+ self.print_create_marshal_table(api)
+ return
+
+ # The remaining files contain the marshal and unmarshal functions
+ func_per_file = (len(api.functionIterateAll()) // (file_count - 1)) + 1
+ i = -1
for func in api.functionIterateAll():
+ i += 1
+ if i // func_per_file != (file_index - 1):
+ continue
+
flavor = func.marshal_flavor()
if flavor in ('skip', 'custom'):
continue
elif flavor == 'async':
self.print_async_body(func)
- async_funcs.append(func)
elif flavor == 'sync':
self.print_sync_body(func)
- self.print_unmarshal_dispatch_cmd(api)
- self.print_create_marshal_table(api)
def show_usage():
file_name = 'gl_API.xml'
try:
- (args, trail) = getopt.getopt(sys.argv[1:], 'm:f:')
+ (args, trail) = getopt.getopt(sys.argv[1:], 'm:f:i:n:')
except Exception:
show_usage()
for (arg,val) in args:
if arg == '-f':
file_name = val
+ elif arg == '-i':
+ file_index = int(val)
+ elif arg == '-n':
+ file_count = int(val)
+ assert file_index < file_count
printer = PrintCode()
api = gl_XML.parse_GL_API(file_name, marshal_XML.marshal_item_factory())
capture : true,
)
-main_marshal_generated_c = custom_target(
- 'marshal_generated.c',
- input : ['gl_marshal.py', 'gl_and_es_API.xml'],
- output : 'marshal_generated.c',
- command : [prog_python, '@INPUT0@', '-f', '@INPUT1@'],
- depend_files : files('marshal_XML.py') + glapi_gen_depends,
- capture : true,
-)
+main_marshal_generated_c = []
+foreach x : ['0', '1', '2', '3', '4', '5', '6', '7']
+ main_marshal_generated_c += custom_target(
+ 'marshal_generated' + x + '.c',
+ input : ['gl_marshal.py', 'gl_and_es_API.xml'],
+ output : 'marshal_generated' + x + '.c',
+ command : [prog_python, '@INPUT0@', '-f', '@INPUT1@', '-i', x, '-n', '8'],
+ depend_files : files('marshal_XML.py') + glapi_gen_depends,
+ capture : true,
+ )
+endforeach
glx_generated = []
$(intermediates)/main/api_exec.c: $(dispatch_deps)
$(call es-gen)
-$(intermediates)/main/marshal_generated.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
-$(intermediates)/main/marshal_generated.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+$(intermediates)/main/marshal_generated0.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated0.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 0 -n 8
-$(intermediates)/main/marshal_generated.c: $(dispatch_deps)
+$(intermediates)/main/marshal_generated0.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated1.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated1.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 1 -n 8
+
+$(intermediates)/main/marshal_generated1.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated2.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated2.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 2 -n 8
+
+$(intermediates)/main/marshal_generated2.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated3.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated3.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 3 -n 8
+
+$(intermediates)/main/marshal_generated3.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated4.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated4.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 4 -n 8
+
+$(intermediates)/main/marshal_generated4.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated5.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated5.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 5 -n 8
+
+$(intermediates)/main/marshal_generated5.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated6.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated6.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 6 -n 8
+
+$(intermediates)/main/marshal_generated6.c: $(dispatch_deps)
+ $(call es-gen)
+
+$(intermediates)/main/marshal_generated7.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal.py
+$(intermediates)/main/marshal_generated7.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml -i 7 -n 8
+
+$(intermediates)/main/marshal_generated7.c: $(dispatch_deps)
$(call es-gen)
$(intermediates)/main/marshal_generated.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_marshal_h.py
main/lines.c \
main/lines.h \
main/macros.h \
- main/marshal_generated.c \
+ main/marshal_generated0.c \
+ main/marshal_generated1.c \
+ main/marshal_generated2.c \
+ main/marshal_generated3.c \
+ main/marshal_generated4.c \
+ main/marshal_generated5.c \
+ main/marshal_generated6.c \
+ main/marshal_generated7.c \
main/marshal_generated.h \
main/matrix.c \
main/matrix.h \
pass
# The marshal_generated.c file is generated from the GL/ES API.xml file
-env.CodeGenerate(
- target = 'main/marshal_generated.c',
- script = GLAPI + 'gen/gl_marshal.py',
- source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
- command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
- )
+for i in range(8):
+ env.CodeGenerate(
+ target = 'main/marshal_generated{0}.c'.format(i),
+ script = GLAPI + 'gen/gl_marshal.py',
+ source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
+ command = python_cmd + ' $SCRIPT -f $SOURCE -i {0} -n 8 > $TARGET'.format(i)
+ )
# The marshal_generated.h file is generated from the GL/ES API.xml file
env.CodeGenerate(
main_enums_c,
format_fallback_c,
get_hash_h,
- main_marshal_generated_c,
main_marshal_generated_h,
main_dispatch_h,
ir_expression_operation_h,
main_remap_helper_h,
sha1_h,
-]
+] + main_marshal_generated_c
files_libmesa_gallium += [
ir_expression_operation_h,
sha1_h,