layers: Added fence validation check to object_tracker
authorMark Lobodzinski <mark@lunarg.com>
Wed, 22 Apr 2015 21:06:12 +0000 (15:06 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Wed, 22 Apr 2015 21:06:12 +0000 (15:06 -0600)
Validate that all fences in WaitForFences call have been submitted.

vk-layer-generate.py

index 5a19ddfa600dedb5b7fceb109053b7b70d76362a..c5c62275ba566782cd1891655e2db8a8d1999ef9 100755 (executable)
@@ -1132,6 +1132,11 @@ class ObjectTrackerSubcommand(Subcommand):
         elif 'GetFenceStatus' in proto.name:
             using_line += '    // Warn if submitted_flag is not set\n'
             using_line += '    validate_status(fence, VkObjectTypeFence, OBJSTATUS_FENCE_IS_SUBMITTED, OBJSTATUS_FENCE_IS_SUBMITTED, VK_DBG_MSG_ERROR, OBJTRACK_INVALID_FENCE, "Status Requested for Unsubmitted Fence");\n'
+        elif 'WaitForFences' in proto.name:
+            using_line += '    // Warn if waiting on unsubmitted fence\n'
+            using_line += '    for (uint32_t i = 0; i < fenceCount; i++) {\n'
+            using_line += '        validate_status(pFences[i], VkObjectTypeFence, OBJSTATUS_FENCE_IS_SUBMITTED, OBJSTATUS_FENCE_IS_SUBMITTED, VK_DBG_MSG_ERROR, OBJTRACK_INVALID_FENCE, "Waiting for Unsubmitted Fence");\n'
+            using_line += '    }\n'
         elif 'EndCommandBuffer' in proto.name:
             using_line += '    reset_status(cmdBuffer, VkObjectTypeCmdBuffer, (OBJSTATUS_VIEWPORT_BOUND    |\n'
             using_line += '                                                                OBJSTATUS_RASTER_BOUND      |\n'