From 8dde998710faf960ae73cf43bc3462d3fcf3a1b5 Mon Sep 17 00:00:00 2001 From: benkyd Date: Thu, 19 Jan 2023 15:39:17 +0000 Subject: [PATCH] WHERE IS THE BUG COMING FORM --- hart/inferno-hart-cpu/src/main.cpp | 6 ++++++ libhart/inferno_hart.hpp | 6 ++++-- src/hart_module.cpp | 1 + src/renderer/renderer.cpp | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hart/inferno-hart-cpu/src/main.cpp b/hart/inferno-hart-cpu/src/main.cpp index 3905501..f9c306c 100644 --- a/hart/inferno-hart-cpu/src/main.cpp +++ b/hart/inferno-hart-cpu/src/main.cpp @@ -43,6 +43,7 @@ public: for (;;) { std::unique_lock lock(_mData); + mLastState = mState.load(); if (mToTrace.empty()) { lock.unlock(); @@ -51,6 +52,11 @@ public: } mState = EModuleState::Trace; + if (mLastState != mState) + { + spdlog::info("[hartcpu] Signal start"); + } + auto* ray = mToTrace.front(); int bestIdx = -1; glm::vec2 coords; diff --git a/libhart/inferno_hart.hpp b/libhart/inferno_hart.hpp index 5a92bbe..d90aeeb 100644 --- a/libhart/inferno_hart.hpp +++ b/libhart/inferno_hart.hpp @@ -86,11 +86,11 @@ public: // module keeps queue reference inline void submitQueue(std::vector queue) { - mState = EModuleState::Trace; std::lock_guard lock(_mData); + // mState = EModuleState::Trace; for (const auto& e: queue) mToTrace.push(e); - spdlog::info("[hartmodule] New trace queue"); + spdlog::info("[hartmodule] New trace queue: {}", mToTrace.size()); } inline void pushtoQueue(Ray* ray) @@ -101,6 +101,7 @@ public: inline void passContext(void* context, HART_HIT_CALLBACK callback) { + spdlog::debug("[hartmodule] Recieved context from HHM"); std::lock_guard lock(_mData); mCtx = context; Hit = callback; @@ -114,6 +115,7 @@ public: protected: std::queue mToTrace; std::atomic mState = EModuleState::Bad; + std::atomic mLastState = EModuleState::Bad; std::mutex _mData; diff --git a/src/hart_module.cpp b/src/hart_module.cpp index 954b3e4..b6498f6 100644 --- a/src/hart_module.cpp +++ b/src/hart_module.cpp @@ -79,5 +79,6 @@ void HHM::startTrace(RayField sourceScatter) { HARTModule* mod = mDirectory.getActiveModule(); mod->passContext((void*)this, &rayHitCallback); + spdlog::debug("SubmitQueue {}", sourceScatter.size()); mod->submitQueue(sourceScatter); } diff --git a/src/renderer/renderer.cpp b/src/renderer/renderer.cpp index e3645a5..69ee7e5 100644 --- a/src/renderer/renderer.cpp +++ b/src/renderer/renderer.cpp @@ -109,7 +109,9 @@ void RayRenderer::draw() { case EModuleState::Bad: spdlog::error("MODULE STATE BAD"); + break; case EModuleState::Build: + spdlog::error("MODULE STATE BUILD"); case EModuleState::Trace: break; case EModuleState::Ready: