1. 22 Aug, 2019 3 commits
    • Don't access sampler handles for sampled image descriptors · 243997ac
      Nicolas Capens authored
      The Vulkan 1.1 spec states that:
      "For VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
      or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, only the imageView and
      imageLayout members of each element of VkWriteDescriptorSet::pImageInfo
      are accessed."
      
      Also remove the zeroing of sampler descriptor data in
      SampledImageDescriptor when no sampler handle is provided. This was
      intended to detect bugs but we didn't do it consistently for all
      descriptor types (VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER also uses
      SampledImageDescriptor and has no sampler data). We now pass a null
      pointer to the sampling routine when no sampler descriptor is available
      (specifically for OpImageFetch) so it is less likely to still access it
      unintentionally.
      
      Bug: b/139401791
      Change-Id: Id1394493e88b7465fe3628c4c7d410cd3eaa3ccf
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35388
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
    • Fix samplerless image fetch · dbd02755
      Nicolas Capens authored
      OpImageFetch takes an Image operand, not a SampledImage, and thus we
      don't explicitly have a sampler descriptor. However, our
      vk::SampledImageDescriptor structure includes both image view descriptor
      data and sampler data, and we were relying on the sampler descriptor
      data to be present for setting the addressing mode. Other state would
      also inadvertently be affected.
      
      This change ensures that the sampler descriptor for fetch operations is
      null and we set the addressing mode to repeat but leave other unused
      state at their defaults.
      
      Bug: b/139401791
      Change-Id: I9f1af35940c2fa9c7d30e771ebdb244f72f5bdbe
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35348
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
    • Add support for multiview rendering · 02d4c0d3
      Chris Forbes authored
      This is a mandatory feature for 1.1, but Vulkan CTS 1.1.3 doesn't
      enforce that -- it only tests the feature if it is present.
      
      Highlights:
      - Multiple views implemented by running each draw multiple times. We
        could do something more efficient, but this is a fringe feature so
        far.
      - Render targets and input attachments are adjusted to use the layer
        corresponding to the current view.
      - Explicit attachment clears and end-of-subpass resolves are broadcast
        to the layers corresponding to the current subpass's view mask.
      - Renderpass attachment load ops are executed for the layers corresponding
        to the union of the subpass view masks for all subpasses which use the
        attachment. The actual load ops are still performed together at the
        beginning of the renderpass.
      - ViewIndex builtin variable is exposed to the shaders. In a
        non-multiview draw call, ViewIndex is still available, but is always
        zero.
      
      Bug: b/139862810
      Test: dEQP-VK.*multiview*
      Change-Id: Iaf40cfdb2f5afa61253cc756f97c0db30fb4d813
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35408
      Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
      Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
      Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
  2. 21 Aug, 2019 3 commits
  3. 20 Aug, 2019 1 commit
    • Refactor GLES routine cache keys to use Memset<T> · 92eb0415
      Nicolas Capens authored
      This ports the Vulkan side change to OpenGL ES and silences the GCC 8
      class-memaccess warning/error, while ensuring proper key initialization.
      
      Defines a Memset<T> class to be used as the first base class of cache
      key types, which makes it explicit that their underlying memory will be
      fully initialized before any member constructors are run.
      
      In particular this fixes Blitter::Options state having uninitialized
      bits after the bitfield, and Blitter::State having uninitialized padding
      bytes after Options so 'sourceFormat' is 32-bit aligned.
      
      Also adds is_memcmparable<T> for checking if memcmp() can be used to
      implement operator==() for cache keys. It's equivalent to
      std::is_trivially_copyable except it provides a fallback for STL
      implementations that don't support it.
      
      Also fix class-memset violations in LLVM 7.0 with their solution from
      a later version.
      
      Bug: b/135744933
      Change-Id: Ic1e5c2c6b944a5133fc55840c0508bc2cdd1d66a
      Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33488
      Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
      Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
      Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
  4. 19 Aug, 2019 5 commits
  5. 16 Aug, 2019 3 commits
  6. 15 Aug, 2019 8 commits
  7. 14 Aug, 2019 17 commits