1. 12 Nov, 2020 3 commits
    • Handle image properties from external device memory · f29e2bf7
      Jason Macnak authored
      Some external device memories really represent existing images
      with requirements and not just memory blobs. For AHB, we want
      to use the stride from the gralloc buffer.
      
      Bug: b/141698760
      Bug: b/147316305
      Test: launch_cvd && cts -m CtsDeqpTestCases
        dEQP-VK.api.external.memory.android_hardware_buffer.*
      Change-Id: If657c91e458545b58d1d3b0f15f807ca9828b09c
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50068
      Presubmit-Ready: Jason Macnak <natsu@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarJason Macnak <natsu@google.com>
    • Fix conditionally enabling Reactor MSan instrumentation · 1a8935a4
      Nicolas Capens authored
      The LLVM MemorySanitizer pass was added for -fsanitizer=memory builds
      when REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION is defined, but
      LLVMJIT.cpp includes LLVMReactor.hpp, which in turn includes Reactor.hpp
      which defines REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION to 0 if
      not previously defined, which will always enable it.
      
      Use #if instead of #ifdef to conditionally enable instrumentation based
      on REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION's value.
      
      Bug: b/155148722
      Change-Id: I337832d942fcc576afac4d0c1d89c9fa42974cbe
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50288
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    • Implement MemorySanitizer instrumentation of Reactor routines · 4804ac87
      Nicolas Capens authored
      MemorySanitizer checks for uninitialized memory and variable usage. It
      instruments each instruction to update 'shadow' memory which indicates
      which bits are 'poisoned', and inserts tests for dereferencing pointers
      and conditional branching which makes use of not fully initialized data.
      
      The instrumentation is done by the llvm::MemorySanitizerLegacyPass.
      Functions must opt-in to the instrumentation with the 'SanitizeMemory'
      attribute.
      
      MemorySanitizer relies on several TLS variables for storing the shadow
      value of function parameters and return values. The JIT makes calls to
      __emutls_get_address() to obtain the address off these variables,
      passing it the address of a __emutls_v.* control structure unique to
      the TLS variable. We replace the former with our own function through
      the symbol resolver, and the latter are represented by enum values, to
      allow obtaining the real TLS variable's address in C++ code.
      
      This is enabled behind a REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION
      flag. For now, only enable CMake builds.
      
      Bug: b/155148722
      Change-Id: I6d755244589c9b0de19a283f9dff5d8a3bf6f24b
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49829
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
  2. 11 Nov, 2020 8 commits
  3. 10 Nov, 2020 1 commit
  4. 06 Nov, 2020 2 commits
  5. 05 Nov, 2020 6 commits
    • Merge changes I3c4f10f7,I5b7ddc75 · 612ded06
      Sean Risser authored
      * changes:
        Update SPIR-V Tools to a61d07a72
        Squashed 'third_party/SPIRV-Tools/' changes from f7da52775..a61d07a72
    • Fix Android.bp build after SPIRV-Tools update · 1a599631
      Nicolas Capens authored
      Bug: b/123642959
      Change-Id: I145adbd76fe04f0bdf9fb7ee4e581aaeaba5fccc
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50069Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
    • Subzero: fix invalid arg access on Windows x86 for split variables · 3476ca34
      Antonio Maiorano authored
      See the first bug I fixed related to this: 7fefd483.
      
      That bug fix ensured that arguments are accessed relative to 'ebp'
      rather than 'esp' on Windows x86. However, when an arg Variable gets
      split (see LocalVariableSplitter), the new Variable that's linked to the
      original arg Variable must also use 'ebp' in the same way. This is now
      fixed by making sure to set its "isArg" state to match that of the
      "linked stack root" Variable at the same time as we set its
      "stackOffset" in the same way. Thus, when stackVarToAsmOperand is called
      during emitIAS, split Variables are properly addressed using the correct
      frame pointer.
      
      See the detailed design doc:
      https://docs.google.com/document/d/1IBsWg2V9_arWGYkpuwlKdne4lkA6XwSQ8fp99l8BmnA
      
      This fixes the intermittent crash reported here:
      https://bugs.chromium.org/p/angleproject/issues/detail?id=4482#c15
      
      Bug: angleproject:4482
      Change-Id: Ibc089f3a5b9a44f40f130a3db8656011212d2983
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50008
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Subzero: fix non-deterministic stack layout and code-gen · f14f6c46
      Antonio Maiorano authored
      Using std::unordered_set to hold unmaterialized variables meant that
      when materializeAll was called, the order of variables would differ
      between runs of the same executable on the same target.
      
      Instead, we now use a map of Variable* to a monotonically increasing
      counter, allowing us to not only guarantee order-consistency across
      runs, but also means we can submit variables in the order they are
      declared, which may be preferable by the JIT backend.
      
      Note that this also affects LLVM; however, LLVM likely already performs
      stack variable reordering, so the effects are minimized. Nonetheless,
      this change likely also fixes determinism when using LLVM.
      
      Bug: angleproject:4482
      Bug: b/172365901
      Change-Id: I5698085ab96663b3c9a2fae4f01b1c1b3aac8b4b
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49949
      Presubmit-Ready: Antonio Maiorano <amaiorano@google.com>
      Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Update SPIR-V Tools to a61d07a72 · f95bac4e
      Sean Risser authored
      Changes:
          a61d07a72 spirv-val: Fix SPV_KHR_fragment_shading_rate VUID label (#4014)
          650acb575 spirv-val: Label Layer and ViewportIndex VUIDs (#4013)
          0c036df28 Add dead function elimination to -O (#4015)
          c2b2b5788 Add DebugValue for invisible store in single_store_elim (#4002)
          c74d5523b Fix SSA re-writing in the presence of variable pointers. (#4010)
          02195a029 spirv-fuzz: Fixes to pass management (#4011)
          bcf5b211d spirv-fuzz: Add support for reining in rogue fuzzer passes (#3987)
          7d250ed51 spirv-fuzz: Fix assertion failure in FuzzerPassAddCompositeExtract (#3995)
          f9937bcc8 spirv-fuzz: Fix invalid equation facts (#4009)
          aa6035f1c spirv-fuzz: Fix bugs in TransformationFlattenConditionalBranch (#4006)
          5735576f8 spirv-fuzz: Fix bug related to transformation applicability (#3990)
      
      Commands:
          ./third_party/update-spirvtools.sh
      
      Bug: b/123642959
      Change-Id: I3c4f10f78f63a75dcec8036a6a9488a82aebf84c
    • Squashed 'third_party/SPIRV-Tools/' changes from f7da52775..a61d07a72 · d2283f8e
      Sean Risser authored
      a61d07a72 spirv-val: Fix SPV_KHR_fragment_shading_rate VUID label (#4014)
      650acb575 spirv-val: Label Layer and ViewportIndex VUIDs (#4013)
      0c036df28 Add dead function elimination to -O (#4015)
      c2b2b5788 Add DebugValue for invisible store in single_store_elim (#4002)
      c74d5523b Fix SSA re-writing in the presence of variable pointers. (#4010)
      02195a029 spirv-fuzz: Fixes to pass management (#4011)
      bcf5b211d spirv-fuzz: Add support for reining in rogue fuzzer passes (#3987)
      7d250ed51 spirv-fuzz: Fix assertion failure in FuzzerPassAddCompositeExtract (#3995)
      f9937bcc8 spirv-fuzz: Fix invalid equation facts (#4009)
      aa6035f1c spirv-fuzz: Fix bugs in TransformationFlattenConditionalBranch (#4006)
      5735576f8 spirv-fuzz: Fix bug related to transformation applicability (#3990)
      
      git-subtree-dir: third_party/SPIRV-Tools
      git-subtree-split: a61d07a72763c1eb200de0a2c316703643a0d1d9
  6. 04 Nov, 2020 5 commits
  7. 03 Nov, 2020 4 commits
  8. 02 Nov, 2020 9 commits
  9. 30 Oct, 2020 2 commits