In a debug build, I want to check for OpenGL errors after almost every OpenGL call to ease debugging. As this is a costly operation, I don't want to do it in a release build. Right now I'm using functions like:
pub fn debug_panic_on_errors() {
if cfg!(debug_assertions) {
get_errors().unwrap();
}
}
Am I correct in assuming that this method will always be optimized away completely? Is there a better, more future-proof way?