comparison semicongine/engine.nim @ 1072:d967f9029695

add: some more debug log
author sam <sam@basx.dev>
date Tue, 02 Apr 2024 23:06:39 +0700
parents 86b9721dfc09
children 7fb8f62a9ea5
comparison
equal deleted inserted replaced
1071:ec014e90bc46 1072:d967f9029695
152 checkVkResult engine.device.vk.vkDeviceWaitIdle() 152 checkVkResult engine.device.vk.vkDeviceWaitIdle()
153 engine.initRenderer(@[], clearColor, vSync = vSync) 153 engine.initRenderer(@[], clearColor, vSync = vSync)
154 checkVkResult engine.device.vk.vkDeviceWaitIdle() 154 checkVkResult engine.device.vk.vkDeviceWaitIdle()
155 155
156 proc loadScene*(engine: var Engine, scene: var Scene) = 156 proc loadScene*(engine: var Engine, scene: var Scene) =
157 debug &"start loading scene '{scene.name}'"
157 assert engine.renderer.isSome 158 assert engine.renderer.isSome
158 assert not scene.loaded 159 assert not scene.loaded
159 checkVkResult engine.device.vk.vkDeviceWaitIdle() 160 checkVkResult engine.device.vk.vkDeviceWaitIdle()
160 scene.addShaderGlobal(ASPECT_RATIO_ATTRIBUTE, engine.getAspectRatio) 161 scene.addShaderGlobal(ASPECT_RATIO_ATTRIBUTE, engine.getAspectRatio)
161 engine.renderer.get.setupDrawableBuffers(scene) 162 engine.renderer.get.setupDrawableBuffers(scene)
162 engine.renderer.get.updateMeshData(scene, forceAll = true) 163 engine.renderer.get.updateMeshData(scene, forceAll = true)
163 engine.renderer.get.updateUniformData(scene, forceAll = true) 164 engine.renderer.get.updateUniformData(scene, forceAll = true)
164 checkVkResult engine.device.vk.vkDeviceWaitIdle() 165 checkVkResult engine.device.vk.vkDeviceWaitIdle()
166 debug &"done loading scene '{scene.name}'"
165 167
166 proc unloadScene*(engine: var Engine, scene: Scene) = 168 proc unloadScene*(engine: var Engine, scene: Scene) =
167 checkVkResult engine.device.vk.vkDeviceWaitIdle() 169 debug &"unload scene '{scene.name}'"
168 engine.renderer.get.destroy(scene) 170 engine.renderer.get.destroy(scene)
169 checkVkResult engine.device.vk.vkDeviceWaitIdle()
170 171
171 proc renderScene*(engine: var Engine, scene: var Scene) = 172 proc renderScene*(engine: var Engine, scene: var Scene) =
172 assert engine.state == Running 173 assert engine.state == Running
173 assert engine.renderer.isSome 174 assert engine.renderer.isSome
174 let t0 = getMonoTime() 175 let t0 = getMonoTime()