1. 21 Jan, 2021 6 commits
    • Mend git merge history for SPIRV-Headers and SPIRV-Tools · d79f17cf
      Ben Clayton authored
      https://swiftshader-review.googlesource.com/c/SwiftShader/+/50749
      squashed together the changes from two `git subtree pull` commands (for
      SPIRV-Headers and SPIRV-Tools), which resulted in a change with a single
      parent.
      
      `git subtree` expects a merge commit with a single set of `git-subtree-*`
      metadata tags. The squash resulted in a change description with two sets
      of these, confusing `git subtree` even further.
      
      The process to fix this is probably not the easiest, but the first one I found that works:
      
        # Rollback to the parent change of 50749
        git checkout 43bb60e1
        # Perform the subtree pull again for SPIRV-Headers (to 104ecc356)
        git subtree pull --prefix third_party/SPIRV-Headers https://github.com/KhronosGroup/SPIRV-Headers 104ecc356c1bea4476320faca64440cd1df655a3 --squash -m "Update SPIR-V Headers"
        # Note the second parent of the merge for the SPIRV-Headers (Merge: 43bb60e1 ded361b4)
        git show -1
        # Perform the subtree pull again for SPIRV-Tools (to b0e22d28f)
        git subtree pull --prefix third_party/SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools b0e22d28f5ec891d6b256703575d08fce4228bd9 --squash -m "Update SPIR-V Tools"
        # Note the second parent of the merge for the SPIRV-Tools (Merge: a00ce432a9d bdb9eea9)
        git show -1
        # Jump back to master
        git checkout origin/master
        # Revert 50749
        git revert 9dff6a3b
        # Re-merge the squashed update change for SPIRV-Headers  ** this change **
        git merge -Xsubtree="third_party/SPIRV-Headers" ded361b4
        # Re-merge the squashed update change for SPIRV-Tools
        git merge -Xsubtree="third_party/SPIRV-Tools" bdb9eea9
      
      Bug: b/174239232
      Change-Id: Ibab851eb610b1448193f57a628eb95bdb58057ee
    • Revert 9dff6a3b to mend git merge history for SPIRV-Headers and SPIRV-Tools · 24d6bf7f
      Ben Clayton authored
      https://swiftshader-review.googlesource.com/c/SwiftShader/+/50749
      squashed together the changes from two `git subtree pull` commands (for
      SPIRV-Headers and SPIRV-Tools), which resulted in a change with a single
      parent.
      
      `git subtree` expects a merge commit with a single set of `git-subtree-*`
      metadata tags. The squash resulted in a change description with two sets
      of these, confusing `git subtree` even further.
      
      The process to fix this is probably not the easiest, but the first one I found that works:
      
        # Rollback to the parent change of 50749
        git checkout 43bb60e1
        # Perform the subtree pull again for SPIRV-Headers (to 104ecc356)
        git subtree pull --prefix third_party/SPIRV-Headers https://github.com/KhronosGroup/SPIRV-Headers 104ecc356c1bea4476320faca64440cd1df655a3 --squash -m "Update SPIR-V Headers"
        # Note the second parent of the merge for the SPIRV-Headers (Merge: 43bb60e1 ded361b4)
        git show -1
        # Perform the subtree pull again for SPIRV-Tools (to b0e22d28f)
        git subtree pull --prefix third_party/SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools b0e22d28f5ec891d6b256703575d08fce4228bd9 --squash -m "Update SPIR-V Tools"
        # Note the second parent of the merge for the SPIRV-Tools (Merge: a00ce432a9d bdb9eea9)
        git show -1
        # Jump back to master
        git checkout origin/master
        # Revert 50749
        git revert 9dff6a3b
        # Re-merge the squashed update change for SPIRV-Headers
        git merge -Xsubtree="third_party/SPIRV-Headers" ded361b4
        # Re-merge the squashed update change for SPIRV-Tools
        git merge -Xsubtree="third_party/SPIRV-Tools" bdb9eea9
      
      Bug: b/174239232
      Change-Id: I0b498184493f0fcb00b1684182b6a89076a5cca0
    • Squashed 'third_party/SPIRV-Headers/' changes from 7845730cab6..104ecc356c1 · ded361b4
      Ben Clayton authored
      104ecc356c1 Merge pull request #180 from dneto0/issue-179
      93effe16473 MeshShadingNV enables builtins PrimitiveId, Layer, and ViewportIndex
      4de110ce1c7 Merge pull request #182 from dgkoch/khr_rt_final
      6323756078a de-alias/reassign OpIgnoreIntersectionKHR/OpTerminateRayKHR
      928a192ee62 Raytracing and Rayquery updates for final
      eb5e409129c Updated headers for new trace/executeCallable and acceleration structure cast.
      5ab5c96198f Reserve additional loop control bit for Intel extension (NoFusionINTEL) (#175)
      793f9199bed Add EmbarkStudios/rust-gpu to vendor list. (#174)
      
      git-subtree-dir: third_party/SPIRV-Headers
      git-subtree-split: 104ecc356c1bea4476320faca64440cd1df655a3
    • Target macOS 10.12 when building LLVM · 5b36fbc5
      Nicolas Capens authored
      When enabling C++17, LLVM uses std::shared_mutex instead of its own
      implementation. On macOS it requires version 10.12 (Sierra), while
      Chrome must still support 10.11. However, we don't need LLVM as Reactor
      backend, except for ARM64, but Mac devices with such CPU have a more
      recent OS version.
      
      llvm-10.0/llvm/include/llvm/Support/RWMutex.h:100:8: error: 'shared_mutex' is unavailable: introduced in macOS 10.12
      
      Bug: b/174843857
      Change-Id: Ie24095aa17d22072cfb9d655b87252cbea5209d0
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52030Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Use aligned allocation for classes with aligned members · 532770bb
      Nicolas Capens authored
      The legacy PixelProcessor and VertexProcessor classes for OpenGL ES
      contain member fields with types like float4, which require 16-byte
      alignment. This isn't guaranteed by the compiler until C++17. On macOS,
      this also requires OS support, which was added in version 10.14
      (Mojave), while Chrome still has to support macOS 10.11.
      
      src/Renderer/PixelProcessor.cpp:75:18: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
      
      Overriding new and delete for these classes allows us to use our custom
      allocator which guarantees alignment. Note that the Renderer class
      already used the same approach. Also note that this hasn't caused issues
      before because these fields aren't actually accessed by instructions
      which demand alignment. However, it's still good for performance and to
      align with the intent (pun intended).
      
      Bug: b/174843857
      Change-Id: Ia5de5f6fe67a4f54805cdde3fed565c30b9318a8
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52029Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Enable and require C++17 compilation · b3e5c440
      Nicolas Capens authored
      Updates build files to specify using the C++17 standard.
      
      Add a usage of the C++17 exclusive [[maybe_unused]] attribute as a test.
      Also unconditionally use <filesystem> in Reactor unit tests.
      
      C++17 deprecates things like std::unary_function<>, which were present
      in Subzero's LLVM headers, but the functionality was unused so it has
      been deleted.
      
      Bug: b/174843857
      Bug: b/155971541
      Change-Id: Ib167726535399b0b12751a3d93feaa9db762cd5d
      Signed-off-by: 's avatarNicolas Capens <capn@google.com>
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51948Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
  2. 20 Jan, 2021 4 commits
  3. 19 Jan, 2021 1 commit
  4. 18 Jan, 2021 2 commits
  5. 15 Jan, 2021 2 commits
  6. 14 Jan, 2021 2 commits
  7. 13 Jan, 2021 5 commits
  8. 11 Jan, 2021 3 commits
  9. 10 Jan, 2021 1 commit
  10. 08 Jan, 2021 5 commits
  11. 07 Jan, 2021 3 commits
  12. 05 Jan, 2021 1 commit
  13. 30 Dec, 2020 1 commit
    • Add support for Vulkan12Properties · ff29e249
      Sean Risser authored
      VkPhysicalDeviceVulkan12Properties was added to the core spec by Vulkan
      1.2. It allows users to query the following properties simultaneously:
          * VkPhysicalDeviceDriverProperties
          * VkPhysicalDeviceFloatControlsProperties
          * VkPhysicalDeviceDescriptorIndexingProperties
          * VkPhysicalDeviceDepthStencilResolveProperties
          * VkPhysicalDeviceSamplerFilterMinmaxProperties
          * VkPhysicalDeviceTimelineSemaphoreProperties
          * and framebufferIntegerColorSampleCounts
      
      All these structs are a part of the core spec and must be supported.
      
      Bug: b/176498010
      Change-Id: I82b06f219d2ee091139964ee8b19f05e1c64e3a8
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51408
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarSean Risser <srisser@google.com>
      Commit-Queue: Sean Risser <srisser@google.com>
  14. 17 Dec, 2020 2 commits
    • Optimize reciprocal sqrt operation · 1cc5b335
      Antonio Maiorano authored
      This change deprecates rr::RcpSqrt_pp with rr::RcpSqrt. As with Rcp,
      RcpSqrt computes the result using Newton-Rhapson if it's faster and the
      initial approximation intrinsic is available on the current target.
      Currently, only LLVM on Intel will use NR for RelaxedPrecision. Note
      that passing in Precision::Relaxed will produce a faster, but less
      precise reciprocal sqrt.
      
      Also made it so that SprivShader instruction GLSLstd450InverseSqrt now
      invokes RcpSqrt(x, Precision::Full) instead of performing 1/sqrt(x).
      Note that the Vulkan spec states that inversesqrt()'s precision is 2
      ULP, and sqrt()'s precision is inherited from 1.0 / inversesqrt();
      however, our rr::Sqrt is implemented in terms of x86's sqrt intrinsic on
      x86, or as calls to sqrt from Math.h.
      
      Bug: b/169760262
      Change-Id: I65ba9a64d1db934c523dda11c1a2c186059d220b
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51268
      Commit-Queue: Antonio Maiorano <amaiorano@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    • Optimize reciprocal operation · d1561871
      Antonio Maiorano authored
      This change deprecates rr::Rcp_pp with rr::Rcp, which makes sure to
      correctly compute the reciprocal using the Newton-Rhapson refinement
      only if the current target supports the required instrinsic, otherwise
      using 1 / x. Currently, only LLVM on Intel will use NR. Note that
      passing in Precision::Relaxed will produce a faster, but less precise
      reciprocal.
      
      Also removed PixelProgram::linearToSRGB as it's unused.
      
      Bug: b/169760262
      Bug: b/149574741
      Change-Id: I4a2f943aa60116c4397d7a8ae18583a260824788
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50648Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Commit-Queue: Antonio Maiorano <amaiorano@google.com>
  15. 15 Dec, 2020 1 commit
  16. 14 Dec, 2020 1 commit