#gl #profiling #opengl #debugging #api-bindings

gl_generator_profiling_struct

ProfilingStructGenerator for gl_generator

3 releases

Uses old Rust 2015

0.1.2 Aug 18, 2018
0.1.1 Aug 18, 2018
0.1.0 Aug 18, 2018

#1037 in Graphics APIs

Download history 23/week @ 2024-03-11 21/week @ 2024-03-18 28/week @ 2024-03-25 84/week @ 2024-04-01 19/week @ 2024-04-08 18/week @ 2024-04-15 23/week @ 2024-04-22 19/week @ 2024-04-29 16/week @ 2024-05-06 22/week @ 2024-05-13 22/week @ 2024-05-20 17/week @ 2024-05-27 24/week @ 2024-06-03 20/week @ 2024-06-10 18/week @ 2024-06-17 21/week @ 2024-06-24

85 downloads per month

MIT/Apache

18KB
324 lines

Profiling struct generator

Yet another generator for gl_generator, very similar to DebugStructGenerator, but with these changes/additions:

  • It does not log all calls. It only logs a call that caused an error.
  • The corresponding explanation is included with the error code.
  • Contains a profiler that tracks the number of GL calls and errors.

Using the profiler

The generated gl module gains 3 additional methods:

  • profiler_reset() - resets the profiler;
  • profiler_call_count() -> usize - returns the number of calls since the last reset (or application start);
  • profiler_err_count() -> usize - returns the number of errors since the last reset (or application start);

Example usage:

gl::profiler_reset();

// the code

println!("Number of GL calls: {}", gl::profiler_call_count());
println!("Number of GL errors: {}", gl::profiler_err_count());

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1MB
~12K SLoC