keid-core 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+24/−8 lines, 3 files
Files
- ChangeLog.md +3/−1
- keid-core.cabal +1/−1
- src/Engine/Run.hs +20/−6
ChangeLog.md view
@@ -1,3 +1,5 @@ # Changelog for keid-core -## Unreleased changes+## 0.1.0.1++- Inter-stage resource release waits for render job to finish.
keid-core.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: keid-core-version: 0.1.0.0+version: 0.1.0.1 synopsis: Core parts of Keid engine. category: Game Engine author: IC Rainbow
src/Engine/Run.hs view
@@ -53,20 +53,34 @@ put (Just oldSR) case stageAction of StageDone -> do- logInfo "Stage done"- release stageRelease+ releaseStage "Stage done" runStack rest StageReplace nextStage -> do- logInfo "Stage replaced"- release stageRelease+ releaseStage "Stage replaced" runStack (nextStage : rest) StagePush frozenStage nextStage -> do case frozenStage of StackStage{} ->- logInfo "Restarting stage pushed"+ logDebug "Restarting stage pushed" StackStageContinue{} ->- logInfo "Frozen stage pushed"+ logDebug "Frozen stage pushed" runStack (nextStage : frozenStage : rest)+ where+ releaseStage label = do+ logDebug label+ void $! async do+ {-+ XXX: wait for the current render job to finish.++ Since the new frames wouldn't be submitted until the control flow+ gets back to the render loop, this should be enough of a signal that+ the stage resources aren't used anymore.++ The call is costly, but its effects aren't seen.+ -}+ asks getDevice >>= Vk.deviceWaitIdle+ release stageRelease+ logDebug $ label <> ", released" prepareStage :: StageRIO env (ReleaseKey, st)