layers: Fix APIDump corner cases to not print addresses w/ NoAddr option
authorTobin Ehlis <tobin@lunarg.com>
Tue, 28 Apr 2015 16:58:20 +0000 (10:58 -0600)
committerTobin Ehlis <tobin@lunarg.com>
Tue, 28 Apr 2015 17:00:15 +0000 (11:00 -0600)
vk-layer-generate.py

index 409c649..2cd3934 100755 (executable)
@@ -759,8 +759,16 @@ class APIDumpSubcommand(Subcommand):
                     log_func += '\n%sfor (i = 0; i < %s; i++) {' % (indent, sp_param_dict[sp_index])
                     indent += '    '
                     log_func += '\n%s%s' % (indent, cis_print_func)
+                    log_func += '\n%sif (StreamControl::writeAddress == true) {' % (indent)
+                    indent += '    '
                     log_func += '\n%s(*outputStream) << "   %s[" << i << "] (" << %s%s[i] << ")" << endl << tmp_str << endl;' % (indent, proto.params[sp_index].name, '&', proto.params[sp_index].name)
                     indent = indent[4:]
+                    log_func += '\n%s} else {' % (indent)
+                    indent += '    '
+                    log_func += '\n%s(*outputStream) << "   %s[" << i << "] (address)" << endl << "    address" << endl;' % (indent, proto.params[sp_index].name)
+                    indent = indent[4:]
+                    log_func += '\n%s}' % (indent)
+                    indent = indent[4:]
                     log_func += '\n%s}' % (indent)
             indent = indent[4:]
             log_func += '\n%s}' % (indent)