Its maybe not a race condition?
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user