glthread: don't increment variable_data if it's the last variable-size param
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
This commit is contained in:
@@ -113,6 +113,7 @@ class PrintCode(gl_XML.gl_print_base):
|
|||||||
out('cmd->{0} = {0};'.format(p.name))
|
out('cmd->{0} = {0};'.format(p.name))
|
||||||
if func.variable_params:
|
if func.variable_params:
|
||||||
out('char *variable_data = (char *) (cmd + 1);')
|
out('char *variable_data = (char *) (cmd + 1);')
|
||||||
|
i = 1
|
||||||
for p in func.variable_params:
|
for p in func.variable_params:
|
||||||
if p.img_null_flag:
|
if p.img_null_flag:
|
||||||
out('cmd->{0}_null = !{0};'.format(p.name))
|
out('cmd->{0}_null = !{0};'.format(p.name))
|
||||||
@@ -120,14 +121,17 @@ class PrintCode(gl_XML.gl_print_base):
|
|||||||
with indent():
|
with indent():
|
||||||
out(('memcpy(variable_data, {0}, {1});').format(
|
out(('memcpy(variable_data, {0}, {1});').format(
|
||||||
p.name, p.size_string(False)))
|
p.name, p.size_string(False)))
|
||||||
|
if i < len(func.variable_params):
|
||||||
out('variable_data += {0};'.format(
|
out('variable_data += {0};'.format(
|
||||||
p.size_string(False)))
|
p.size_string(False)))
|
||||||
out('}')
|
out('}')
|
||||||
else:
|
else:
|
||||||
out(('memcpy(variable_data, {0}, {1});').format(
|
out(('memcpy(variable_data, {0}, {1});').format(
|
||||||
p.name, p.size_string(False)))
|
p.name, p.size_string(False)))
|
||||||
|
if i < len(func.variable_params):
|
||||||
out('variable_data += {0};'.format(
|
out('variable_data += {0};'.format(
|
||||||
p.size_string(False)))
|
p.size_string(False)))
|
||||||
|
i += 1
|
||||||
|
|
||||||
if not func.fixed_params and not func.variable_params:
|
if not func.fixed_params and not func.variable_params:
|
||||||
out('(void) cmd;\n')
|
out('(void) cmd;\n')
|
||||||
@@ -191,6 +195,7 @@ class PrintCode(gl_XML.gl_print_base):
|
|||||||
out('{0} * {1};'.format(
|
out('{0} * {1};'.format(
|
||||||
p.get_base_type_string(), p.name))
|
p.get_base_type_string(), p.name))
|
||||||
out('const char *variable_data = (const char *) (cmd + 1);')
|
out('const char *variable_data = (const char *) (cmd + 1);')
|
||||||
|
i = 1
|
||||||
for p in func.variable_params:
|
for p in func.variable_params:
|
||||||
out('{0} = ({1} *) variable_data;'.format(
|
out('{0} = ({1} *) variable_data;'.format(
|
||||||
p.name, p.get_base_type_string()))
|
p.name, p.get_base_type_string()))
|
||||||
@@ -199,11 +204,13 @@ class PrintCode(gl_XML.gl_print_base):
|
|||||||
out('if (cmd->{0}_null)'.format(p.name))
|
out('if (cmd->{0}_null)'.format(p.name))
|
||||||
with indent():
|
with indent():
|
||||||
out('{0} = NULL;'.format(p.name))
|
out('{0} = NULL;'.format(p.name))
|
||||||
|
if i < len(func.variable_params):
|
||||||
out('else')
|
out('else')
|
||||||
with indent():
|
with indent():
|
||||||
out('variable_data += {0};'.format(p.size_string(False)))
|
out('variable_data += {0};'.format(p.size_string(False)))
|
||||||
else:
|
elif i < len(func.variable_params):
|
||||||
out('variable_data += {0};'.format(p.size_string(False)))
|
out('variable_data += {0};'.format(p.size_string(False)))
|
||||||
|
i += 1
|
||||||
|
|
||||||
self.print_sync_call(func)
|
self.print_sync_call(func)
|
||||||
out('}')
|
out('}')
|
||||||
|
Reference in New Issue
Block a user