WIP: tick lanes were working, currently bootstrapping the job system.

This commit is contained in:
2025-10-14 00:04:30 -04:00
parent 0d904fba7c
commit c106d3bc96
12 changed files with 408 additions and 162 deletions

View File

@@ -1,32 +1,30 @@
package grime
import "core:prof/spall"
/*
This is just a snippet file, do not use directly.
*/
import "base:runtime"
import "core:prof/spall"
SpallProfiler :: struct {
ctx : spall.Context,
buffer : spall.Buffer,
set_profiler_module_context :: #force_inline proc "contextless" (profiler : ^Spall_Context) {
sync_store(& static_memory.spall_context, profiler, .Release)
}
set_profiler_module_context :: #force_inline proc "contextless" ( profiler : ^SpallProfiler ) {
static_memory.spall_profiler = profiler
set_profiler_thread_buffer :: #force_inline proc "contextless" (buffer: ^Spall_Buffer) {
sync_store(& thread_memory.spall_buffer, buffer, .Release)
}
DISABLE_PROFILING :: true
@(deferred_none = profile_end, disabled = DISABLE_PROFILING)
profile :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & static_memory.spall_profiler.ctx, & static_memory.spall_profiler.buffer, name, "", loc )
spall._buffer_begin( static_memory.spall_context, thread_memory.spall_buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_begin :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & static_memory.spall_profiler.ctx, & static_memory.spall_profiler.buffer, name, "", loc )
spall._buffer_begin( static_memory.spall_context, thread_memory.spall_buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_end :: #force_inline proc "contextless" () {
spall._buffer_end( & static_memory.spall_profiler.ctx, & static_memory.spall_profiler.buffer)
spall._buffer_end( static_memory.spall_context, thread_memory.spall_buffer)
}