1. 11 Mar, 2019 1 commit
    • Tapani Pälli's avatar
      anv: destroy descriptor sets when pool gets destroyed · 105002bd
      Tapani Pälli authored
      Patch maintains a list of sets in the pool and destroys possible
      remaining sets when pool is destroyed.
      
      As stated in Vulkan spec:
         "When a pool is destroyed, all descriptor sets allocated from
          the pool are implicitly freed and become invalid."
      
      This fixes memory leaks spotted with valgrind:
      
         ==19622== 96 bytes in 1 blocks are definitely lost in loss record 2 of 3
         ==19622==    at 0x483880B: malloc (vg_replace_malloc.c:309)
         ==19622==    by 0x495B67E: default_alloc_func (anv_device.c:547)
         ==19622==    by 0x4955E05: vk_alloc (vk_alloc.h:36)
         ==19622==    by 0x4956A8F: anv_multialloc_alloc (anv_private.h:538)
         ==19622==    by 0x4956A8F: anv_CreateDescriptorSetLayout (anv_descriptor_set.c:217)
      
      Fixes: 14f6275c
      
       ("anv/descriptor_set: add reference counting for descriptor set layouts")
      Signed-off-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
      Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      105002bd
  2. 05 Mar, 2019 7 commits
  3. 04 Mar, 2019 1 commit
  4. 21 Jan, 2019 1 commit
  5. 08 Jan, 2019 1 commit
  6. 17 Aug, 2018 1 commit
  7. 26 Jul, 2018 1 commit
  8. 02 Jul, 2018 1 commit
    • Jason Ekstrand's avatar
      anv: Be more careful about hashing pipeline layouts · d1c778b3
      Jason Ekstrand authored
      
      
      Previously, we just hashed the entire descriptor set layout verbatim.
      This meant that a bunch of extra stuff such as pointers and reference
      counts made its way into the cache.  It also meant that we weren't
      properly hashing in the Y'CbCr conversion information information from
      bound immutable samplers.
      
      Cc: mesa-stable@lists.freedesktop.org
      Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
      d1c778b3
  9. 31 May, 2018 2 commits
  10. 20 Mar, 2018 1 commit
  11. 07 Mar, 2018 3 commits
  12. 26 Jan, 2018 1 commit
    • Iago Toral's avatar
      anv/descriptor_set: add reference counting for descriptor set layouts · 14f6275c
      Iago Toral authored
      
      
      The spec states that descriptor set layouts can be destroyed almost
      at any time:
      
         "VkDescriptorSetLayout objects may be accessed by commands that
          operate on descriptor sets allocated using that layout, and those
          descriptor sets must not be updated with vkUpdateDescriptorSets
          after the descriptor set layout has been destroyed. Otherwise,
          descriptor set layouts can be destroyed any time they are not in
          use by an API command."
      
      v2: allocate off the device allocator with DEVICE scope (Jason)
      
      Fixes the following work-in-progress CTS tests:
      dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.graphics
      dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.compute
      Suggested-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      14f6275c
  13. 24 Jan, 2018 1 commit
  14. 12 Jan, 2018 1 commit
  15. 06 Oct, 2017 1 commit
  16. 20 Sep, 2017 1 commit
  17. 23 Jul, 2017 1 commit
  18. 05 May, 2017 1 commit
  19. 08 Apr, 2017 1 commit
  20. 15 Mar, 2017 1 commit
  21. 13 Mar, 2017 2 commits
    • Jason Ekstrand's avatar
      anv: Use on-the-fly surface states for dynamic buffer descriptors · dd4db846
      Jason Ekstrand authored
      
      
      We have a performance problem with dynamic buffer descriptors.  Because
      we are currently implementing them by pushing an offset into the shader
      and adding that offset onto the already existing offset for the UBO/SSBO
      operation, all UBO/SSBO operations on dynamic descriptors are indirect.
      The back-end compiler implements indirect pull constant loads using what
      basically amounts to a texelFetch instruction.  For pull constant loads
      with constant offsets, however, we use an oword block read message which
      goes through the constant cache and reads a whole cache line at a time.
      Because of these two things, direct pull constant loads are much faster
      than indirect pull constant loads.  Because all loads from dynamically
      bound buffers are indirect, the user takes a substantial performance
      penalty when using this "performance" feature.
      
      There are two potential solutions I have seen for this problem.  The
      alternate solution is to continue pushing offsets into the shader but
      wire things up in the back-end compiler so that we use the oword block
      read messages anyway.  The only reason we can do this because we know a
      priori that the dynamic offsets are uniform and 16-byte aligned.
      Unfortunately, thanks to the 16-byte alignment requirement of the oword
      messages, we can't do some general "if the indirect offset is uniform,
      use an oword message" sort of thing.
      
      This solution, however, is recommended for a few of reasons:
      
       1. Surface states are relatively cheap.  We've been using on-the-fly
          surface state setup for some time in GL and it works well.  Also,
          dynamic offsets with on-the-fly surface state should still be
          cheaper than allocating new descriptor sets every time you want to
          change a buffer offset which is really the only requirement of the
          dynamic offsets feature.
      
       2. This requires substantially less compiler plumbing.  Not only can we
          delete the entire apply_dynamic_offsets pass but we can also avoid
          having to add architecture for passing dynamic offsets to the back-
          end compiler in such a way that it can continue using oword messages.
      
       3. We get robust buffer access range-checking for free.  Because the
          offset and range are baked into the surface state, we no longer need
          to pass ranges around and do bounds-checking in the shader.
      
       4. Once we finally get UBO pushing implemented, it will be much easier
          to handle pushing chunks of dynamic descriptors if the compiler
          remains blissfully unaware of dynamic descriptors.
      
      This commit improves performance of The Talos Principle on ULTRA
      settings by around 50% and brings it nicely into line with OpenGL
      performance.
      Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      dd4db846
    • Jason Ekstrand's avatar
  22. 02 Mar, 2017 5 commits
  23. 26 Jan, 2017 1 commit
  24. 24 Jan, 2017 1 commit
  25. 21 Jan, 2017 1 commit
  26. 20 Jan, 2017 1 commit