From 5bee781ede6439ae2931c78cdc8f88c6b3470c03 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 25 Sep 2025 18:50:54 -0500 Subject: [PATCH] formatting --- src/base/base_job.h | 12 ++++-------- src/base/base_win32/base_win32_job.c | 9 ++------- src/config.h | 2 +- src/gpu/gpu_dx12/gpu_dx12.h | 4 ++-- src/meta/meta.c | 1 + src/platform/platform_win32/platform_win32.c | 2 +- src/pp/pp.c | 2 +- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/base/base_job.h b/src/base/base_job.h index 174843ef..0e1b15e2 100644 --- a/src/base/base_job.h +++ b/src/base/base_job.h @@ -18,20 +18,16 @@ Enum(JobPool) * etc). */ JobPool_Hyper = 0, - /* Contains un-affinitized worker threads. - * Meant to take on blocking work so that affinitized workers can continue doing actual work. */ - JobPool_Blocking = 1, - /* Contains worker threads affinitized to cores that don't interfere with workers in specialized pools. * Meant to consume asynchronous work from higher priority pools. */ - JobPool_Background = 2, + JobPool_Background = 1, /* Contains worker threads affinitized to cores that don't interfere with workers in other specialized pools. * These pools are meant to only have work pushed onto them from jobs within the same pool (e.g. 100 jobs pushed onto the * User pool will not interfere with cores running the Sim pool). */ - JobPool_Audio = 3, - JobPool_User = 4, - JobPool_Sim = 5, + JobPool_Audio = 2, + JobPool_User = 3, + JobPool_Sim = 4, JobPool_Count }; diff --git a/src/base/base_win32/base_win32_job.c b/src/base/base_win32/base_win32_job.c index 829e922b..dcc7ebaa 100644 --- a/src/base/base_win32/base_win32_job.c +++ b/src/base/base_win32/base_win32_job.c @@ -62,13 +62,6 @@ void InitJobSystem(void) pool->thread_priority = THREAD_PRIORITY_NORMAL; } break; - case JobPool_Blocking: - { - name_fmt = Lit("Blocking worker #%F"); - pool->num_worker_threads = 8; - pool->thread_priority = THREAD_PRIORITY_NORMAL; - } break; - case JobPool_Hyper: { name_fmt = Lit("Hyper worker #%F"); @@ -421,12 +414,14 @@ W32_ThreadDef(W32_JobWorkerEntryPoint, worker_ctx_arg) /* TODO: Pin non-worker threads to other cores */ HANDLE thread_handle = GetCurrentThread(); +#if 0 if (pool->thread_priority != 0) { __profn("Set priority"); b32 ok = SetThreadPriority(thread_handle, pool->thread_priority) != 0; Assert(ok); } +#endif #if 0 if (pool->thread_affinity_mask) diff --git a/src/config.h b/src/config.h index 0499a2f7..53532d05 100644 --- a/src/config.h +++ b/src/config.h @@ -94,6 +94,6 @@ /* TODO: Move these to user-configurable settings */ -#define VSYNC !RtcIsEnabled +#define VSYNC 0 #define AUDIO_ENABLED 0 #define FPS_LIMIT 300 diff --git a/src/gpu/gpu_dx12/gpu_dx12.h b/src/gpu/gpu_dx12/gpu_dx12.h index 80da76c0..80f25d56 100644 --- a/src/gpu/gpu_dx12/gpu_dx12.h +++ b/src/gpu/gpu_dx12/gpu_dx12.h @@ -12,8 +12,8 @@ //~ Tweakable defines #define GPU_D12_TearingIsAllowed 1 -#define GPU_D12_FrameLatency 1 -#define GPU_D12_SwapchainBufferCount 4 +#define GPU_D12_FrameLatency 2 +#define GPU_D12_SwapchainBufferCount 3 #define GPU_D12_SwapchainFlags (((GPU_D12_TearingIsAllowed != 0) * DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING) \ | ((GPU_D12_FrameLatency != 0) * DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT)) diff --git a/src/meta/meta.c b/src/meta/meta.c index 2fe8aed1..84af924d 100644 --- a/src/meta/meta.c +++ b/src/meta/meta.c @@ -923,6 +923,7 @@ JobDef(Build, _, __) PushStringToList(arena, &cp.warnings_msvc, Lit("-wd4189")); /* local variable is initialized but not referenced */ PushStringToList(arena, &cp.warnings_msvc, Lit("-wd4200")); /* nonstandard extension used: zero-sized array in struct/union */ PushStringToList(arena, &cp.warnings_msvc, Lit("-wd4702")); /* unreachable code */ + PushStringToList(arena, &cp.warnings_msvc, Lit("-wd4127")); /* conditional expression is constant */ } //- Clang diff --git a/src/platform/platform_win32/platform_win32.c b/src/platform/platform_win32/platform_win32.c index 2e0786d1..c648f515 100644 --- a/src/platform/platform_win32/platform_win32.c +++ b/src/platform/platform_win32/platform_win32.c @@ -62,7 +62,7 @@ void P_Startup(void) wc->lpszClassName = P_W32_WindowClassName; wc->hCursor = LoadCursor(0, IDC_ARROW); wc->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - //wc->hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + // wc->hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wc->lpfnWndProc = P_W32_Win32WindowProc; wc->hInstance = instance; diff --git a/src/pp/pp.c b/src/pp/pp.c index 0d3cc505..a3cd55b0 100644 --- a/src/pp/pp.c +++ b/src/pp/pp.c @@ -2542,7 +2542,7 @@ void UpdateUser(P_Window *window) Vec2 backbuffer_dst_f = MulXformV2(g->ui_to_screen_xf, VEC2(0, 0)); Vec2I32 backbuffer_dst = VEC2I32(RoundF32ToI32(backbuffer_dst_f.x), RoundF32ToI32(backbuffer_dst_f.y)); - g->gpu_render_fence_target = GPU_PresentSwapchain(g->swapchain, g->ui_target, g->screen_size, backbuffer_dst, 0); + g->gpu_render_fence_target = GPU_PresentSwapchain(g->swapchain, g->ui_target, g->screen_size, backbuffer_dst, VSYNC); } EndScratch(scratch);