diff --git a/src/base/win32/base_win32_entry.c b/src/base/win32/base_win32_entry.c index 744502c6..57f3d532 100644 --- a/src/base/win32/base_win32_entry.c +++ b/src/base/win32/base_win32_entry.c @@ -215,7 +215,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, /* Run app start job */ if (!Atomic32Fetch(&g->panicking)) { - RunJob(1, W32_AppStartupJob, 0, JobPool_Floating, JobPriority_High, 0); + RunJob(1, W32_AppStartupJob, JobPool_Floating, JobPriority_High, 0, 0); } /* Wait for startup end or panic */ @@ -243,7 +243,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, /* Run exit callbacks job */ if (!Atomic32Fetch(&g->panicking)) { - RunJob(1, W32_AppShutdownJob, 0, JobPool_Floating, JobPriority_High, 0); + RunJob(1, W32_AppShutdownJob, JobPool_Floating, JobPriority_High, 0, 0); } /* Wait for exit end or panic */ diff --git a/src/gtest/dx12/gtest_dx12.c b/src/gtest/dx12/gtest_dx12.c new file mode 100644 index 00000000..de663713 --- /dev/null +++ b/src/gtest/dx12/gtest_dx12.c @@ -0,0 +1,6 @@ +//////////////////////////////// +//~ Startup + +void GT_StartupCore(void) +{ +} diff --git a/src/gtest/dx12/gtest_dx12.h b/src/gtest/dx12/gtest_dx12.h new file mode 100644 index 00000000..e69de29b diff --git a/src/gtest/gtest.c b/src/gtest/gtest.c new file mode 100644 index 00000000..179190dc --- /dev/null +++ b/src/gtest/gtest.c @@ -0,0 +1,13 @@ +#include "gtest.h" + +#if PlatformIsWindows +# include "dx12/gtest_dx12.c" +#else +# error Gpu backend not implemented +#endif +void GT_Main(void) +{ + RunOnce(); + GT_StartupDeps(); + GT_StartupCore(); +} diff --git a/src/gtest/gtest.h b/src/gtest/gtest.h new file mode 100644 index 00000000..1644faa6 --- /dev/null +++ b/src/gtest/gtest.h @@ -0,0 +1,22 @@ +#ifndef GTEST_H +#define GTEST_H + +//////////////////////////////// +//~ Layer dependencies + +#include "../base/base.h" +inline void GT_StartupDeps(void) +{ + BaseMain(); +} + +//////////////////////////////// +//~ Layer headers + +#include "gtest_core.h" +#if PlatformIsWindows +# include "dx12/gtest_dx12.h" +#endif +void GT_Main(void); + +#endif diff --git a/src/gtest/gtest_core.h b/src/gtest/gtest_core.h new file mode 100644 index 00000000..b38d99e2 --- /dev/null +++ b/src/gtest/gtest_core.h @@ -0,0 +1,4 @@ +//////////////////////////////// +//~ Startup + +void GT_StartupCore(void); diff --git a/src/playback/win32/playback_win32.c b/src/playback/win32/playback_win32.c index 6cb97f5b..0d1ebddc 100644 --- a/src/playback/win32/playback_win32.c +++ b/src/playback/win32/playback_win32.c @@ -15,7 +15,7 @@ void PB_StartupCore(void) PB_WSP_SharedState *g = &PB_WSP_shared_state; PB_WSP_InitializeWasapi(); /* Start playback job */ - RunJob(1, PB_WSP_PlaybackJob, 0, JobPool_Audio, JobPriority_High, &g->PB_WSP_PlaybackJob_counter); + RunJob(1, PB_WSP_PlaybackJob, JobPool_Audio, JobPriority_High, &g->PB_WSP_PlaybackJob_counter, 0); OnExit(&PB_WSP_Shutdown); } diff --git a/src/pp/pp.h b/src/pp/pp.h index 0ac1842f..160edd1b 100644 --- a/src/pp/pp.h +++ b/src/pp/pp.h @@ -5,7 +5,7 @@ //~ Layer dependencies #include "../base/base.h" -#include "../gpu/gpu.h" +#include "../gtest/gtest.h" #include "../sprite/sprite.h" #include "../font/font.h" #include "../collider/collider.h" @@ -13,10 +13,11 @@ #include "../net/net.h" #include "../mixer/mixer.h" #include "../bitbuff/bitbuff.h" +#include "../rendertest/rendertest.h" inline void StartupPpDeps(void) { BaseMain(); - GPU_Main(); + GT_Main(); S_Main(); F_Main(); CLD_Main(); @@ -24,6 +25,7 @@ inline void StartupPpDeps(void) N_Main(); MIX_Main(); BB_Main(); + RT_Main(); } //////////////////////////////// diff --git a/src/pp/pp_core.c b/src/pp/pp_core.c index c42e246e..79d8cfad 100644 --- a/src/pp/pp_core.c +++ b/src/pp/pp_core.c @@ -44,8 +44,8 @@ void StartupUser(void) P_ShowWindow(g->window); /* Start jobs */ - RunJob(1, UpdateUserJob, 0, JobPool_User, JobPriority_High, &g->shutdown_job_counters); - RunJob(1, SimJob, 0, JobPool_Sim, JobPriority_High, &g->shutdown_job_counters); + RunJob(1, UpdateUserJob, JobPool_User, JobPriority_High, &g->shutdown_job_counters, 0); + RunJob(1, SimJob, JobPool_Sim, JobPriority_High, &g->shutdown_job_counters, 0); OnExit(&ShutdownUser); } diff --git a/src/pp/pp_step.c b/src/pp/pp_step.c index 177b9db5..657de63b 100644 --- a/src/pp/pp_step.c +++ b/src/pp/pp_step.c @@ -2064,7 +2064,6 @@ void StepSim(SimStepCtx *ctx) ReleaseAllWithProp(world, Prop_Release); - //- Sync to publish client if (publish_client->valid && world->tick > publish_client->last_tick) diff --git a/src/rendertest/rendertest.c b/src/rendertest/rendertest.c new file mode 100644 index 00000000..809d37b9 --- /dev/null +++ b/src/rendertest/rendertest.c @@ -0,0 +1,9 @@ +#include "rendertest.h" + +#include "rendertest_core.c" +void RT_Main(void) +{ + RunOnce(); + RT_StartupDeps(); + RT_StartupCore(); +} diff --git a/src/rendertest/rendertest.h b/src/rendertest/rendertest.h new file mode 100644 index 00000000..54dfc5ed --- /dev/null +++ b/src/rendertest/rendertest.h @@ -0,0 +1,27 @@ +#ifndef RENDERTEST_H +#define RENDERTEST_H + +//////////////////////////////// +//~ Layer dependencies + +#include "../base/base.h" +#include "../gpu/gpu.h" +#include "../sprite/sprite.h" +#include "../font/font.h" +#include "../collider/collider.h" +inline void RT_StartupDeps(void) +{ + BaseMain(); + GPU_Main(); + S_Main(); + F_Main(); + CLD_Main(); +} + +//////////////////////////////// +//~ Layer headers + +#include "rendertest_core.h" +void RT_Main(void); + +#endif diff --git a/src/rendertest/rendertest_core.c b/src/rendertest/rendertest_core.c new file mode 100644 index 00000000..8526057e --- /dev/null +++ b/src/rendertest/rendertest_core.c @@ -0,0 +1,6 @@ +//////////////////////////////// +//~ Startup + +void RT_StartupCore(void) +{ +} diff --git a/src/rendertest/rendertest_core.h b/src/rendertest/rendertest_core.h new file mode 100644 index 00000000..bea17d4d --- /dev/null +++ b/src/rendertest/rendertest_core.h @@ -0,0 +1,4 @@ +//////////////////////////////// +//~ Startup + +void RT_StartupCore(void);