Closed Bug 1632444 Opened 4 years ago Closed 4 years ago

Wrong version of shaders are being optimized for cross compiled builds

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox-esr68 --- unaffected
firefox75 --- unaffected
firefox76 --- unaffected
firefox77 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

In bug 1631778, I attempted to mitigate bug 1604615's installer size regression by only optimizing GL or GLES shaders, depending on the target platform. The intention was for Windows and Android builds we'd optimize GLES shaders, and for other builds we'd optimize GL shaders.

However, I used cfg!(target_os = "android") || cfg!(target_os = "windows") to detect the platform. But since this is being ran in a build script, and we are cross compiling these builds, it actually detects the host OS rather than the target OS. This resulted in us optimizing GL shaders for these builds, then at runtime we would be unable to find the optimized GLES shaders, and fall back to unoptimized shaders.

This unfortunately undid the nice win we got from bug 1604615 in the first place: https://treeherder.mozilla.org/perf.html#/graphs?highlightAlerts=1&series=autoland,2134897,1,10&timerange=1209600&zoom=1587394468959,1587644111241,1138.3322095195642,1741.5375737033658

It looks like I should be using env::var("CARGO_CFG_TARGET_OS") instead.

A previous patch attempted to optimize only GL or GLES shaders,
depending on the target platform. However, it was trying to detect the
platform by using cfg!(target_os = {}), but as this is in a
build script that actually detects the host platform instead. This
resulted in the wrong version of shaders being optimized, and
therefore falling back to unoptimized shaders at runtime.

This fix uses env::var("CARGO_CFG_TARGET_OS") instead, which works
correctly in build scripts.

Pushed by jnicol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/17a4926b6c65
Correctly detect target OS when deciding what shaders to optimize. r=jrmuizel
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: