Use shared parallel loop for grid lightmap bake

This commit is contained in:
2026-06-04 18:17:40 +02:00
parent b1acd5118b
commit e52fd3cbb5
4 changed files with 16 additions and 16 deletions

View File

@@ -419,17 +419,10 @@ void NodePanelGrid::bake_uvs()
std::thread worker([&]
{
BT_SetTerminate();
__block float* d_pos = data_pos.get();
__block float* d_nor = data_nor.get();
__block glm::u8vec4* d_out = reinterpret_cast<glm::u8vec4*>(data_out.get());
#if _WIN32
concurrency::parallel_for(int(0), fb.getHeight(), [&](int y)
#elif __IOS__ || __OSX__
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_apply((size_t)fb.getHeight(), queue, ^ (size_t y)
#else
parallel_for(fb.getHeight(), [&](int y)
#endif
float* d_pos = data_pos.get();
float* d_nor = data_nor.get();
auto* d_out = reinterpret_cast<glm::u8vec4*>(data_out.get());
parallel_for(fb.getHeight(), [&](size_t y)
{
for (int x = 0; x < fb.getWidth(); x++)
{