15TEST(CommandEncoderVKTest, DeleteEncoderAfterThreadDies) {
18 std::shared_ptr<std::vector<std::string>> called_functions;
22 std::thread thread([&] { context->CreateCommandBuffer(); });
27 std::find(called_functions->begin(), called_functions->end(),
28 "vkDestroyCommandPool");
30 std::find(called_functions->begin(), called_functions->end(),
31 "vkFreeCommandBuffers");
32 EXPECT_TRUE(destroy_pool != called_functions->end());
33 EXPECT_TRUE(free_buffers != called_functions->end());
34 EXPECT_TRUE(free_buffers < destroy_pool);
37TEST(CommandEncoderVKTest, CleanupAfterSubmit) {
41 std::shared_ptr<std::vector<std::string>> called_functions;
46 std::thread thread([&] {
47 auto buffer = context->CreateCommandBuffer();
48 context->GetCommandQueue()->Submit(
51 wait_for_thread_join.
Wait();
56 wait_for_thread_join.
Signal();
57 wait_for_submit.
Wait();
63 std::find(called_functions->begin(), called_functions->end(),
64 "vkDestroyCommandPool");
66 std::find(called_functions->begin(), called_functions->end(),
67 "vkFreeCommandBuffers");
68 EXPECT_TRUE(destroy_pool != called_functions->end());
69 EXPECT_TRUE(free_buffers != called_functions->end());
70 EXPECT_TRUE(free_buffers < destroy_pool);
std::shared_ptr< ContextVK > Build()
Create a Vulkan context with Vulkan functions mocked. The caller is given a chance to tinker on the s...