WIP: tick lanes were working, currently bootstrapping the job system.
This commit is contained in:
@@ -92,6 +92,17 @@ import "core:strings"
|
||||
import "core:slice"
|
||||
slice_zero :: slice.zero
|
||||
|
||||
import "core:prof/spall"
|
||||
Spall_Context :: spall.Context
|
||||
Spall_Buffer :: spall.Buffer
|
||||
|
||||
import "core:sync"
|
||||
sync_load :: sync.atomic_load_explicit
|
||||
sync_store :: sync.atomic_store_explicit
|
||||
|
||||
import "core:thread"
|
||||
SysThread :: thread.Thread
|
||||
|
||||
import "core:time"
|
||||
TIME_IS_SUPPORTED :: time.IS_SUPPORTED
|
||||
time_clock :: time.clock
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package grime
|
||||
|
||||
//region STATIC MEMORY
|
||||
static_memory: StaticMemory
|
||||
static_memory: StaticMemory
|
||||
@thread_local thread_memory: ThreadMemory
|
||||
//endregion STATIC MEMORY
|
||||
|
||||
StaticMemory :: struct {
|
||||
spall_profiler: ^SpallProfiler,
|
||||
}
|
||||
spall_context: ^Spall_Context,
|
||||
}
|
||||
ThreadMemory :: struct {
|
||||
spall_buffer: ^Spall_Buffer,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user