From 06ad3b9341599650f3d02d5a5e6e48383784a39d Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 23 Feb 2026 20:31:45 -0600 Subject: [PATCH] formatting --- src/gpu/gpu_core.h | 6 +--- src/platform/platform_win32/platform_win32.c | 37 +++----------------- src/platform/platform_win32/platform_win32.h | 9 ----- src/ui/ui_core.c | 2 +- 4 files changed, 6 insertions(+), 48 deletions(-) diff --git a/src/gpu/gpu_core.h b/src/gpu/gpu_core.h index 9cdea283..3216eff6 100644 --- a/src/gpu/gpu_core.h +++ b/src/gpu/gpu_core.h @@ -248,8 +248,7 @@ Enum(G_Access) Enum(G_Layout) { G_Layout_NoChange, - - G_Layout_Undefined, // No access <-- D3D12_BARRIER_LAYOUT_UNDEFINED + G_Layout_Undefined, ////////////////////////////// //- Queue-agnostic @@ -258,9 +257,7 @@ Enum(G_Layout) // access type (except depth-stencil). Resources cannot transition to/from // this layout, they must be created with it. Allows concurrent reads // with up to 1 write to non-overlapping regions. - G_Layout_Simultaneous, // Any access except depth-stencil <-- D3D12_BARRIER_LAYOUT_COMMON + D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS - G_Layout_Common, // ShaderRead/CopyRead/CopyWrite/Present <-- D3D12_BARRIER_LAYOUT_COMMON ////////////////////////////// @@ -268,7 +265,6 @@ Enum(G_Layout) G_Layout_DirectQueue_General, // ShaderRead/ShaderReadWrite/CopyRead/CopyWrite <-- D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON G_Layout_DirectQueue_Read, // ShaderRead/CopyRead/DepthStencilRead <-- D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ - G_Layout_DirectQueue_DepthStencil, // DepthStencilRead/DepthStencilWrite <-- D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE G_Layout_DirectQueue_RenderTarget, // RenderTargetWrite <-- D3D12_BARRIER_LAYOUT_RENDER_TARGET diff --git a/src/platform/platform_win32/platform_win32.c b/src/platform/platform_win32/platform_win32.c index 2a499bfa..539c6df5 100644 --- a/src/platform/platform_win32/platform_win32.c +++ b/src/platform/platform_win32/platform_win32.c @@ -12,6 +12,9 @@ void PLT_Bootstrap(void) DispatchWave(Lit("Win32 timer sync"), 1, PLT_W32_SyncTimerForever, 0); } +//////////////////////////////////////////////////////////// +//~ Helpers + DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level) { // Win32 compression algorithms from fastest -> slowest @@ -25,13 +28,9 @@ DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level) return algos[algo_idx]; } -//////////////////////////////////////////////////////////// -//~ Time - DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) { - return (DateTime) - { + return (DateTime) { .year = st.wYear, .month = st.wMonth, .day_of_week = st.wDayOfWeek, @@ -43,34 +42,6 @@ DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) }; } -//////////////////////////////////////////////////////////// -//~ File system - -String PLT_W32_StringFromWin32Path(Arena *arena, wchar_t *src) -{ - String result = Zi; - result.text = ArenaNext(arena, u8); - while (*src) - { - String16 decode_str = { .len = *(src + 1) ? 2 : 1, .text = src }; - Utf16DecodeResult decoded = DecodeUtf16(decode_str); - Utf8EncodeResult encoded = EncodeUtf8(decoded.codepoint); - u8 *dest = PushStructsNoZero(arena, u8, encoded.count8); - for (u32 i = 0; i < encoded.count8; ++i) - { - u8 byte = encoded.chars8[i]; - if (byte == '\\') - { - byte = '/'; - } - dest[i] = byte; - } - result.len += encoded.count8; - src += decoded.advance16; - } - return result; -} - //////////////////////////////////////////////////////////// //~ Timer job diff --git a/src/platform/platform_win32/platform_win32.h b/src/platform/platform_win32/platform_win32.h index 33994a5d..44a52d9a 100644 --- a/src/platform/platform_win32/platform_win32.h +++ b/src/platform/platform_win32/platform_win32.h @@ -33,17 +33,8 @@ extern PLT_W32_Ctx PLT_W32; //~ Helpers DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level); - -//////////////////////////////////////////////////////////// -//~ Time - DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st); -//////////////////////////////////////////////////////////// -//~ File system - -String PLT_W32_StringFromWin32Path(Arena *arena, wchar_t *src); - //////////////////////////////////////////////////////////// //~ Timer job diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index fe54311e..36914410 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -1781,7 +1781,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync) //- Backbuffer blit pass - G_DumbMemoryLayoutSync(frame->cl, draw_target, G_Layout_DirectQueue_General); + G_DumbMemoryLayoutSync(frame->cl, draw_target, G_Layout_DirectQueue_Read); G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_DirectQueue_RenderTarget); {