layers: Fix bug in how dynamic array Counts were interpreted by APIDump
authorTobin Ehlis <tobin@lunarg.com>
Thu, 16 Apr 2015 21:56:11 +0000 (15:56 -0600)
committerTony Barbour <tony@LunarG.com>
Fri, 17 Apr 2015 01:34:59 +0000 (19:34 -0600)
vk-layer-generate.py
vk_helper.py

index cb429aa..44c0b36 100755 (executable)
@@ -672,8 +672,9 @@ class APIDumpSubcommand(Subcommand):
                 log_func_no_addr += '%s = address, ' % (p.name)
             else:
                 log_func_no_addr += '%s = " << %s << ", ' % (p.name, pfi)
-            if prev_count_name != '' and (prev_count_name.replace('Count', '')[1:] in p.name or 'slotCount' == prev_count_name):
+            if prev_count_name != '' and (prev_count_name.replace('Count', '')[1:] in p.name):
                 sp_param_dict[pindex] = prev_count_name
+                prev_count_name = ''
             elif 'pDescriptorSets' == p.name and proto.params[-1].name == 'pCount':
                 sp_param_dict[pindex] = '*pCount'
             elif 'Wsi' not in proto.name and vk_helper.is_type(p.ty.strip('*').replace('const ', ''), 'struct'):
index 80bfc6b..b35286c 100755 (executable)
@@ -881,6 +881,14 @@ class StructWrapperGen:
         sh_funcs.append('    string final_str = prefix + ss.str();')
         sh_funcs.append("    return final_str;")
         sh_funcs.append("}")
+        # Add function to return a string value for input uint32_t
+        sh_funcs.append("string string_convert_helper(const uint32_t toString, const string prefix)\n{")
+        sh_funcs.append("    using namespace StreamControl;")
+        sh_funcs.append("    stringstream ss;")
+        sh_funcs.append('    ss << toString;')
+        sh_funcs.append('    string final_str = prefix + ss.str();')
+        sh_funcs.append("    return final_str;")
+        sh_funcs.append("}")
         # Add function to dynamically print out unknown struct
         sh_funcs.append("string dynamic_display(const void* pStruct, const string prefix)\n{")
         sh_funcs.append("    // Cast to APP_INFO ptr initially just to pull sType off struct")