godot/thirdparty/embree/patches/godot-changes-noexcept.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

544 lines
20 KiB
Diff
Raw Normal View History

diff --git a/thirdparty/embree/common/algorithms/parallel_reduce.h b/thirdparty/embree/common/algorithms/parallel_reduce.h
2024-02-24 11:40:55 +00:00
index b52b1e2e13..51ec0a6405 100644
--- a/thirdparty/embree/common/algorithms/parallel_reduce.h
+++ b/thirdparty/embree/common/algorithms/parallel_reduce.h
2021-04-20 16:38:09 +00:00
@@ -58,15 +58,19 @@ namespace embree
const Value v = tbb::parallel_reduce(tbb::blocked_range<Index>(first,last,minStepSize),identity,
[&](const tbb::blocked_range<Index>& r, const Value& start) { return reduction(start,func(range<Index>(r.begin(),r.end()))); },
reduction,context);
- if (context.is_group_execution_cancelled())
- throw std::runtime_error("task cancelled");
+ // -- GODOT start --
+ // if (context.is_group_execution_cancelled())
+ // throw std::runtime_error("task cancelled");
+ // -- GODOT end --
return v;
#else
const Value v = tbb::parallel_reduce(tbb::blocked_range<Index>(first,last,minStepSize),identity,
[&](const tbb::blocked_range<Index>& r, const Value& start) { return reduction(start,func(range<Index>(r.begin(),r.end()))); },
reduction);
- if (tbb::task::self().is_cancelled())
- throw std::runtime_error("task cancelled");
+ // -- GODOT start --
+ // if (tbb::task::self().is_cancelled())
+ // throw std::runtime_error("task cancelled");
+ // -- GODOT end --
return v;
#endif
#else // TASKING_PPL
diff --git a/thirdparty/embree/common/lexers/stringstream.cpp b/thirdparty/embree/common/lexers/stringstream.cpp
2024-02-24 11:40:55 +00:00
index 42ffb10176..c93da0b420 100644
--- a/thirdparty/embree/common/lexers/stringstream.cpp
+++ b/thirdparty/embree/common/lexers/stringstream.cpp
2024-02-24 11:40:55 +00:00
@@ -39,7 +39,12 @@ namespace embree
2021-04-20 16:38:09 +00:00
std::vector<char> str; str.reserve(64);
while (cin->peek() != EOF && !isSeparator(cin->peek())) {
int c = cin->get();
- if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input");
+ // -- GODOT start --
+ // if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input");
2024-02-24 11:40:55 +00:00
+ if (!isValidChar(c)) {
+ abort();
+ }
2021-04-20 16:38:09 +00:00
+ // -- GODOT end --
str.push_back((char)c);
}
str.push_back(0);
diff --git a/thirdparty/embree/common/sys/alloc.cpp b/thirdparty/embree/common/sys/alloc.cpp
2024-02-24 11:40:55 +00:00
index de225fafc6..71616a3982 100644
--- a/thirdparty/embree/common/sys/alloc.cpp
+++ b/thirdparty/embree/common/sys/alloc.cpp
2024-02-24 11:40:55 +00:00
@@ -24,16 +24,32 @@ namespace embree
void enableUSMAllocEmbree(sycl::context* context, sycl::device* device)
{
- if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled");
- if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled");
+ // -- GODOT start --
+ // if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled");
+ // if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled");
+ if (tls_context_embree != nullptr) {
+ abort();
+ }
+ if (tls_device_embree != nullptr) {
+ abort();
+ }
+ // -- GODOT end --
tls_context_embree = context;
tls_device_embree = device;
}
void disableUSMAllocEmbree()
{
- if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled");
- if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled");
+ // -- GODOT start --
+ // if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled");
+ // if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled");
+ if (tls_context_embree == nullptr) {
+ abort();
+ }
+ if (tls_device_embree == nullptr) {
+ abort();
+ }
+ // -- GODOT end --
tls_context_embree = nullptr;
tls_device_embree = nullptr;
}
@@ -48,8 +64,16 @@ namespace embree
void disableUSMAllocTutorial()
{
- if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled");
- if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled");
+ // -- GODOT start --
+ // if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled");
+ // if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled");
+ if (tls_context_tutorial == nullptr) {
+ abort();
+ }
+ if (tls_device_tutorial == nullptr) {
+ abort();
+ }
+ // -- GODOT end --
tls_context_tutorial = nullptr;
tls_device_tutorial = nullptr;
@@ -64,8 +88,13 @@ namespace embree
assert((align & (align-1)) == 0);
2021-04-20 16:38:09 +00:00
void* ptr = _mm_malloc(size,align);
2024-02-24 11:40:55 +00:00
- if (size != 0 && ptr == nullptr)
- throw std::bad_alloc();
+ // -- GODOT start --
+ // if (size != 0 && ptr == nullptr)
+ // throw std::bad_alloc();
+ if (size != 0 && ptr == nullptr) {
+ abort();
+ }
+ // -- GODOT end --
return ptr;
}
2021-04-20 16:38:09 +00:00
2024-02-24 11:40:55 +00:00
@@ -94,8 +123,13 @@ namespace embree
else
ptr = sycl::aligned_alloc_shared(align,size,*device,*context);
- if (size != 0 && ptr == nullptr)
2021-04-20 16:38:09 +00:00
- throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (size != 0 && ptr == nullptr)
+ // throw std::bad_alloc();
+ if (size != 0 && ptr == nullptr) {
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
return ptr;
}
2024-02-24 11:40:55 +00:00
@@ -241,7 +275,12 @@ namespace embree
2021-04-20 16:38:09 +00:00
/* fall back to 4k pages */
int flags = MEM_COMMIT | MEM_RESERVE;
char* ptr = (char*) VirtualAlloc(nullptr,bytes,flags,PAGE_READWRITE);
- if (ptr == nullptr) throw std::bad_alloc();
+ // -- GODOT start --
+ // if (ptr == nullptr) throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ if (ptr == nullptr) {
+ abort();
+ }
2021-04-20 16:38:09 +00:00
+ // -- GODOT end --
hugepages = false;
return ptr;
}
2024-02-24 11:40:55 +00:00
@@ -257,8 +296,13 @@ namespace embree
if (bytesNew >= bytesOld)
2021-04-20 16:38:09 +00:00
return bytesOld;
2024-02-24 11:40:55 +00:00
- if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT))
2021-04-20 16:38:09 +00:00
- throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT))
+ // throw std::bad_alloc();
+ if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
return bytesNew;
}
2024-02-24 11:40:55 +00:00
@@ -268,8 +312,13 @@ namespace embree
if (bytes == 0)
2021-04-20 16:38:09 +00:00
return;
2024-02-24 11:40:55 +00:00
- if (!VirtualFree(ptr,0,MEM_RELEASE))
2021-04-20 16:38:09 +00:00
- throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (!VirtualFree(ptr,0,MEM_RELEASE))
+ // throw std::bad_alloc();
+ if (!VirtualFree(ptr,0,MEM_RELEASE)) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
}
void os_advise(void *ptr, size_t bytes)
2024-02-24 11:40:55 +00:00
@@ -373,7 +422,12 @@ namespace embree
2021-04-20 16:38:09 +00:00
/* fallback to 4k pages */
void* ptr = (char*) mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == MAP_FAILED) throw std::bad_alloc();
+ // -- GODOT start --
+ // if (ptr == MAP_FAILED) throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ if (ptr == MAP_FAILED) {
+ abort();
+ }
2021-04-20 16:38:09 +00:00
+ // -- GODOT end --
hugepages = false;
/* advise huge page hint for THP */
2024-02-24 11:40:55 +00:00
@@ -389,8 +443,13 @@ namespace embree
if (bytesNew >= bytesOld)
2021-04-20 16:38:09 +00:00
return bytesOld;
2024-02-24 11:40:55 +00:00
- if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1)
2021-04-20 16:38:09 +00:00
- throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1)
+ // throw std::bad_alloc();
+ if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
return bytesNew;
}
2024-02-24 11:40:55 +00:00
@@ -403,8 +462,13 @@ namespace embree
/* for hugepages we need to also align the size */
2021-04-20 16:38:09 +00:00
const size_t pageSize = hugepages ? PAGE_SIZE_2M : PAGE_SIZE_4K;
bytes = (bytes+pageSize-1) & ~(pageSize-1);
2024-02-24 11:40:55 +00:00
- if (munmap(ptr,bytes) == -1)
2021-04-20 16:38:09 +00:00
- throw std::bad_alloc();
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (munmap(ptr,bytes) == -1)
+ // throw std::bad_alloc();
+ if (munmap(ptr,bytes) == -1) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
}
/* hint for transparent huge pages (THP) */
2024-02-24 11:40:55 +00:00
diff --git a/thirdparty/embree/common/sys/alloc.h b/thirdparty/embree/common/sys/alloc.h
index e19c2c221a..28b17f988d 100644
--- a/thirdparty/embree/common/sys/alloc.h
+++ b/thirdparty/embree/common/sys/alloc.h
@@ -160,7 +160,10 @@ namespace embree
typedef std::ptrdiff_t difference_type;
__forceinline pointer allocate( size_type n ) {
- throw std::runtime_error("no allocation supported");
+ // -- GODOT start --
+ // throw std::runtime_error("no allocation supported");
+ abort();
+ // -- GODOT end --
}
__forceinline void deallocate( pointer p, size_type n ) {
diff --git a/thirdparty/embree/common/sys/platform.h b/thirdparty/embree/common/sys/platform.h
2024-02-24 11:40:55 +00:00
index 6dc0cf3318..d4a9b9e119 100644
--- a/thirdparty/embree/common/sys/platform.h
+++ b/thirdparty/embree/common/sys/platform.h
2024-02-24 11:40:55 +00:00
@@ -213,11 +213,19 @@
#define UPRINT4(x,y,z,w) embree_cout_uniform << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << ", " << STRING(z) << " = " << (z) << ", " << STRING(w) << " = " << (w) << embree_endl
2021-04-20 16:38:09 +00:00
#if defined(DEBUG) // only report file and line in debug mode
+ // -- GODOT start --
2024-02-24 11:40:55 +00:00
+ // #define THROW_RUNTIME_ERROR(str) \
2021-04-20 16:38:09 +00:00
+ // throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str));
#define THROW_RUNTIME_ERROR(str) \
- throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str));
+ printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort();
2021-04-20 16:38:09 +00:00
+ // -- GODOT end --
#else
+ // -- GODOT start --
2024-02-24 11:40:55 +00:00
+ // #define THROW_RUNTIME_ERROR(str) \
2021-04-20 16:38:09 +00:00
+ // throw std::runtime_error(str);
#define THROW_RUNTIME_ERROR(str) \
- throw std::runtime_error(str);
+ abort();
+ // -- GODOT end --
#endif
#define FATAL(x) THROW_RUNTIME_ERROR(x)
diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp
2024-02-24 11:40:55 +00:00
index 83ead95122..88b88a30ec 100644
--- a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp
+++ b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp
2021-04-20 16:38:09 +00:00
@@ -48,13 +48,15 @@ namespace embree
{
Task* prevTask = thread.task;
thread.task = this;
- try {
2024-02-24 11:40:55 +00:00
- if (context->cancellingException == nullptr)
2021-04-20 16:38:09 +00:00
+ // -- GODOT start --
+ // try {
2024-02-24 11:40:55 +00:00
+ // if (context->cancellingException == nullptr)
2021-04-20 16:38:09 +00:00
closure->execute();
- } catch (...) {
2024-02-24 11:40:55 +00:00
- if (context->cancellingException == nullptr)
- context->cancellingException = std::current_exception();
2021-04-20 16:38:09 +00:00
- }
+ // } catch (...) {
2024-02-24 11:40:55 +00:00
+ // if (context->cancellingException == nullptr)
+ // context->cancellingException = std::current_exception();
2021-04-20 16:38:09 +00:00
+ // }
+ // -- GODOT end --
thread.task = prevTask;
add_dependencies(-1);
}
diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.h b/thirdparty/embree/common/tasking/taskschedulerinternal.h
2024-02-24 11:40:55 +00:00
index 355648b3f8..e72d3b72ba 100644
--- a/thirdparty/embree/common/tasking/taskschedulerinternal.h
+++ b/thirdparty/embree/common/tasking/taskschedulerinternal.h
2024-02-24 11:40:55 +00:00
@@ -130,8 +130,13 @@ namespace embree
__forceinline void* alloc(size_t bytes, size_t align = 64)
2021-04-20 16:38:09 +00:00
{
size_t ofs = bytes + ((align - stackPtr) & (align-1));
2024-02-24 11:40:55 +00:00
- if (stackPtr + ofs > CLOSURE_STACK_SIZE)
2021-04-20 16:38:09 +00:00
- throw std::runtime_error("closure stack overflow");
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (stackPtr + ofs > CLOSURE_STACK_SIZE)
+ // throw std::runtime_error("closure stack overflow");
+ if (stackPtr + ofs > CLOSURE_STACK_SIZE) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
stackPtr += ofs;
return &stack[stackPtr-bytes];
}
2024-02-24 11:40:55 +00:00
@@ -139,8 +144,13 @@ namespace embree
template<typename Closure>
__forceinline void push_right(Thread& thread, const size_t size, const Closure& closure, TaskGroupContext* context)
2021-04-20 16:38:09 +00:00
{
2024-02-24 11:40:55 +00:00
- if (right >= TASK_STACK_SIZE)
2021-04-20 16:38:09 +00:00
- throw std::runtime_error("task stack overflow");
2024-02-24 11:40:55 +00:00
+ // -- GODOT start --
+ // if (right >= TASK_STACK_SIZE)
+ // throw std::runtime_error("task stack overflow");
+ if (right >= TASK_STACK_SIZE) {
+ abort();
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
/* allocate new task on right side of stack */
size_t oldStackPtr = stackPtr;
diff --git a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp
2022-11-24 14:45:59 +00:00
index 40f9043736..57f75bfd7e 100644
--- a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp
+++ b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp
2021-04-20 16:38:09 +00:00
@@ -150,7 +150,10 @@ namespace embree
}
}
else {
- throw std::runtime_error("not supported node type in bvh_statistics");
+ // -- GODOT start --
+ // throw std::runtime_error("not supported node type in bvh_statistics");
+ abort();
+ // -- GODOT end --
}
return s;
}
2024-02-24 11:40:55 +00:00
diff --git a/thirdparty/embree/kernels/common/alloc.h b/thirdparty/embree/kernels/common/alloc.h
index 2bd292de4d..840d48c327 100644
--- a/thirdparty/embree/kernels/common/alloc.h
+++ b/thirdparty/embree/kernels/common/alloc.h
@@ -189,8 +189,13 @@ namespace embree
, atype(osAllocation ? EMBREE_OS_MALLOC : ALIGNED_MALLOC)
, primrefarray(device,0)
{
- if (osAllocation && useUSM)
- throw std::runtime_error("USM allocation cannot be combined with OS allocation.");
+ // -- GODOT start --
+ // if (osAllocation && useUSM)
+ // throw std::runtime_error("USM allocation cannot be combined with OS allocation.");
+ if (osAllocation && useUSM) {
+ abort();
+ }
+ // -- GODOT end --
for (size_t i=0; i<MAX_THREAD_USED_BLOCK_SLOTS; i++)
{
@@ -502,8 +507,13 @@ namespace embree
Block* myUsedBlocks = threadUsedBlocks[slot];
if (myUsedBlocks) {
void* ptr = myUsedBlocks->malloc(device,bytes,align,partial);
- if (ptr == nullptr && !blockAllocation)
- throw std::bad_alloc();
+ // -- GODOT start --
+ // if (ptr == nullptr && !blockAllocation)
+ // throw std::bad_alloc();
+ if (ptr == nullptr && !blockAllocation) {
+ abort();
+ }
+ // -- GODOT end --
if (ptr) return ptr;
}
diff --git a/thirdparty/embree/kernels/common/rtcore.cpp b/thirdparty/embree/kernels/common/rtcore.cpp
2024-02-24 11:40:55 +00:00
index 8dc5d7045b..eb8d2c0a58 100644
--- a/thirdparty/embree/kernels/common/rtcore.cpp
+++ b/thirdparty/embree/kernels/common/rtcore.cpp
2024-02-24 11:40:55 +00:00
@@ -257,10 +257,17 @@ RTC_NAMESPACE_BEGIN;
RTC_TRACE(rtcSetSceneBuildQuality);
RTC_VERIFY_HANDLE(hscene);
RTC_ENTER_DEVICE(hscene);
+ // -- GODOT start --
+ // if (quality != RTC_BUILD_QUALITY_LOW &&
+ // quality != RTC_BUILD_QUALITY_MEDIUM &&
+ // quality != RTC_BUILD_QUALITY_HIGH)
+ // throw std::runtime_error("invalid build quality");
2021-04-20 16:38:09 +00:00
if (quality != RTC_BUILD_QUALITY_LOW &&
quality != RTC_BUILD_QUALITY_MEDIUM &&
2024-02-24 11:40:55 +00:00
- quality != RTC_BUILD_QUALITY_HIGH)
2021-04-20 16:38:09 +00:00
- throw std::runtime_error("invalid build quality");
2024-02-24 11:40:55 +00:00
+ quality != RTC_BUILD_QUALITY_HIGH) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
scene->setBuildQuality(quality);
RTC_CATCH_END2(scene);
}
2024-02-24 11:40:55 +00:00
@@ -1563,11 +1570,19 @@ RTC_API void rtcSetGeometryTransform(RTCGeometry hgeometry, unsigned int timeSte
RTC_TRACE(rtcSetGeometryBuildQuality);
RTC_VERIFY_HANDLE(hgeometry);
RTC_ENTER_DEVICE(hgeometry);
+ // -- GODOT start --
+ // if (quality != RTC_BUILD_QUALITY_LOW &&
+ // quality != RTC_BUILD_QUALITY_MEDIUM &&
+ // quality != RTC_BUILD_QUALITY_HIGH &&
+ // quality != RTC_BUILD_QUALITY_REFIT)
+ // throw std::runtime_error("invalid build quality");
if (quality != RTC_BUILD_QUALITY_LOW &&
2021-04-20 16:38:09 +00:00
quality != RTC_BUILD_QUALITY_MEDIUM &&
quality != RTC_BUILD_QUALITY_HIGH &&
2024-02-24 11:40:55 +00:00
- quality != RTC_BUILD_QUALITY_REFIT)
2021-04-20 16:38:09 +00:00
- throw std::runtime_error("invalid build quality");
2024-02-24 11:40:55 +00:00
+ quality != RTC_BUILD_QUALITY_REFIT) {
2021-04-20 16:38:09 +00:00
+ abort();
2024-02-24 11:40:55 +00:00
+ }
+ // -- GODOT end --
2021-04-20 16:38:09 +00:00
geometry->setBuildQuality(quality);
RTC_CATCH_END2(geometry);
}
diff --git a/thirdparty/embree/kernels/common/rtcore.h b/thirdparty/embree/kernels/common/rtcore.h
2024-02-24 11:40:55 +00:00
index 73a061de11..47526482c1 100644
--- a/thirdparty/embree/kernels/common/rtcore.h
+++ b/thirdparty/embree/kernels/common/rtcore.h
2024-02-24 11:40:55 +00:00
@@ -13,13 +13,13 @@ namespace embree
__forceinline bool isIncoherent(RTCRayQueryFlags flags) { return (flags & RTC_RAY_QUERY_FLAG_COHERENT) == RTC_RAY_QUERY_FLAG_INCOHERENT; }
2021-04-20 16:38:09 +00:00
/*! Macros used in the rtcore API implementation */
+// -- GODOT start --
+#define RTC_CATCH_BEGIN
+#define RTC_CATCH_END(device)
+#define RTC_CATCH_END2(scene)
+#define RTC_CATCH_END2_FALSE(scene) return false;
2024-02-24 11:40:55 +00:00
#if 0
-# define RTC_CATCH_BEGIN
-# define RTC_CATCH_END(device)
-# define RTC_CATCH_END2(scene)
-# define RTC_CATCH_END2_FALSE(scene) return false;
-#else
-
+// -- GODOT end --
2022-11-24 14:45:59 +00:00
#define RTC_CATCH_BEGIN try {
#define RTC_CATCH_END(device) \
2024-02-24 11:40:55 +00:00
@@ -94,6 +94,8 @@ namespace embree
2021-04-20 16:38:09 +00:00
#define RTC_TRACE(x)
#endif
2022-11-24 14:45:59 +00:00
+// -- GODOT start --
+#if 0
/*! used to throw embree API errors */
struct rtcore_error : public std::exception
{
2024-02-24 11:40:55 +00:00
@@ -109,14 +111,18 @@ namespace embree
2022-11-24 14:45:59 +00:00
RTCError error;
std::string str;
};
+#endif
2021-04-20 16:38:09 +00:00
#if defined(DEBUG) // only report file and line in debug mode
#define throw_RTCError(error,str) \
- throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str));
+ printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort();
2022-11-24 14:45:59 +00:00
+ // throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str));
2021-04-20 16:38:09 +00:00
#else
#define throw_RTCError(error,str) \
- throw rtcore_error(error,str);
+ abort();
2022-11-24 14:45:59 +00:00
+ // throw rtcore_error(error,str);
2021-04-20 16:38:09 +00:00
#endif
2022-11-24 14:45:59 +00:00
+// -- GODOT end --
2021-04-20 16:38:09 +00:00
#define RTC_BUILD_ARGUMENTS_HAS(settings,member) \
2024-02-24 11:40:55 +00:00
(settings.byteSize > (offsetof(RTCBuildArguments,member)+sizeof(settings.member)))
diff --git a/thirdparty/embree/kernels/common/scene.cpp b/thirdparty/embree/kernels/common/scene.cpp
2024-02-24 11:40:55 +00:00
index fda8dd938a..10cb3c4bec 100644
--- a/thirdparty/embree/kernels/common/scene.cpp
+++ b/thirdparty/embree/kernels/common/scene.cpp
2024-02-24 11:40:55 +00:00
@@ -894,16 +894,18 @@ namespace embree
2021-04-20 16:38:09 +00:00
}
/* initiate build */
- try {
+ // -- GODOT start --
+ // try {
2024-02-24 11:40:55 +00:00
TaskScheduler::TaskGroupContext context;
scheduler->spawn_root([&]() { commit_task(); Lock<MutexSys> lock(taskGroup->schedulerMutex); taskGroup->scheduler = nullptr; }, &context, 1, !join);
2021-04-20 16:38:09 +00:00
- }
- catch (...) {
- accels_clear();
2024-02-24 11:40:55 +00:00
- Lock<MutexSys> lock(taskGroup->schedulerMutex);
- taskGroup->scheduler = nullptr;
2021-04-20 16:38:09 +00:00
- throw;
- }
+ // }
+ // catch (...) {
+ // accels_clear();
2024-02-24 11:40:55 +00:00
+ // Lock<MutexSys> lock(taskGroup->schedulerMutex);
+ // taskGroup->scheduler = nullptr;
2021-04-20 16:38:09 +00:00
+ // throw;
+ // }
+ // -- GODOT end --
}
#endif
2024-02-24 11:40:55 +00:00
diff --git a/thirdparty/embree/kernels/common/state.cpp b/thirdparty/embree/kernels/common/state.cpp
index 4e3ab6ddfb..1d73ae9629 100644
--- a/thirdparty/embree/kernels/common/state.cpp
+++ b/thirdparty/embree/kernels/common/state.cpp
@@ -194,13 +194,15 @@ namespace embree
bool State::parseFile(const FileName& fileName)
{
Ref<Stream<int> > file;
- try {
+ // -- GODOT start --
+ // try {
file = new FileStream(fileName);
- }
- catch (std::runtime_error& e) {
- (void) e;
- return false;
- }
+ // }
+ // catch (std::runtime_error& e) {
+ // (void) e;
+ // return false;
+ // }
+ // -- GODOT end --
std::vector<std::string> syms;
for (size_t i=0; i<sizeof(symbols)/sizeof(void*); i++)