16TEST(CommandEncoderVKTest, DeleteEncoderAfterThreadDies) {
19 std::shared_ptr<std::vector<std::string>> called_functions;
23 std::shared_ptr<CommandEncoderVK>
encoder;
24 std::thread thread([&] {
32 std::find(called_functions->begin(), called_functions->end(),
33 "vkDestroyCommandPool");
35 std::find(called_functions->begin(), called_functions->end(),
36 "vkFreeCommandBuffers");
37 EXPECT_TRUE(destroy_pool != called_functions->end());
38 EXPECT_TRUE(free_buffers != called_functions->end());
42TEST(CommandEncoderVKTest, CleanupAfterSubmit) {
46 std::shared_ptr<std::vector<std::string>> called_functions;
51 std::thread thread([&] {
52 auto buffer = context->CreateCommandBuffer();
53 context->GetCommandQueue()->Submit(
56 wait_for_thread_join.
Wait();
61 wait_for_thread_join.
Signal();
62 wait_for_submit.
Wait();
68 std::find(called_functions->begin(), called_functions->end(),
69 "vkDestroyCommandPool");
71 std::find(called_functions->begin(), called_functions->end(),
72 "vkFreeCommandBuffers");
73 EXPECT_TRUE(destroy_pool != called_functions->end());
74 EXPECT_TRUE(free_buffers != called_functions->end());
std::shared_ptr< ContextVK > Build()
Create a Vulkan context with Vulkan functions mocked. The caller is given a chance to tinker on the s...
static const uint8_t buffer[]