We have encountered issues on some platforms due to a large number of
if statements in shaders. The shader optimizer previously generated
code with a large number of if statements, due to the way in which it
optimized switch statements.
Previously the optimizer output 2 if statements for every case in a
switch. First it ORs the "fallthrough" var with the case's
condition. Then sets the fallthrough var to false if the "break" var
is true. Then conditionally executes the case's instructions if
fallthrough is true. For example:
switch (uMode) {
case 0:
gl_Position = vec4(0.0);
break;
case 1:
gl_Position = vec4(1.0);
break;
}
becomes:
bool break_var = bool(0);
bool fallthrough_var = (0 == uMode);
if (break_var) fallthrough_var = bool(0);
if (fallthrough_var) {
gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
break_var = bool(1);
};
fallthrough_var = (fallthrough_var || (1 == uMode));
if (break_var) fallthrough_var = bool(0);
if (fallthrough_var) {
gl_Position = vec4(1.0, 1.0, 1.0, 1.0);
break_var = bool(1);
};
This update removes one of these ifs, by ANDing the fallthrough_var
with !break_var rather than conditionally setting it to false. eg:
bool break_var = bool(0);
bool fallthrough_var = (0 == uMode);
if (fallthrough_var) {
gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
break_var = bool(1);
};
fallthrough_var = (fallthrough_var || (1 == uMode));
fallthrough_var = (fallthrough_var && !(break_var));
if (fallthrough_var) {
gl_Position = vec4(1.0, 1.0, 1.0, 1.0);
break_var = bool(1);
};
This is logically equivalent but uses half as many if statements,
which helps to avoid driver bugs on some platforms.
Differential Revision: https://phabricator.services.mozilla.com/D103713
Bumps version to
3011a2b923c8b0f1b392bcdd008cd8b95ffd846b
This is done to fix a bug where parsing bad metadata in the userdata (udta)
would be fatal when we should instead just fail the userdata.
This also updates some mp4parse-rust dependencies which results in some
removals.
Differential Revision: https://phabricator.services.mozilla.com/D102997
Bumps version to
3011a2b923c8b0f1b392bcdd008cd8b95ffd846b
This is done to fix a bug where parsing bad metadata in the userdata (udta)
would be fatal when we should instead just fail the userdata.
This also updates some mp4parse-rust dependencies which results in some
removals.
Differential Revision: https://phabricator.services.mozilla.com/D102997
Pull in a number of new SIMD opcodes, and a change from iNxM.any_true
to v128.any_true. Plus whatever else has landed in the mean time...
Differential Revision: https://phabricator.services.mozilla.com/D102398
Now that we use an external dump_syms, we don't need to build
breakpad's.
This means we also don't need the dump_syms_rust_demangle crate anymore.
Differential Revision: https://phabricator.services.mozilla.com/D101865
The new version contains
- A bug fix for the bucketed allocator (we don't currently use it)
- A few fixes that can happen when requesting large enough allocation sizes to cause integer overflows. At the moment we never request an allocation larger than 512px so we are safe but it's still good to stay up to date.
Differential Revision: https://phabricator.services.mozilla.com/D101608
Fixes errors like:
dependency (nix) specification is ambiguous. Only one of `branch`, `tag` or `rev` is allowed.
I've left the most specific dependency, but for wgpu the rev is not
right, so I've kept the branch which effectively preserves behavior.
Differential Revision: https://phabricator.services.mozilla.com/D100485
This isn't very systematic as I'm not sure the best approach for that
yet. That being said, this captures the bulk of the autoreleases without
that happen without a pool.
Differential Revision: https://phabricator.services.mozilla.com/D100363