2398 Commits

Author SHA1 Message Date
Bill Hollings
751d864964 Descriptor set Metal argument buffer.
MVKDescriptorPool create single MVKBuffer to use as Metal argument buffer
shared between associated descriptor sets.
MVKDescriptorSetLayout track space required within Metal argument buffer.
MVKDescriptorSet track offset into shared Metal argument buffer, and find
and assign a slice for each descriptor set as it is allocated.
MVKDescriptorSetLayoutBinding track index into argument buffer.
2021-03-18 15:50:56 -04:00
Bill Hollings
0a8f9995c9 Device and shader framework framework changes to support Metal argument buffers.
Add MVKPhysicalDeviceMetalFeatures::argumentBuffers.
Add MVKConfiguration::useMetalArgumentBuffers and
MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS env var.
MVKPhysicalDevice and MVKDeviceTrackingMixin add isUsingMetalArgumentBuffers().
Populate VkPhysicalDeviceDescriptorIndexingPropertiesEXT with larger Tier2
limits when supported.
Populate pipelineCacheUUID with feature flag if Metal arg buffers are used.
SPIRVToMSLConversionConfiguration add content to extract shader texture types
and mark discrete descriptor sets.
2021-03-18 13:29:10 -04:00
Bill Hollings
16654b9341
Merge pull request #1322 from billhollings/several-frwk-changes
Several underlying non-functional changes towards Metal argument buffer support.
2021-03-17 23:13:17 -04:00
Bill Hollings
9542a5cc54 Several underlying non-functional changes towards Metal argument buffer support.
Move tracking descriptor index to MVKDescriptorSetLayoutBinding from MVKDescriptorSetLayout.
Refactor MVKDescriptorSet::write() to be more DRY.
Grow and shrink MVKDescriptorSet memory consumption during allocate and free.
MVKPhysicalDevice refactor layout of pipelineCacheUUID to remove redundancy in MoltenVK
revision and allow tracking of enabled features that affect pipeline cache content.
MVKBitArray support resizing and simplify setBit() functionality.
2021-03-17 19:21:35 -04:00
Bill Hollings
e7a5a8f427
Merge pull request #1320 from billhollings/rename-config
Rename mvkGetMVKConfiguration() to mvkConfig() for brevity.
2021-03-17 11:14:42 -04:00
Bill Hollings
f8280bca89 Rename mvkGetMVKConfiguration() to mvkConfig() for brevity. 2021-03-17 09:45:13 -04:00
Bill Hollings
55e1b1b29b
Merge pull request #1319 from billhollings/texel-buff-align
Fix advertising single-texel alignment capability for texel buffers.
2021-03-15 18:54:35 -04:00
Bill Hollings
d24414592c
Merge pull request #1317 from billhollings/pool-desc-sets
Descriptor pooling enhancements
2021-03-15 18:32:45 -04:00
Bill Hollings
e276f1a261 Fix advertising single-texel alignment capability for texel buffers.
The test for single-texel capability used a mod calculation to compare the linear
alignment requirement reported by Metal to the texel size. Instead, it should use an
inequality comparison, to check if the alignment requirement is LTE the texel size.
2021-03-15 18:29:11 -04:00
Bill Hollings
2ef21c65bf Preallocate a pool of descriptors by default.
Enable MVKConfiguration::preallocateDescriptors and
MVK_CONFIG_PREALLOCATE_DESCRIPTORS by default.
Rename MVKDescriptorTypePreallocation to MVKDescriptorTypePool.
2021-03-15 16:27:39 -04:00
Bill Hollings
6cba6a851b MVKDescriptorPool optimize reseting descriptor pool.
Don't free individual pooled descriptors during a pool reset.
Don't mark availability of individual descriptor sets during a pool reset.
Add MVKDescriptorPool::_hasPooledDescriptors as SVOT to track if descriptors
are pooled, and is set from outside constructor to ensure all internal
descriptor pools are constructed with the same SVOT.
MVKDescriptorPool::allocateDescriptorSet() ensure correct result returned.
2021-03-15 15:52:40 -04:00
Bill Hollings
4371ef4d2b MVKDescriptorPool pools its descriptor sets. 2021-03-15 11:33:14 -04:00
Bill Hollings
392957df72
Merge pull request #1312 from billhollings/optimize-descriptor-sizes
MVKDescriptor subclasses: Reduce redundant and unused content.
2021-03-13 16:01:21 -05:00
Bill Hollings
88fcb30090 Revert to using MVKBufferDescriptor::_buffRange, and populating
MVKMTLBufferBinding::size to specify the length of shader runtime arrays.
2021-03-13 14:03:47 -05:00
Bill Hollings
a2be769e5f MVKDescriptor subclasses: Reduce unused content.
Don't populate MVKMTLBufferBinding::size unless using mtlBytes and isInline.
Remove MVKBufferDescriptor::_buffRange.
Remove MVKImageDescriptor::_imageLayout.
Remove MVKCmdBufferImageCopy::_imageLayout.
2021-03-12 22:12:22 -05:00
Bill Hollings
068ce2ee8e MVKDescriptor subclasses: Simplify interface and reduce redundant content.
Remove MVKDescriptor::setLayout() and pass MVKDescriptorSetLayoutBinding
to MVKDescriptor::bind(), write(), and read().
Remove MVKSamplerDescriptorMixin::_hasDynamicSampler.
Remove MVKInlineUniformBlockDescriptor::_length.
2021-03-12 20:10:51 -05:00
Bill Hollings
85ef62d043
Merge pull request #1310 from billhollings/prealloc-descriptors-refactor
Refactor preallocated descriptor handling.
2021-03-12 09:25:03 -05:00
Bill Hollings
984a74fffd Refactor preallocated descriptor handling.
Add MVKBitArray class.
Consolidate MVKPreallocatedDescriptors into MVKDescriptorPool
and remove MVKPreallocatedDescriptors.
2021-03-12 09:11:58 -05:00
Bill Hollings
20b5067ee5
Merge pull request #1309 from billhollings/fix-memoryless-load-store
In a renderpass, don't load or store memoryless attachments.
2021-03-11 14:11:42 -05:00
Bill Hollings
9c13e46c47 In a renderpass, don't load or store memoryless attachments.
For memoryless attachments, setting renderpass load and store
actions to "load" and "store" triggers Metal validation errors.
Refactor determination of renderpass MTLLoadAction and MTLStoreAction.
For memoryless attachments, replace load with don't care,
and store with resolve or don't care.
2021-03-11 12:22:47 -05:00
Bill Hollings
a0d20fe498
Merge pull request #1305 from billhollings/fix-physdvc-fmts
Several surface format and colorspace fixes.
2021-03-10 20:17:32 -05:00
Bill Hollings
4d452fdca6 Always explicitly set CAMetalLayer colorspace and wantsExtendedDynamicRangeContent.
Don't assume the incoming CAMetalLayer has default (no-op) values for colorspace and
wantsExtendedDynamicRangeContent properties, since they could have been set externally.
Ensure the Vulkan app has control over both of these properties.
vkCreateSwapchainKHR() returns VK_ERROR_FORMAT_NOT_SUPPORTED for unsupported colorspaces.
2021-03-10 19:59:11 -05:00
Bill Hollings
cd8a0e149e Restore support for HDR10 colorspace.
Restore support for VK_COLOR_SPACE_HDR10_HLG_EXT and VK_COLOR_SPACE_HDR10_ST2084_EXT
under Xcode12 that was removed due to App Store conflicts using older enum values.
2021-03-10 19:05:01 -05:00
Bill Hollings
8112d85103 Fix MVKPhysicalDevice::getSurfaceFormats() returning VK_FORMAT_UNDEFINED.
Fix MVKPhysicalDevice::getSurfaceFormats() returning VK_FORMAT_UNDEFINED
in available surface formats when a Metal surface format is available that
doesn't map to a defined Vulkan format (eg. MTLPixelFormatBGRA10_XR).
2021-03-10 18:30:11 -05:00
Bill Hollings
6665a6a436
Merge pull request #1300 from billhollings/cfg-enums
Create enums for remaining MVKConfiguration enumerated values.
2021-03-10 10:36:19 -05:00
Bill Hollings
cfc2556c31 Fix use of VkFlags in MVKConfiguration enumerated values.
MVKConfigLogLevel, MVKConfigTraceVulkanCalls, and MVKConfigAutoGPUCaptureScope
do not need to be VkFlags, since they aren't bitwise flags.

MVK_SET_FROM_ENV_OR_BUILD_INT32 supports setting enumerated values.
2021-03-10 09:26:59 -05:00
Bill Hollings
21ee6bac95 Create enums for remaining MVKConfiguration enumerated values.
Introduce MVKConfigLogLevelBits enum to specify values of
MVKConfiguration::logLevel in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.

Introduce MVKConfigTraceVulkanCallsBits enum to specify values of
MVKConfiguration::traceVulkanCalls in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.
2021-03-09 18:45:16 -05:00
Bill Hollings
005e804f4d
Merge pull request #1298 from billhollings/auto-gpu-capture-fixes
Fixes to auto GPU capture
2021-03-09 17:22:08 -05:00
Bill Hollings
904edb8434 Only start automatic GPU capture on queue identified by
MVKConfiguration::defaultGPUCaptureScopeQueueFamilyIndex
and defaultGPUCaptureScopeQueueIndex.

Introduce MVKConfigAutoGPUCaptureScopeBits enum to specify values of
MVKConfiguration::autoGPUCaptureScope in a Vulkan-friendly manner,
while automatically documenting the same values for env vars.

Update some config documentation.
2021-03-09 15:51:01 -05:00
Bill Hollings
315cb418cf
Merge pull request #1297 from billhollings/config-adv-multiple-extns
Extend MVKConfiguration::advertiseExtensions to optionally specify a few extensions.
2021-03-09 10:07:03 -05:00
Bill Hollings
691dc8a9ed Redefine MVKConfigAdvertiseExtensionBits enum as extension families. 2021-03-08 21:20:51 -05:00
Bill Hollings
2ba0fb3267 Extend MVKConfiguration::advertiseExtensions to optionally specify a few extensions.
Introduce MVKConfigAdvertiseExtensionBits enum to specify multiple API config values in
a Vulkan-friendly manner, while automatically documenting the same values for env vars.
2021-03-08 15:15:24 -05:00
Bill Hollings
c4920375d2
Merge pull request #1295 from billhollings/remove-release-build-asserts
Add NDEBUG macro to all Release builds to remove assert() calls.
2021-03-04 14:49:07 -05:00
Bill Hollings
ff7269f26e Add NDEBUG macro to all Release builds to remove assert() calls.
External libraries in particular make liberal use of assert() calls, which bypass
error catching, sometimes causing crashes rather than catch errors and moving on.
2021-03-04 13:47:25 -05:00
Bill Hollings
3bcc7e4558
Merge pull request #1290 from billhollings/remove-vulkansamples
Remove LunarG/VulkanSamples as a dependency library.
2021-03-04 08:21:11 -05:00
Bill Hollings
5648258da7 Remove LunarG/VulkanSamples as a dependency library.
LunarG is planning to retire the LunarG/VulkanSamples repository.
Remove dependency to it, and remove the affected Hologram and API-Samples demo apps.
Update documents, including directing developers to the
KhronosGroup/Vulkan-Samples repository for official demo apps.
2021-03-03 16:43:11 -05:00
Bill Hollings
f28ab1c127
Merge pull request #1288 from VZout/patch-2
Updated SPIRV-Cross revision
2021-03-02 14:59:23 -05:00
Bill Hollings
4cd8532540
Merge pull request #1287 from billhollings/spvx-integration
Remove project qualifiers from references to SPIRV-Cross and glslang header files.
2021-03-02 14:56:24 -05:00
Viktor Zoutman
fbaa616695
Update SPIRV-Cross_repo_revision 2021-03-02 11:06:52 +01:00
Bill Hollings
7684f4a198 Update What's New document. 2021-03-01 17:47:03 -05:00
Bill Hollings
5dd56ccfd3 Restore project qualifiers to references to glslang header files. 2021-03-01 17:44:13 -05:00
Bill Hollings
64681832c1 Remove project qualifiers from references to SPIRV-Cross and glslang header files.
Remove SPIRV-Cross/ qualifier from include references to SPIRV-Cross header files.
Remove glslang/ qualifier from include references to glslang header files.
This change allows easier integration with app build scripts.
2021-02-28 18:22:52 -05:00
Bill Hollings
802fd4b2a1
Merge pull request #1286 from billhollings/cts-fix-phys-dvc-feats
Permit extension functions when all extensions have been disabled via configuration.
2021-02-27 15:02:34 -05:00
Bill Hollings
b9d9ab613d Permit extension functions when all extensions have been disabled via configuration.
When mvkGetMVKConfiguration()->advertiseExtensions is disabled, and MoltenVK
artificially advertises that all extensions are not supported, allow the functions
of those extensions to be called anyway.

Some CTS tests are structured to assume one or more basic extensions are supported,
and do not bother checking for those extensions and provide alternate code paths
based on the extension not being supported. Permitting the calls to be made anyway
allows those tests to proceed and avoid crashing.
2021-02-27 14:18:40 -05:00
Bill Hollings
9dc1fc9442
Merge pull request #1284 from billhollings/queue-submit-finish-logging
Ensure queue submission message logging occurs before submission object is destroyed.
2021-02-26 06:09:14 -05:00
Bill Hollings
68a0119f21 Fix typo. 2021-02-25 21:09:14 -05:00
Bill Hollings
a4d36cb757 Reduce debug log noise by only logging header msg for
shader debug logs if at least one shader log exists.
2021-02-25 17:19:53 -05:00
Bill Hollings
08d9fa8ea2 Ensure queue submission message logging occurs before submission object is destroyed.
Fixes to MVKQueueCommandBufferSubmission:
- Consolidate MTLCommandBuffer completion callbacks, and ensure all other activities,
  including logging, which references the object, occurs before finish() is called.
- Remove separate flag that indicates whether to track MTLCommandBuffer completion times.
- Localize Vulkan error reporting to the queue instead of the device.
2021-02-25 16:37:06 -05:00
Bill Hollings
bee482927a
Merge pull request #1281 from cdavis5e/enhanced-cmdbuf-errors
Log enhanced command buffer errors in debug mode.
2021-02-25 10:56:54 -05:00
Bill Hollings
8c7ca56707
Merge pull request #1280 from billhollings/conformance-config
Support configuring supported Vulkan API version and whether to advertise extensions.
2021-02-25 10:16:04 -05:00