Its maybe not a race condition?

This commit is contained in:
Dynamitos
2023-12-18 13:03:03 +01:00
parent 617bb2828d
commit ac1d11402e
2 changed files with 4 additions and 4 deletions
@@ -157,6 +157,7 @@ void BasePass::render()
command->bindDescriptor(descriptorSets); command->bindDescriptor(descriptorSets);
if (graphics->supportMeshShading()) if (graphics->supportMeshShading())
{ {
std::cout << "Num Meshes: " << instance.meshes.size() << std::endl;
command->dispatch(instance.meshes.size(), 1, 1); command->dispatch(instance.meshes.size(), 1, 1);
} }
else else
+3 -4
View File
@@ -7,15 +7,14 @@ TEST(ThreadPool, RunBatch)
ThreadPool t(10); ThreadPool t(10);
uint32 test = 20; uint32 test = 20;
std::mutex m; std::mutex m;
List<Task> work; List<std::function<void()>> work;
for (uint32 i = 0; i < 400; ++i) for (uint32 i = 0; i < 400; ++i)
{ {
work.add([&]() -> Task { work.add([&]() {
std::unique_lock l(m); std::unique_lock l(m);
std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::this_thread::sleep_for(std::chrono::milliseconds(10));
test++; test++;
co_return; });
}());
} }
t.runAndWait(std::move(work)); t.runAndWait(std::move(work));
ASSERT_EQ(test, 420); ASSERT_EQ(test, 420);