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
Add missing Sync related functions #2
Conversation
src/lib.rs
Outdated
@@ -1443,6 +1443,20 @@ pub mod gl { | |||
}; | |||
} | |||
|
|||
pub fn get_sync_iv(&self, sync: GLsync, pname: GLenum, buf_size: GLsizei, length: &mut GLsizei, values: &mut [GLint]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unsafe
because the caller can provide an array that too small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! I will update the PR with the changes you mentioned. Thank you!
src/lib.rs
Outdated
}; | ||
} | ||
|
||
pub fn is_sync(&self, sync: GLsync) -> GLboolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this return bool
like the other is_foo methods.
src/lib.rs
Outdated
Gl::Gles(gles) => unsafe { gles.ClientWaitSync(sync as *const _, flags, timeout) }, | ||
}; | ||
Gl::Gl(gl) => unsafe { gl.ClientWaitSync(sync as *const _, flags, timeout) as GLenum }, | ||
Gl::Gles(gles) => unsafe { gles.ClientWaitSync(sync as *const _, flags, timeout) as GLenum }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the cast here necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is not, I will remove the cast.
This patch adds missing functions for the GLsync. Reference: https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf#section.5.2
This patch adds missing functions for the GLsync.
Reference: https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf#section.5.2