1. 04 Apr, 2018 1 commit
  2. 03 Apr, 2018 5 commits
    • Fix potential bad access in LinkProgram. · 6bc264ae
      Jamie Madill authored
      This could happen when linking a program with missing attachments
      and shaders that have no compiled sources.
      
      Also re-enables the EGL program cache control tests, which were
      disabled due to a wrong extension name check.
      
      Bug: chromium:827158
      Change-Id: I181f878093c6e3a4acc51552ade8e7c084733a3d
      Reviewed-on: https://chromium-review.googlesource.com/989262Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
      Commit-Queue: Jamie Madill <jmadill@chromium.org>
    • Collect static use information during parsing · 94bbed1e
      Olli Etuaho authored
      We now collect metadata for variables in the symbol table. The
      metadata is stored in a map using the variable unique id as a key, so
      we can store the variables themselves as constexpr while still having
      dynamic metadata.
      
      For now we collect whether a variable is statically read or written.
      This can be used to more accurately determine whether a variable is
      statically used, but can also enable more optimizations in the future,
      such as pruning variables that are never read or folding variables
      that are never written after initialization. The collection is done
      during parsing, so that nothing is pruned from the AST before the
      static use is recorded.
      
      Static writes are flagged in ParseContext::checkCanBeLValue, as that
      function is already called for all variables that are written.
      
      Static reads are flagged whenever there's an operation that requires
      a variable to be read. This includes:
      * Unary and binary math ops
      * Comma ops
      * Ternary ops
      * Assignments
      * Returning the variable
      * Passing the variable as an in or inout argument to a function
      * Using the variable as a constructor argument
      * Using the variable as an if statement condition
      * Using the variable as a loop condition or expression
      * Using the variable as an index
      * Using the variable as a switch statement init expression
      
      In case there are statements that simply refer to a variable without
      doing operations on it, the variable is being treated as statically
      read. Examples of such statements:
      
      my_var;
      my_arr[2];
      
      These are a bit of a corner case, but it makes sense to treat them as
      static use for validation purposes.
      
      Collecting correct static use information costs us a bit of compiler
      performance, but the regression is on the order of just a few percent
      in the compiler perf tests.
      
      BUG=angleproject:2262
      TEST=angle_unittests, angle_end2end_tests
      
      Change-Id: Ib0d7add7e4a7d11bffeb2a4861eeea982c562234
      Reviewed-on: https://chromium-review.googlesource.com/977964Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
      Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    • Avoid mangled name comparisons of 3-parameter functions · 89398b65
      Olli Etuaho authored
      The hash values used for looking up built-ins now encode whether the
      mangled name contains arrays, structs or interface blocks in its
      parameters list. This is written in the most significant bit of the
      hash value.
      
      We check this bit at the start of built-in lookup and if the bit is
      set we exit early. After that we know that the lookup name doesn't
      contain array, struct or interface block parameters.
      
      When we find a hash that matches a hash of a built-in function, we now
      know 3 things:
      1) the length of the mangled name matches
      2) the open parentheses in the mangled name matches
      3) the lookup doesn't contain array, struct or block parameters.
      
      Additionally, we have an if statement checking whether the function
      name matches. Collisions are only possible with functions that
      1) have the same name
      2) have the same number of parameters
      
      With these preconditions we can check beforehand whether collisions
      are possible for 3-parameter functions. If there are no collisions, we
      don't need to compare the full mangled name. This is similar to what
      was already being done with functions that had 0 to 2 parameters.
      
      This reduces shader_translator binary size by around 4 KB on Windows.
      
      Besides increased complexity, the tradeoff is that an exhaustive
      search of hash values for possible 3-parameter combinations is costly,
      so the gen_builtin_functions.py code generation script now takes
      around one minute to run on a high-end workstation. Due to this, the
      script now exits early if it detects it has already been run with the
      same inputs based on a hash value stored in
      builtin_symbols_hash_autogen.txt.
      
      BUG=angleproject:2267
      BUG=chromium:823856
      TEST=angle_unittests
      
      Change-Id: I3ff8c6eb85b90d3c4971ac8d73ee171a07a7e55f
      Reviewed-on: https://chromium-review.googlesource.com/973372Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
      Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    • Fix conditions for updating element array buffer. · 5d232d53
      Frank Henigman authored
      It was skipping elementArrayBufferOverride->onReadResource()
      if mCurrentElementArrayBufferResource was null.
      
      BUG=angleproject:2389
      
      Change-Id: If33a11d35225daf572796abc8c18f6d6df758b48
      Reviewed-on: https://chromium-review.googlesource.com/989408
      Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
      Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
    • Check that transform feedback will not overflow its buffers. · 30b604d8
      James Darpinian authored
      Also fix the check for uniform buffer size to use the actual buffer
      size instead of the size of the bound range.
      
      Bug: 820639
      Change-Id: Iaa2a617ee7ce5ce7cfabbf64bd1d6f8c82c46b65
      Reviewed-on: https://chromium-review.googlesource.com/965627
      Commit-Queue: James Darpinian <jdarpinian@chromium.org>
      Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
  3. 02 Apr, 2018 1 commit
  4. 30 Mar, 2018 3 commits
  5. 29 Mar, 2018 7 commits
  6. 28 Mar, 2018 9 commits
  7. 27 Mar, 2018 14 commits