scripts: Fix dynamic array calc in vk_helper.py
authorMark Lobodzinski <mark@lunarg.com>
Wed, 4 Jan 2017 16:27:39 +0000 (09:27 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Wed, 4 Jan 2017 16:29:48 +0000 (09:29 -0700)
VkSubmitInfo->pWaitDstStageMask should be treated as a dynamic array
with a count of VkSubmitInfo->waitSemaphoreCount.

Change-Id: I42da296eeb849f5baabc12d011c938f0f322274a

scripts/vk_helper.py

index 3d5b121..9407ee7 100755 (executable)
@@ -266,18 +266,19 @@ class HeaderFileParser:
     #  3a. Name of dynam array must end in 's' char OR
     #  3b. Name of count var minus 'count' must be contained in name of dynamic array
     def _is_dynamic_array(self, full_type, name):
-        exceptions = ['pEnabledFeatures', 'pWaitDstStageMask', 'pSampleMask']
-        if name in exceptions:
+        negative_exceptions = ['pEnabledFeatures', 'pSampleMask']
+        positive_exceptions = ['pWaitDstStageMask']
+        if name in negative_exceptions:
             return False
+        if name in positive_exceptions:
+            return True
         if '' != self.last_struct_count_name:
             if 'const' in full_type and '*' in full_type:
                 if name.endswith('s') or self.last_struct_count_name.lower().replace('count', '') in name.lower():
                     return True
-
                 # VkWriteDescriptorSet
                 if self.last_struct_count_name == "descriptorCount":
                     return True
-
         return False
 
     # populate struct dicts based on struct lines