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

Fix missing optimized shaders on OpenHarmony #4856

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions webrender/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ fn write_optimized_shaders(

// The full set of optimized shaders can be quite large, so only optimize
// for the GL version we expect to be used on the target platform. If a different GL
// version is used we will simply fall back to the unoptimized shaders.
let shader_versions = match env::var("CARGO_CFG_TARGET_OS").as_ref().map(|s| &**s) {
Ok("android") | Ok("windows") => [ShaderVersion::Gles],
// version is used we will simply fall back to the unoptimized shaders.
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("Cargo error");
let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("Cargo error");
let shader_versions = match (target_os.as_str(), target_env.as_str()) {
("android", _) | ("windows", _) | ("linux", "ohos") => [ShaderVersion::Gles],
_ => [ShaderVersion::Gl],
};

Expand Down
2 changes: 1 addition & 1 deletion wrench/src/test_shaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn test_varying_explicit_precision(

pub fn test_shaders() {
let mut flags = ShaderFeatureFlags::all();
if cfg!(any(target_os = "windows", target_os = "android")) {
if cfg!(any(target_os = "windows", target_os = "android", target_env = "ohos")) {
flags.remove(ShaderFeatureFlags::GL);
} else {
flags.remove(ShaderFeatureFlags::GLES);
Expand Down
Loading