1. 30 Oct, 2020 1 commit
  2. 29 Oct, 2020 4 commits
  3. 28 Oct, 2020 1 commit
  4. 26 Oct, 2020 1 commit
  5. 24 Oct, 2020 2 commits
  6. 23 Oct, 2020 1 commit
  7. 22 Oct, 2020 1 commit
    • Update VkStringify to use vulkan.hpp to_string · 8012e624
      Sean Risser authored
      Rather than occasionally updating VkStringify's table to match
      vulkan_core.h, we can use vulkan.hpp's to_string functions to get us the
      name of structure types.
      
      vulkan.hpp is such a burdensome file that it makes more sense to only
      include it in VkStringify.cpp instead of including it everywhere that
      looks at a structure extension list. And since vulkan.hpp uses its own
      equivalent equivalent types for every Vk* object, every place that calls
      vkhpp::to_string would have to do some clunky static_cast.
      
      I think in the long run, it's easier to maintain vulkan.hpp if we don't
      use it directly in our core files.
      
      Bug: b/170962162
      Change-Id: Ib0380eaba4d05d9d5127fb0569efa6ef88d0156b
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49368
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarSean Risser <srisser@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
  8. 21 Oct, 2020 4 commits
  9. 20 Oct, 2020 2 commits
  10. 16 Oct, 2020 2 commits
    • Make abort on LOG_TRAP opt-in · df17a761
      Sean Risser authored
      A developer can change SWIFTSHADER_LOG_LEVEL to Debug or Verbose to make
      LOG_TRAP abort when a debugger is attached. This keeps debugging easy in
      most circumstances where devs don't care about unsupported struct
      extensions. But it still allows devs to go right to where an unsupported
      structure is being used if they so desire.
      
      Bug: b/169868497
      Change-Id: I916506ee557f8de01516fe4efb33044c2367db77
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49288Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarSean Risser <srisser@google.com>
    • MetalSurface: correctly handle the window resizing. · a23231ea
      Corentin Wallez authored
      In metal the size of the drawable (the texture use to render to the
      window) is decoupled from the window's size:
      
       - When the first drawable is created, its size is given by
         layer.bounds.size * layer.contentsScale.
       - Once set the drawableSize never changes without the user setting the
         layer.drawableSize explicitly.
      
      This means that the code checking for OUT_OF_DATE_KHR needs to be
      updated to check the texture size against the drawable's size (and not
      the current scaled window size).
      
      Also Swiftshader needs to set the drawableSize to the correct value when
      the window is resized. The best moment to do this is when querying the
      capabilities as that's done when a new swapchain is created (which
      happens when the application is handling the window's resize).
      
      Bug: dawn:269
      Change-Id: Icf1c3df63d42e0fa9211893f6b89d8709dfd942e
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49328Tested-by: 's avatarCorentin Wallez <cwallez@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
  11. 15 Oct, 2020 2 commits
  12. 14 Oct, 2020 3 commits
  13. 11 Oct, 2020 1 commit
  14. 10 Oct, 2020 2 commits
  15. 09 Oct, 2020 4 commits
    • Fix depth bias calculations · 0aca3ca9
      Nicolas Capens authored
      We were simply adding the constant depth bias to the z coordinate,
      instead of interpreting it as relative to the minimum resolvable
      difference. In the legacy OpenGL ES code stack we're multiplying it by
      2^-23, but this assumes a 32-bit floating-point depth format, while
      Vulkan must also support 16-bit integer depth, and doesn't take the
      exponent of the z values of the polygon into account.
      
      This change fixes the issue for both integer depth formats, which have a
      constant minimum resolvable difference, and floating-point depth
      formats, where the maximum exponent of the z values is used to determine
      the minimum resolvable difference per polygon.
      
      The viewport's depth range transform was corrected to be performed
      before the depth bias offset.
      
      Also the depth bias clamp operation was corrected to be performed only
      on the bias value, not the polygon's z value for vertex 0.
      
      We were also converting scalars to vectors a bit earlier than necessary,
      so this was refactored to happen later to simplify the calculations.
      
      The bias is added per fragment, after z interpolation, instead of being
      added to the 'C' factor of the plane equation. That's because we compute
      'y * B + C' per row, and then add 'x * A' per fragment. When the bias is
      included in 'C', the additions cause loss of precision greater than the
      minimum resolvable difference, and dEQP-GLES3.functional.polygon_offset
      fails because it uses a 'units' depth bias of 1.
      
      Note this change is intentionally unoptimized, to serve as a spec-
      compliant reference implementation. dEQP has poor test coverage for this
      functionality so we need to start off with something that is easy to
      reference against the spec.
      
      Bug: b/139341727
      Fixes: b/160463658
      Change-Id: Ief1dd609d8ac974e76b1b785a924b09b448297a2
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48629
      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>
    • Move interpolant clamping out of interpolate() · e8ce1f83
      Nicolas Capens authored
      Vulkan never clamps interpolants, except for depth values (specifically
      for fixed-point formats, and for floating-point formats when the
      unrestricted depth extension is not enabled).
      
      This change moves the clamping operation out of interpolate(), which
      makes it easier to see depth clamping being performed when necessary,
      and will facilitate changes in applying depth bias.
      
      Bug: b/139341727
      Change-Id: I8cef29d63fef00308ef2f813b4feb687c83baa86
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49148
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarSean Risser <srisser@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • SpirvShaderDebugger: Fix store() of arrays · 51b03d58
      Ben Clayton authored
      ```
      template<typename T, std::size_t N>
      void store(const rr::RValue<rr::Pointer<rr::Byte>> &ptr, const std::array<T, N> &val)
      ```
      
      was completely broken as it was using `sizeof(T)` for element offsets.
      All uses of this overload use Reactor values for T, and so `sizeof(T)` evaluates to the size of the compiler type, not the runtime data type.
      
      Also remove the useless `for(int i = 0; i < N; i++)` in `buildGlobal()`.
      This iterator isn't used, so we're just doing the same calls to `put()` `N` times.
      
      Bug: b/170383642
      Change-Id: I9ba9efce07e886087124118122de56a4d31c5503
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49129
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarBen Clayton <bclayton@google.com>
    • SpirvShaderDebugger: Improve ASSERT() messages · 19612714
      Ben Clayton authored
      DXC is producing duplicate definitions for local variables.
      Give more context in the `ASSERT()` so it's easier to diagnose whats going wrong.
      
      Bug: b/170378370
      Change-Id: Ic8c8f24a6dbd8ce23e04eb4f0265363b44bc174c
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49128
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarBen Clayton <bclayton@google.com>
  16. 08 Oct, 2020 1 commit
  17. 07 Oct, 2020 1 commit
  18. 06 Oct, 2020 3 commits
  19. 05 Oct, 2020 4 commits