From a5a3c7370844bd3f80b34fb5a157e5dd4bd1ab39 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 18 Jun 2025 13:02:59 +0800 Subject: [PATCH] add Fence_waitAndDestroy to TEngine.h --- thermion_dart/native/src/c_api/TEngine.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/thermion_dart/native/src/c_api/TEngine.cpp b/thermion_dart/native/src/c_api/TEngine.cpp index 47131744..e54e4898 100644 --- a/thermion_dart/native/src/c_api/TEngine.cpp +++ b/thermion_dart/native/src/c_api/TEngine.cpp @@ -265,6 +265,11 @@ namespace thermion return reinterpret_cast(fence); } + EMSCRIPTEN_KEEPALIVE void Fence_waitAndDestroy(TFence *tFence) { + auto *fence = reinterpret_cast(tFence); + Fence::waitAndDestroy(fence); + } + EMSCRIPTEN_KEEPALIVE void Engine_destroyFence(TEngine *tEngine, TFence *tFence) { auto *engine = reinterpret_cast(tEngine); @@ -280,14 +285,8 @@ namespace thermion EMSCRIPTEN_KEEPALIVE void Engine_execute(TEngine *tEngine) { #ifdef __EMSCRIPTEN__ - // auto startTime = std::chrono::high_resolution_clock::now(); auto *engine = reinterpret_cast(tEngine); engine->execute(); - // auto endTime = std::chrono::high_resolution_clock::now(); - // auto durationNs = std::chrono::duration_cast(endTime - startTime).count(); - // float durationMs = durationNs / 1e6f; - - // Log("Total Engine_execute() time: %.3f ms", durationMs); #else Log("WARNING - ignored on non-WASM"); #endif