Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to make the GPU profiling code compile on Gonk. #232

Merged
merged 1 commit into from Mar 10, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Try to make the GPU profiling code compile on Gonk.

  • Loading branch information
pcwalton committed Mar 10, 2016
commit 0c673acdd20ace71165b2b7032e746543b68ab8f
@@ -697,13 +697,18 @@ pub struct VBOId(gl::GLuint);
#[derive(PartialEq, Eq, Hash, Debug, Copy, Clone)]
struct IBOId(gl::GLuint);

#[cfg(not(any(target_os = "android", target_os = "gonk")))]
pub struct GpuProfile {
active_query: usize,
gl_queries: Vec<gl::GLuint>,
first_frame: bool,
}

#[cfg(any(target_os = "android", target_os = "gonk"))]
pub struct GpuProfile;

impl GpuProfile {
#[cfg(not(any(target_os = "android", target_os = "gonk")))]
pub fn new() -> GpuProfile {
let queries = gl::gen_queries(4);

@@ -714,11 +719,21 @@ impl GpuProfile {
}
}

#[cfg(any(target_os = "android", target_os = "gonk"))]
pub fn new() -> GpuProfile {
GpuProfile
}

#[cfg(not(any(target_os = "android", target_os = "gonk")))]
pub fn begin(&mut self) {
let qid = self.gl_queries[self.active_query];
gl::begin_query(gl::TIME_ELAPSED, qid);
}

#[cfg(any(target_os = "android", target_os = "gonk"))]
pub fn begin(&mut self) {}

#[cfg(not(any(target_os = "android", target_os = "gonk")))]
pub fn end(&mut self) -> u64 {
gl::end_query(gl::TIME_ELAPSED);

@@ -745,6 +760,9 @@ impl GpuProfile {
0
}
}

#[cfg(any(target_os = "android", target_os = "gonk"))]
pub fn end(&mut self) -> u64 { 0 }
}

impl Drop for GpuProfile {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.