formatting

This commit is contained in:
jacob 2026-02-23 20:31:45 -06:00
parent a24461187e
commit 06ad3b9341
4 changed files with 6 additions and 48 deletions

View File

@ -248,8 +248,7 @@ Enum(G_Access)
Enum(G_Layout) Enum(G_Layout)
{ {
G_Layout_NoChange, G_Layout_NoChange,
G_Layout_Undefined,
G_Layout_Undefined, // No access <-- D3D12_BARRIER_LAYOUT_UNDEFINED
////////////////////////////// //////////////////////////////
//- Queue-agnostic //- Queue-agnostic
@ -258,9 +257,7 @@ Enum(G_Layout)
// access type (except depth-stencil). Resources cannot transition to/from // access type (except depth-stencil). Resources cannot transition to/from
// this layout, they must be created with it. Allows concurrent reads // this layout, they must be created with it. Allows concurrent reads
// with up to 1 write to non-overlapping regions. // 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_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 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_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_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_DepthStencil, // DepthStencilRead/DepthStencilWrite <-- D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE
G_Layout_DirectQueue_RenderTarget, // RenderTargetWrite <-- D3D12_BARRIER_LAYOUT_RENDER_TARGET G_Layout_DirectQueue_RenderTarget, // RenderTargetWrite <-- D3D12_BARRIER_LAYOUT_RENDER_TARGET

View File

@ -12,6 +12,9 @@ void PLT_Bootstrap(void)
DispatchWave(Lit("Win32 timer sync"), 1, PLT_W32_SyncTimerForever, 0); DispatchWave(Lit("Win32 timer sync"), 1, PLT_W32_SyncTimerForever, 0);
} }
////////////////////////////////////////////////////////////
//~ Helpers
DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level) DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level)
{ {
// Win32 compression algorithms from fastest -> slowest // Win32 compression algorithms from fastest -> slowest
@ -25,13 +28,9 @@ DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level)
return algos[algo_idx]; return algos[algo_idx];
} }
////////////////////////////////////////////////////////////
//~ Time
DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st) DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st)
{ {
return (DateTime) return (DateTime) {
{
.year = st.wYear, .year = st.wYear,
.month = st.wMonth, .month = st.wMonth,
.day_of_week = st.wDayOfWeek, .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 //~ Timer job

View File

@ -33,17 +33,8 @@ extern PLT_W32_Ctx PLT_W32;
//~ Helpers //~ Helpers
DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level); DWORD PLT_W32_CompressionAlgorithmFromLevel(PLT_CompressionLevel level);
////////////////////////////////////////////////////////////
//~ Time
DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st); DateTime PLT_W32_DateTimeFromWin32SystemTime(SYSTEMTIME st);
////////////////////////////////////////////////////////////
//~ File system
String PLT_W32_StringFromWin32Path(Arena *arena, wchar_t *src);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//~ Timer job //~ Timer job

View File

@ -1781,7 +1781,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
//- Backbuffer blit pass //- 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); G_DumbMemoryLayoutSync(frame->cl, backbuffer, G_Layout_DirectQueue_RenderTarget);
{ {