Test empty submits are properly processed

This commit is contained in:
baldurk
2022-11-18 12:30:04 +00:00
parent 5aae46a86e
commit 62bfec8442
2 changed files with 51 additions and 4 deletions
+27
View File
@@ -253,6 +253,7 @@ void main()
optDevExts.push_back(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME);
optDevExts.push_back(VK_KHR_MULTIVIEW_EXTENSION_NAME);
optDevExts.push_back(VK_KHR_MAINTENANCE2_EXTENSION_NAME);
optDevExts.push_back(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME);
VulkanGraphicsTest::Prepare(argc, argv);
@@ -309,6 +310,17 @@ void main()
multiview.pNext = (void *)devInfoNext;
devInfoNext = &multiview;
}
static VkPhysicalDeviceSynchronization2FeaturesKHR sync2Features = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR,
};
if(hasExt(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME))
{
sync2Features.synchronization2 = VK_TRUE;
sync2Features.pNext = (void *)devInfoNext;
devInfoNext = &sync2Features;
}
}
int main()
@@ -1653,6 +1665,21 @@ void main()
Submit(3, 4, {cmd});
}
// make some empty submits
setMarker(queue, "before_empty");
{
VkSubmitInfo submit = vkh::SubmitInfo({});
CHECK_VKR(vkQueueSubmit(queue, 1, &submit, VK_NULL_HANDLE));
}
if(hasExt(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME))
{
VkSubmitInfo2KHR submit = {VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR};
CHECK_VKR(vkQueueSubmit2KHR(queue, 1, &submit, VK_NULL_HANDLE));
}
setMarker(queue, "after_empty");
Present();
}
+24 -4
View File
@@ -197,8 +197,28 @@ class VK_Parameter_Zoo(rdtest.TestCase):
raise rdtest.TestFailureException(
"Expected validSampler to be at binding slot 0 in immutable action")
# Check for resource leaks
if len(self.controller.GetStructuredFile().chunks) > 500:
raise rdtest.TestFailureException(
"Too many chunks found: {}".format(len(self.controller.GetStructuredFile().chunks)))
sdfile = self.controller.GetStructuredFile()
# Check for resource leaks
if len(sdfile.chunks) > 500:
raise rdtest.TestFailureException(
"Too many chunks found: {}".format(len(sdfile.chunks)))
action = self.find_action("before_empty")
action = self.get_action(action.eventId+1)
self.check("vkQueueSubmit" in action.GetName(sdfile))
a = action.GetName(sdfile)
action = self.get_action(action.eventId+1)
self.check("vkQueueSubmit" in action.GetName(sdfile))
self.check("No Command Buffers" in action.GetName(sdfile))
self.check(a != action.GetName(sdfile))
action = self.get_action(action.eventId+1)
if "after_empty" not in action.GetName(sdfile):
self.check("vkQueueSubmit2" in action.GetName(sdfile))
a = action.GetName(sdfile)
action = self.get_action(action.eventId + 1)
self.check("vkQueueSubmit2" in action.GetName(sdfile))
self.check("No Command Buffers" in action.GetName(sdfile))
self.check(a != action.GetName(sdfile))