formatting

This commit is contained in:
jacob 2025-07-01 16:17:15 -05:00
parent 1a19a9e693
commit d38046a007
4 changed files with 72 additions and 82 deletions

BIN
res/sprite/tim.ase (Stored with Git LFS)

Binary file not shown.

View File

@ -236,6 +236,7 @@ INTERNAL JOB_DEF(playback_job, _)
DWORD task = 0; DWORD task = 0;
HANDLE mmc_handle = AvSetMmThreadCharacteristicsW(L"Pro Audio", &task); HANDLE mmc_handle = AvSetMmThreadCharacteristicsW(L"Pro Audio", &task);
ASSERT(mmc_handle); ASSERT(mmc_handle);
(UNUSED)mmc_handle;
/* FIXME: If playback fails at any point and mixer stops advancing, we /* FIXME: If playback fails at any point and mixer stops advancing, we
* need to halt mixer to prevent memory leak when sounds are played. */ * need to halt mixer to prevent memory leak when sounds are played. */

View File

@ -7,25 +7,20 @@
#if PROFILING #if PROFILING
/* Include tracy client */ #define PROFILING_SYSTEM_TRACE 0
#define TRACY_ENABLE
#if 0
/* Enable manual lifetime */
# define TRACY_MANUAL_LIFETIME
# define TRACY_DELAYED_INIT
#endif
#if 1
/* Disable system tracing (very slow) */
# define TRACY_NO_CALLSTACK
# define TRACY_NO_SYSTEM_TRACING
#endif
#include STRINGIZE(TRACY_INCLUDE_PATH)
#define PROFILING_CAPTURE_FRAME_IMAGE 0 #define PROFILING_CAPTURE_FRAME_IMAGE 0
#define PROFILING_LOCKS 0 #define PROFILING_LOCKS 0
#define PROFILING_D3D 1 #define PROFILING_D3D 1
#define PROFILING_CMD_WSTR L"tracy-profiler.exe -a 127.0.0.1" #define PROFILING_CMD_WSTR L"tracy-profiler.exe -a 127.0.0.1"
/* Include tracy client */
#define TRACY_ENABLE
#if !PROFILING_SYSTEM_TRACE
# define TRACY_NO_CALLSTACK
# define TRACY_NO_SYSTEM_TRACING
#endif
#include STRINGIZE(TRACY_INCLUDE_PATH)
/* Clang/GCC cleanup macros */ /* Clang/GCC cleanup macros */
#define __prof static const struct ___tracy_source_location_data CAT(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; __attribute((cleanup(__prof_zone_cleanup_func))) TracyCZoneCtx __tracy_zone_ctx = ___tracy_emit_zone_begin( &CAT(__tracy_source_location,__LINE__), true ); #define __prof static const struct ___tracy_source_location_data CAT(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; __attribute((cleanup(__prof_zone_cleanup_func))) TracyCZoneCtx __tracy_zone_ctx = ___tracy_emit_zone_begin( &CAT(__tracy_source_location,__LINE__), true );
#define __profscope(name) static const struct ___tracy_source_location_data CAT(__tracy_source_location,__LINE__) = { #name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; __attribute((cleanup(__prof_zone_cleanup_func))) TracyCZoneCtx __tracy_zone_ctx = ___tracy_emit_zone_begin( &CAT(__tracy_source_location,__LINE__), true ); #define __profscope(name) static const struct ___tracy_source_location_data CAT(__tracy_source_location,__LINE__) = { #name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; __attribute((cleanup(__prof_zone_cleanup_func))) TracyCZoneCtx __tracy_zone_ctx = ___tracy_emit_zone_begin( &CAT(__tracy_source_location,__LINE__), true );
@ -131,12 +126,4 @@ INLINE void __prof_dx12_zone_cleanup_func(TracyCD3D12ZoneCtx *ctx) { ___tracy_d3
# define __profframeimage(image, width, height, offset, flipped) # define __profframeimage(image, width, height, offset, flipped)
#endif /* PROFILING_CAPTURE_FRAME_IMAGE */ #endif /* PROFILING_CAPTURE_FRAME_IMAGE */
#ifdef TRACY_MANUAL_LIFETIME
# define __prof_startup ___tracy_startup_profiler()
# define __prof_shutdown ___tracy_shutdown_profiler()
#else
# define __prof_startup
# define __prof_shutdown
#endif /* TRACY_MANUAL_LIFETIME */
#endif #endif

View File

@ -960,8 +960,11 @@ INTERNAL SYS_THREAD_DEF(window_thread_entry_point, arg)
while (!atomic_i32_eval(&window->event_thread_shutdown)) { while (!atomic_i32_eval(&window->event_thread_shutdown)) {
MSG msg = ZI; MSG msg = ZI;
{
GetMessageW(&msg, 0, 0, 0); GetMessageW(&msg, 0, 0, 0);
}
{
__profscope(Process window message);
if (atomic_i32_eval(&window->event_thread_shutdown)) { if (atomic_i32_eval(&window->event_thread_shutdown)) {
break; break;
} }
@ -1023,7 +1026,7 @@ INTERNAL SYS_THREAD_DEF(window_thread_entry_point, arg)
} break; } break;
} }
} }
}
/* Destroy window hwnd */ /* Destroy window hwnd */
DestroyWindow(window->hwnd); DestroyWindow(window->hwnd);
@ -1220,6 +1223,7 @@ INTERNAL void win32_window_wake(struct win32_window *window)
INTERNAL LRESULT CALLBACK win32_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) INTERNAL LRESULT CALLBACK win32_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{ {
__prof;
struct win32_window *window = (struct win32_window *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); struct win32_window *window = (struct win32_window *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if (!window) { if (!window) {
@ -2352,7 +2356,6 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
(UNUSED)prev_instance; (UNUSED)prev_instance;
(UNUSED)cmdline_wstr; (UNUSED)cmdline_wstr;
(UNUSED)show_code; (UNUSED)show_code;
__prof_startup;
u64 cmdline_len = wstr_len(cmdline_wstr, ARRAY_COUNT(G.cmdline_args_wstr) - 1); u64 cmdline_len = wstr_len(cmdline_wstr, ARRAY_COUNT(G.cmdline_args_wstr) - 1);
MEMCPY(G.cmdline_args_wstr, cmdline_wstr, cmdline_len * sizeof(*cmdline_wstr)); MEMCPY(G.cmdline_args_wstr, cmdline_wstr, cmdline_len * sizeof(*cmdline_wstr));
@ -2561,7 +2564,6 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
} }
#endif #endif
__prof_shutdown;
return 0; return 0;
} }