-
Notifications
You must be signed in to change notification settings - Fork 791
servo: android hardware rendering and refactor #10201
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
base: master
Are you sure you want to change the base?
Changes from all commits
da16c24
8fb53c0
eb32bed
ec07860
bf4cc19
457b65a
0e1f2f2
e3474af
881163b
515a842
b41b71d
ebabf4f
1f493c6
01e4ec4
b83c59a
4ecda44
8cd711c
db989ec
d427263
3f1577c
d666278
88b9812
d198c1b
75a6cf9
ef08457
a44d2ce
2ec55d8
34bcb4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,8 @@ use std::fs::File; | |
| use std::io::Write; | ||
| use std::path::Path; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| use gl_generator::{Api, Fallbacks, Profile, Registry, StructGenerator}; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| extern crate gl_generator; | ||
|
|
||
| fn main() { | ||
|
|
@@ -18,16 +16,21 @@ fn main() { | |
| let out = env::var("OUT_DIR").unwrap(); | ||
| let out = Path::new(&out); | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); | ||
|
|
||
| { | ||
| let mut file = File::create(&out.join("gl_bindings.rs")).unwrap(); | ||
|
|
||
| // Config copied from https://github.com/YaLTeR/bxt-rs/blob/9f621251b8ce5c2af00b67d2feab731e48d1dae9/build.rs. | ||
|
|
||
| let api = if target_os == "android" { Api::Gles2 } else { Api::Gl }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this code, the decision is "sort of" made at run-time by comparing strings. However, this can be done at compile-time, using either Given that either branch is compilable, I think this should be written like this: let api = if cfg!(target_os = "android") { ... } else { ... };That said, I wonder if we can get away with just OpenGL ES 3.0 everywhere. On Android and Linux Embedded that'll be preferred. On Windows I thought servo is using angle, so that's also OpenGL ES. @expenses I'm unsure, but is there perhaps a reason to use "Desktop GL" over GLES here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not too familiar with the different OpenGL versions. I believe that if we're only using the GLES feature set and nothing exclusive to Desktop GL then using GLES everywhere is fine. |
||
| let version = if target_os == "android" { (3, 0) } else { (4, 6) }; | ||
| let profile = if target_os == "android" { Profile::Core } else { Profile::Compatibility }; | ||
|
|
||
| Registry::new( | ||
| Api::Gl, | ||
| (4, 6), | ||
| Profile::Compatibility, | ||
| api, | ||
| version, | ||
| profile, | ||
| Fallbacks::All, | ||
| [ | ||
| "GL_EXT_memory_object", | ||
|
|
@@ -42,10 +45,6 @@ fn main() { | |
| .unwrap(); | ||
| } | ||
|
|
||
| // Note: We can't use `#[cfg(windows)]`, since that would check the host platform | ||
| // and not the target platform | ||
| let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); | ||
|
|
||
| // On MacOS, all dylib dependencies are shipped along with the binary | ||
| // in the "/lib" directory. Setting the rpath here, allows the dynamic | ||
| // linker to locate them. See `man dyld` for more info. | ||
|
|
||
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 comment isn't very clear to me
Uh oh!
There was an error while loading. Please reload this page.
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.
Ah its not related to vulkan or hardware rendering any way its just whenever i update servo revision to new version and run cargo update it update its internal dependencies to new version which conflict sometimes and making build to failed that why i added it here so all servo dependencies use this specific version.