You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
embree: Update to 4.3.1
This commit is contained in:
committed by
Jakub Marcowski
parent
d2f9245ddc
commit
c43eab55a4
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "../tasking/taskscheduler.h"
|
||||
#include "../sys/array.h"
|
||||
#include "../math/math.h"
|
||||
#include "../math/emath.h"
|
||||
#include "../math/range.h"
|
||||
|
||||
namespace embree
|
||||
@@ -14,17 +14,17 @@ namespace embree
|
||||
template<typename Index, typename Func>
|
||||
__forceinline void parallel_for( const Index N, const Func& func)
|
||||
{
|
||||
#if defined(TASKING_INTERNAL)
|
||||
#if defined(TASKING_INTERNAL) && !defined(TASKING_TBB)
|
||||
if (N) {
|
||||
TaskScheduler::TaskGroupContext context;
|
||||
TaskScheduler::spawn(Index(0),N,Index(1),[&] (const range<Index>& r) {
|
||||
assert(r.size() == 1);
|
||||
func(r.begin());
|
||||
});
|
||||
if (!TaskScheduler::wait())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
},&context);
|
||||
TaskScheduler::wait();
|
||||
if (context.cancellingException != nullptr) {
|
||||
std::rethrow_exception(context.cancellingException);
|
||||
}
|
||||
}
|
||||
#elif defined(TASKING_TBB)
|
||||
#if TBB_INTERFACE_VERSION >= 12002
|
||||
@@ -33,19 +33,13 @@ namespace embree
|
||||
func(i);
|
||||
},context);
|
||||
if (context.is_group_execution_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#else
|
||||
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
|
||||
func(i);
|
||||
});
|
||||
if (tbb::task::self().is_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#endif
|
||||
|
||||
#elif defined(TASKING_PPL)
|
||||
@@ -62,13 +56,13 @@ namespace embree
|
||||
__forceinline void parallel_for( const Index first, const Index last, const Index minStepSize, const Func& func)
|
||||
{
|
||||
assert(first <= last);
|
||||
#if defined(TASKING_INTERNAL)
|
||||
TaskScheduler::spawn(first,last,minStepSize,func);
|
||||
if (!TaskScheduler::wait())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
#if defined(TASKING_INTERNAL) && !defined(TASKING_TBB)
|
||||
TaskScheduler::TaskGroupContext context;
|
||||
TaskScheduler::spawn(first,last,minStepSize,func,&context);
|
||||
TaskScheduler::wait();
|
||||
if (context.cancellingException != nullptr) {
|
||||
std::rethrow_exception(context.cancellingException);
|
||||
}
|
||||
|
||||
#elif defined(TASKING_TBB)
|
||||
#if TBB_INTERFACE_VERSION >= 12002
|
||||
@@ -77,19 +71,13 @@ namespace embree
|
||||
func(range<Index>(r.begin(),r.end()));
|
||||
},context);
|
||||
if (context.is_group_execution_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#else
|
||||
tbb::parallel_for(tbb::blocked_range<Index>(first,last,minStepSize),[&](const tbb::blocked_range<Index>& r) {
|
||||
func(range<Index>(r.begin(),r.end()));
|
||||
});
|
||||
if (tbb::task::self().is_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#endif
|
||||
|
||||
#elif defined(TASKING_PPL)
|
||||
@@ -121,19 +109,13 @@ namespace embree
|
||||
func(i);
|
||||
},tbb::simple_partitioner(),context);
|
||||
if (context.is_group_execution_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#else
|
||||
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
|
||||
func(i);
|
||||
},tbb::simple_partitioner());
|
||||
if (tbb::task::self().is_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -148,19 +130,13 @@ namespace embree
|
||||
func(i);
|
||||
},ap,context);
|
||||
if (context.is_group_execution_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#else
|
||||
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
|
||||
func(i);
|
||||
},ap);
|
||||
if (tbb::task::self().is_cancelled())
|
||||
// -- GODOT start --
|
||||
// throw std::runtime_error("task cancelled");
|
||||
abort();
|
||||
// -- GODOT end --
|
||||
throw std::runtime_error("task cancelled");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user