Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to bindless resources and descriptor indexing #2260

Merged
merged 7 commits into from
Jul 3, 2024

Commits on Jun 30, 2024

  1. Remove option to use Metal argument buffers per pipeline-stage.

    The pipeline option was structurally permitted and designed for, but
    was never implemented. With the availability of Metal 3, which provides
    significant additional bindless argument buffer support, this option is
    being removed, in favor of future code enhancements that build on Metal 3.
    
    - Base all argument buffer support around descriptor sets.
    - Rename internal functions that test for support for argument buffers.
    - Update code documentation accordingly.
    billhollings committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    4f58e6d View commit details
    Browse the repository at this point in the history
  2. Support Metal 3 argument buffers.

    - Add MVKPhysicalDeviceMetalFeatures::needsArgumentBufferEncoders to indicate if
      Metal argument buffer encoders are needed to populate argument buffer content.
    - Update MVK_PRIVATE_API_VERSION to 38.
    - Add MVKArgumentBufferEncoder to handle populating Metal argument buffers
      with or without Metal argument encoders, and pass this to descriptors.
    - Indicate support for argument buffers on iOS, when Metal 3 is available.
    - MVKConfiguration::useMetalArgumentBuffers set to
      MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS_ALWAYS by default,
      which means Metal argument buffers are now used by default.
    - runcts script enables argument buffers by default.
    billhollings committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    370e7c1 View commit details
    Browse the repository at this point in the history
  3. Update descriptor set argument buffer directly from vkUpdateDescripto…

    …rSets().
    
    - Combine MVKMTLArgumentEncoder and MVKArgumentBufferEncoder into
      MVKMetalArgumentBuffer, which holds an arg buffer and its encoder,
      removing need to lock the encoder.
    - MVKDescriptorSet tracks argument buffer, and calls to vkUpdateDescriptorSets()
      directly insert resources into the argument buffer.
    - Add MVKDescriptor encodeResourceUsage() to encode indirect resource usage
      when using argument buffers.
    billhollings committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    4a9f7e5 View commit details
    Browse the repository at this point in the history
  4. Fixes to Metal3 argument buffers.

    - Include descriptor element count when calculating
      Metal3 argument buffer encoded size.
    - Support MVKPhysicalDeviceMetalFeatures::nativeTextureAtomics
      in argument buffer operations.
    - Add ability to log descriptor set layout.
    - Support debug logging alongside other logging levels.
    billhollings committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    eebd826 View commit details
    Browse the repository at this point in the history
  5. Cleanup and refactor Metal argument buffers.

    - Update SPIRV-Cross version to include latest argument buffer fixes.
    - Disable CompilerMSL::Options::force_active_argument_buffer_resources.
    
    - Track OpArrayLength buffer-sizes buffer as an auxiliary buffer in each
      descriptor set argument buffer, as this is how SPIRV-Cross expects it.
    
    - Revert MVKConfiguration::useMetalArgumentBuffers and env var
      MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS to boolean value, because
      descriptor indexing value is not longer required.
    - Update max number of buffer and textures per stage to 1M.
    
    - Refactor and simplify calculating argument buffer resource indexes
    	- Remove MVKShaderStageResourceBinding::resourceIndex,
    	  and track resource index incrementing locally.
    	- Update MVKDescriptorSetLayout::_descriptorCount & _mtlResourceCount
      	  from within MVKDescriptorSetLayoutBinding.
    
    - Refactor and simplify tracking argument buffer usage
    	- Rename MVKDeviceTrackingMixin::isUsingDescriptorSetMetalArgumentBuffers()
    	  to isUsingMetalArgumentBuffers(), and allow it to be overridden in
    	  MVKDescriptorSetLayout.
    	- Move and rename MVKDevice::_isUsingDescriptorSetMetalArgumentBuffers
    	  to MVKPhysicalDevice::_isUsingMetalArgumentBuffers.
    	- Remove MVKPhysicalDevice::supportsDescriptorSetMetalArgumentBuffers();
    	- Remove MVKDescriptorSetLayout::isUsingMetalArgumentBuffer() and replace
    	  with overridden isUsingMetalArgumentBuffers() function.
    	- Rename MVKDescriptorSet::isUsingMetalArgumentBuffer to hasMetalArgumentBuffer().
    	- Remove MVKDescriptorSetLayoutBinding::isUsingMetalArgumentBuffer().
    	- Remove MVKDescriptorSetLayout::isPushDescriptorLayout().
    
    - Update debugging logging
    	- Refactor and enhance ability to log descriptor set descriptions for debugging.
    	- MVKPipelineLayout support debug logging and remove a few unused member functions.
    	- Adjust whitespace in logging of instances and devices.
    
    - Update MVK_PRIVATE_API_VERSION to version 43.
    billhollings committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    30c5b92 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    a3908bf View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Configuration menu
    Copy the full SHA
    bfb35bd View commit details
    Browse the repository at this point in the history