gecko-dev/third_party
Jamie Nicol abab286bf9 Bug 1689316 - Update glslopt to optimize shader switch statements in to fewer ifs. r=jrmuizel
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
2021-02-01 21:14:15 +00:00
..
WinToast Bug 1672957 Do not create or modify a shortcut for the WDBA. r=bytesized 2020-12-07 23:20:53 +00:00
aom
cups Bug 1653433 Part 1 - Import CUPS headers r=jwatt,froydnj,mhoye 2020-07-21 23:39:42 +00:00
dav1d Bug 1680396 - Update libdav1d to 0.8.1 for Firefox 87. r=mjf 2021-01-26 18:50:21 +00:00
js/d3 Bug 1648858 - Move d3.js from devtools/ to third_party/js/. r=mossop 2020-07-03 08:25:51 +00:00
libwebrtc Bug 1678680 [PipeWire] Lock current_frame_ access as it can be used from multiple threads, r=dminor 2020-11-30 12:28:42 +00:00
msgpack
pipewire Bug 1672945 Ship PipeWire 0.3 headers and library wrapper to build PW support out of the box, r=dminor 2020-10-29 22:15:32 +00:00
prio
python Bug 1680802: Bump vendored virtualenv package r=firefox-build-system-reviewers,sheehan,glandium 2021-01-05 20:09:38 +00:00
rlbox Bug 1683054 - Update RLBox to address template specialization bug for signed char type r=tjr 2021-01-15 21:28:36 +00:00
rust Bug 1689316 - Update glslopt to optimize shader switch statements in to fewer ifs. r=jrmuizel 2021-02-01 21:14:15 +00:00
sipcc Bug 1677590: improved SDP parser error handling. r=ng 2021-01-06 15:25:06 +00:00
sqlite3 Bug 1687812 - Upgrade to SQLite 3.34.1. r=mak 2021-01-20 21:02:16 +00:00
webkit/PerformanceTests Bug 1659116 - Update webaudio-benchmarks to e09b852. r=dmajor DONTBUILD 2020-09-28 13:50:42 +00:00
moz.build Bug 1674312 Add pipewire directory to WebRTC component, r=dminor 2020-10-30 14:40:53 +00:00