1. 05 May, 2021 3 commits
    • Implement VK_EXT_depth_clip_enable · 72b1f017
      Sean Risser authored
      Normally the vertex processor will clip geometry that's outside of the
      near and far planes. However, when depthClamp is enabled, depth clipping
      must be disabled. So this change also enables the extension that allows
      users to explicitly control depth clipping.
      
      Bug: b/185814882
      Tests: dEQP-VK.clipping.clip_volume.depth_clip.*
      Change-Id: Iaab31c17cac382cf55a8c50d8e7e7d4c87b55272
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53968
      Presubmit-Ready: Alexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Commit-Queue: Sean Risser <srisser@google.com>
      Tested-by: 's avatarSean Risser <srisser@google.com>
    • Obtain all sampler parameters through SamplingRoutineCache::Key · f6afa763
      Alexis Hetu authored
      This change ensures that the descriptor state identifiers used to
      perform lookups in the sampling routine cache are all that is used to
      obtain the state itself which is used for specializing sampling
      routine generation.
      
      The createSamplingRoutine lambda function is made to capture only the
      'device' variable, instead of allowing access to all local variables.
      The device is required to obtain the sampler state from the sampler
      identifier.
      
      Bug: b/152227757
      Change-Id: Id7f5e18e09f078589a1a1edc12622ed40126cd32
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53068
      Commit-Queue: Alexis Hétu <sugoi@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    • Obtain ImageView state uniquely from its identifier · 41a476ed
      Alexis Hetu authored
      VkImageView state for sampling routine generation was previously
      obtained from the SampledImageDescriptor structure, which assumes that
      the mapping from the identifier to this state is unique. This assumption
      easily breaks as new members field can be added to the descriptor
      structure, without taking into account that the identifier values should
      be unique for each unique field value.
      
      This change removes the ImageView state members from the descriptor
      structure, and instead we obtain them through the identifier,
      guaranteeing a unique mapping.
      
      Note that currently this state is compacted into the identifier's
      32-bit integer value itself. Should more state be required than what
      fits in 32-bit (like is the case for VkSampler objects), the mapping
      between identifiers and their state should be handled through an actual
      map container.
      
      Bug: b/180511322
      Bug: b/152227757
      Change-Id: I1568eb67df29eb29ddcbbe906a90d236078e3080
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52888Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Commit-Queue: Alexis Hétu <sugoi@google.com>
  2. 28 Apr, 2021 1 commit
  3. 22 Apr, 2021 1 commit
    • Format switch statements consistently · 112faf44
      Nicolas Capens authored
      Each non-fallthrough case should end with a break (or return). If a
      scope is needed because local variables are defined, it should end
      before this break.
      
      This avoids bugs such as:
      
      switch(i)
      {
      case 0:
          if(c)
          {
              // lots
              // of
              // code
      
              // Easy to misread as always breaking instead of conditionally
              // falling through due to not spotting the if(c).
              break;
          }
      
      case 1:
          // ...
      }
      
      The new scope should also be indented. It makes it easier to spot where
      each case ends and where the switch ends. This is achieved by setting
      IndentCaseBlocks to true.
      
      Lastly, the case labels themselves should not be indented. Like goto
      labels they mark where in the code to jump to, and the code itself is
      already indented within the switch block.
      
      Bug: b/144825072
      Change-Id: I9a130d1d234795f53b5872e411f1315f56a0e908
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39551
      Commit-Queue: Nicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
  4. 20 Apr, 2021 2 commits
  5. 16 Apr, 2021 1 commit
  6. 14 Apr, 2021 1 commit
  7. 13 Apr, 2021 2 commits
  8. 09 Apr, 2021 1 commit
  9. 29 Mar, 2021 1 commit
    • Automate installing the API library for testing · 4c0f888d
      Nicolas Capens authored
      To run dEQP tests we previously either had to install the Vulkan Loader
      and configure it to find the SwiftShader Vulkan ICD, or manually copy
      over the library.
      
      This change introduces the SWIFTSHADER_VULKAN_API_LIBRARY_INSTALL_PATH
      environment variable, which can be set to a path where the API library
      should be copied to. When used with dEQP it ensures we always test with
      the last build, instead of the path provided in the JSON file used by
      the Vulkan loader.
      
      Note this is only meant as a convenience for SwiftShader development.
      It shouldn't be used as a substitute for installing the ICD for
      system-wide usage. The latter should probably use CMAKE_INSTALL_PREFIX
      instead, but there are no known use cases yet for installing SwiftShader
      as the system-level driver, through the CMake build.
      
      Bug: b/149486511
      Change-Id: I5ec9d669967ba0c05a763263605ee0ad5cfd505e
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53768
      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 avatarAlexis Hétu <sugoi@google.com>
  10. 26 Mar, 2021 1 commit
  11. 25 Mar, 2021 2 commits
  12. 24 Mar, 2021 1 commit
  13. 17 Mar, 2021 1 commit
  14. 16 Mar, 2021 1 commit
    • Fix multiview renderpass queries · a0aeb64e
      Nicolas Capens authored
      The spec states that "If queries are used while executing a render pass
      instance that has multiview enabled, the query uses N consecutive query
      indices in the query pool (starting at query) where N is the number of
      bits set in the view mask in the subpass the query is used in. How the
      numerical results of the query are distributed among the queries is
      implementation-dependent. For example, some implementations may write
      each view’s results to a distinct query, while other implementations
      may write the total result to the first query and write zero to the
      other queries."
      
      This wasn't working properly for occlusion queries, but we missed it
      because dEQP doesn't provide coverage for this case if timestamp queries
      are not supported. This change fixes it for both query types.
      
      Note that for occlusion queries we write the total result to the first
      query, and set the remaining query results to 0, as explicitly allowed
      by the spec.
      
      For timestamp queries each query result is a valid timestamp (note that
      the spec also allows for only the first query to be a timestamp, while
      the remaining ones are zero).
      
      Bug: b/142643809
      Change-Id: I531248c2822c5f68d8636d4a3d153082c48cac1d
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53668
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
  15. 15 Mar, 2021 1 commit
  16. 13 Mar, 2021 1 commit
  17. 12 Mar, 2021 5 commits
  18. 11 Mar, 2021 2 commits
  19. 10 Mar, 2021 1 commit
  20. 08 Mar, 2021 2 commits
  21. 05 Mar, 2021 1 commit
  22. 04 Mar, 2021 1 commit
    • Implement VK_KHR_timeline_semaphore · 6846389f
      Sean Risser authored
      Timeline semaphores track a monotonically increasing uint64_t that
      serves as a signal to any number of threads on the device or the host.
      Threads and the host wait on the value of the payload to become a
      specific value, then unblock. Or they can signal the semaphore and
      update its value, unblocking all threads waiting on that value in the
      process.
      
      Clang's Thread Safety Analysis is not used for TimelineSemaphore as
      it has a bug that prevents it from properly analyzing lambdas that access
      guarded resources.
      
      Change-Id: Iafd95b8eac11beea21c00df87ca7ca1e51c77c64
      Bug: b/147738281
      Test: dEQP-VK.api.info.vulkan1p2_limits_validation.timeline_semaphore
      Test: dEQP-VK.synchronization.basic.timeline_semaphore.*
      Test: dEQP-VK.synchronization.timeline_semaphore.*
      Test: dEQP-VK.synchronization.op.single_queue.timeline_semaphore.*
      Test: dEQP-VK.synchronization.cross_instance.*
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52148
      Kokoro-Result: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarSean Risser <srisser@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
      Commit-Queue: Sean Risser <srisser@google.com>
  23. 03 Mar, 2021 1 commit
  24. 26 Feb, 2021 2 commits
  25. 24 Feb, 2021 4 commits