diff --git a/build.sh b/build.sh index 8ae476b..4cca518 100755 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ if [ -v debug ]; then echo "[debug mode]"; fi if [ -v release ]; then echo "[release mode]"; fi if [ -v gcc ]; then compiler="${CC:-gcc}"; cpp_compiler="g++"; echo "[gcc compiler]"; fi if [ -v clang ]; then compiler="${CC:-clang}"; cpp_compiler="clang++"; echo "[clang compiler]"; fi -if [ ! -v vulkan ] then vulkan=1; fi +if [ ! -v vulkan ]; then vulkan=1; fi if [ -v vulkan ]; then render_flag="-DSTG_VULKAN_RENDERER"; fi if [ -v vulkan ]; then render_link="-lvulkan -l:libvma.a"; echo "[vulkan renderer]"; fi if [ ! -v render_flag ]; then render_flag="-DSTG_VULKAN_RENDERER"; vulkan="vulkan"; echo "[default renderer - vulkan]"; fi diff --git a/src/game.c b/src/game.c index 12d99f7..aed9973 100644 --- a/src/game.c +++ b/src/game.c @@ -53,6 +53,8 @@ static void gFrameStartNew() static void gRunCycle(gGameCtx *ctx, pGameInput *inputs, u32 i_count) { + ArenaFree(vFrameArena()); + rBufferQueueReset(); gPrepareGUICtx(ctx); diff --git a/src/platform/platform_linux.c b/src/platform/platform_linux.c index 4e7c9ba..ca6972b 100644 --- a/src/platform/platform_linux.c +++ b/src/platform/platform_linux.c @@ -298,11 +298,12 @@ b32 pSyscallErrCheck(void *ptr) // ::Platform::Linux::Async::Start:: -static pThread pThreadInit(pThreadProc proc, rawptr param) +static pThread pThreadInit(rawptr proc, rawptr param) { pThread thread = {0}; - pthread_mutex_init(&thread.mut, NULL); - pthread_create(&thread.handle, NULL, proc, param); + Assert(pthread_mutex_init(&thread.mut, NULL) == 0, "pthread_mutex_init failure"); + Assert(pthread_cond_init(&thread.cond, NULL) == 0, "pthread_cond_init failure"); + Assert(pthread_create(&thread.handle, NULL, proc, param) == 0, "pthread_create failure"); return thread; } diff --git a/src/renderer_vulkan.c b/src/renderer_vulkan.c index e2457ca..d68ee27 100644 --- a/src/renderer_vulkan.c +++ b/src/renderer_vulkan.c @@ -1819,6 +1819,7 @@ static void vTransferUpload(vTransfer **transfers, u32 count) void *vLoaderStart(void *i) { vLoader(); + pthread_exit(NULL); } #elif _WIN32 @@ -1838,7 +1839,7 @@ static void vLoaderWake() static void vLoader() { - pThread self = v_Renderer.async.thread; + pThread *self = &v_Renderer.async.thread; for (;;) { @@ -1873,7 +1874,7 @@ static void vLoader() { pAtomicStoreB32(&v_Renderer.async.sleeping, 1); TicketMutUnlock(&v_Renderer.upload.mut); - pThreadSuspend(&self); + pThreadSuspend(self); pAtomicStoreB32(&v_Renderer.async.sleeping, 0); } else