Skip to content

stdlib/profilerView source ↗

profiler

29 items · generated by scribe fromstdlib/profiler.fd· synced 2026-11-15

stdlib/profiler29 items

Contents

ProfileSample

pub struct ProfileSample {

Fields:

NameType
namestr
start_msf64
elapsed_msf64
depthi64
parenti64

Defined at line 22


FrameProfile

pub struct FrameProfile {

Fields:

NameType
frame_numberi64
frame_time_msf64
draw_callsi64
trianglesi64
texture_bindsi64
shader_switchesi64

Defined at line 30


Profiler

pub struct Profiler {

Fields:

NameType
sample_namesVec<str>
sample_startsVec<f64>
sample_elapsedVec<f64>
sample_depthsVec<i64>
sample_parentsVec<i64>
sample_stackVec<i64>
hist_frame_timesVec<f64>
hist_draw_callsVec<i64>
hist_trianglesVec<i64>
max_framesi64
enabledbool
frame_counti64
avg_fpsf64
min_frame_msf64
max_frame_msf64
total_draw_callsi64
current_depthi64
cur_frame_numberi64
cur_frame_timef64
cur_draw_callsi64
cur_trianglesi64
cur_texture_bindsi64
cur_shader_switchesi64
cur_frame_startf64

Defined at line 39


profiler_create

Create a new profiler.

pub fn profiler_create() -> Profiler {

Returns: Profiler

Defined at line 67


profiler_init

Initialize/reset the profiler.

pub fn profiler_init(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 74


profiler_set_enabled

Enable/disable profiling.

pub fn profiler_set_enabled(p: & mut Profiler, enabled: bool) -> void {

Parameters:

  • p: & mut Profiler
  • enabled: bool

Returns: void

Defined at line 93


profiler_begin_frame

Begin a new frame.

pub fn profiler_begin_frame(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 98


profiler_begin

Begin a profiled scope.

pub fn profiler_begin(p: & mut Profiler, name: str) -> void {

Parameters:

  • p: & mut Profiler
  • name: str

Returns: void

Defined at line 119


profiler_end

End a profiled scope.

pub fn profiler_end(p: & mut Profiler, name: str) -> void {

Parameters:

  • p: & mut Profiler
  • name: str

Returns: void

Defined at line 141


profiler_count_draw_call

Record a draw call.

pub fn profiler_count_draw_call(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 158


profiler_count_triangles

Record triangles rendered.

pub fn profiler_count_triangles(p: & mut Profiler, count: i64) -> void {

Parameters:

  • p: & mut Profiler
  • count: i64

Returns: void

Defined at line 163


profiler_count_texture_bind

Record a texture bind.

pub fn profiler_count_texture_bind(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 168


profiler_count_shader_switch

Record a shader switch.

pub fn profiler_count_shader_switch(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 173


profiler_end_frame

End the current frame and store the profile.

pub fn profiler_end_frame(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 178


profiler_frame_time

Get the current frame time in milliseconds.

pub fn profiler_frame_time(p: & Profiler) -> f64 {

Parameters:

  • p: & Profiler

Returns: f64

Defined at line 221


profiler_fps

Get the average FPS.

pub fn profiler_fps(p: & Profiler) -> f64 {

Parameters:

  • p: & Profiler

Returns: f64

Defined at line 229


profiler_draw_calls

Get the number of draw calls in the last frame.

pub fn profiler_draw_calls(p: & Profiler) -> i64 {

Parameters:

  • p: & Profiler

Returns: i64

Defined at line 234


profiler_triangles

Get the number of triangles in the last frame.

pub fn profiler_triangles(p: & Profiler) -> i64 {

Parameters:

  • p: & Profiler

Returns: i64

Defined at line 242


profiler_min_frame

Get the minimum frame time.

pub fn profiler_min_frame(p: & Profiler) -> f64 {

Parameters:

  • p: & Profiler

Returns: f64

Defined at line 250


profiler_max_frame

Get the maximum frame time.

pub fn profiler_max_frame(p: & Profiler) -> f64 {

Parameters:

  • p: & Profiler

Returns: f64

Defined at line 255


profiler_frame_count

Get the number of stored frames.

pub fn profiler_frame_count(p: & Profiler) -> i64 {

Parameters:

  • p: & Profiler

Returns: i64

Defined at line 260


profiler_get_sample

Get a sample from the current frame by name.

pub fn profiler_get_sample(p: & Profiler, name: str) -> ProfileSample {

Parameters:

  • p: & Profiler
  • name: str

Returns: ProfileSample

Defined at line 265


profiler_last_frame

Get the last frame profile.

pub fn profiler_last_frame(p: & Profiler) -> FrameProfile {

Parameters:

  • p: & Profiler

Returns: FrameProfile

Defined at line 282


profiler_reset

Reset profiler statistics.

pub fn profiler_reset(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 289


profiler_frame_time_history

Get the frame time history as a string.

pub fn profiler_frame_time_history(p: & Profiler) -> str {

Parameters:

  • p: & Profiler

Returns: str

Defined at line 301


profiler_shutdown

Shutdown the profiler.

pub fn profiler_shutdown(p: & mut Profiler) -> void {

Parameters:

  • p: & mut Profiler

Returns: void

Defined at line 315


profiler_set_max_frames

Set the maximum number of frames to keep in history.

pub fn profiler_set_max_frames(p: & mut Profiler, max: i64) -> void {

Parameters:

  • p: & mut Profiler
  • max: i64

Returns: void

Defined at line 329


profiler_sample_count

Get the number of samples in the current frame.

pub fn profiler_sample_count(p: & Profiler) -> i64 {

Parameters:

  • p: & Profiler

Returns: i64

Defined at line 339


profiler_get_sample_idx

Get a sample by index.

pub fn profiler_get_sample_idx(p: & Profiler, idx: i64) -> ProfileSample {

Parameters:

  • p: & Profiler
  • idx: i64

Returns: ProfileSample

Defined at line 344


Generated by scribe, the Fides documentation generator