2205 Commits

Author SHA1 Message Date
Bill Hollings
8969e4d4a4 Update dependency libraries to match Vulkan SDK 1.2.176, and update What's New document. 2021-04-26 16:38:23 -04:00
Bill Hollings
897e375bbb
Merge pull request #1331 from billhollings/resume-device
Add MVKConfiguration::resumeLostDevice and MVK_CONFIG_RESUME_LOST_DEVICE env var.
2021-04-13 13:41:33 -04:00
Bill Hollings
e9ca34a7aa Fix typo in description of MVK_CONFIG_RESUME_LOST_DEVICE. 2021-04-13 06:27:44 -04:00
Bill Hollings
260548172a Add MVKConfiguration::resumeLostDevice and MVK_CONFIG_RESUME_LOST_DEVICE env var,
to allow VkDevice to resume after non-fatal VK_ERROR_DEVICE_LOST error.

When running CTS, when one test triggers a VK_ERROR_DEVICE_LOST error condition,
CTS does not create a new VkDevice for subsequent tests, which causes all subsequent
tests to fail. This creates an incredible amount of results noise, and makes it
difficult to determine accurate test failure numbers. This is particularly problematic
because VK_ERROR_DEVICE_LOST may be triggered sporadically by internal Metal issues,
often making it not traceable to a consistent failure of a particular CTS test.
2021-04-12 18:20:16 -04:00
Bill Hollings
0db803bc3c
Merge pull request #1325 from billhollings/swapchain-leak
Fix memory leak where swapchains and images were not destroyed due to a retention loop.
2021-03-26 17:59:04 -04:00
Bill Hollings
d4844490f4 Fix memory leak where swapchains and images were not destroyed due to a retention loop.
Add Cube app iOS device rotation support, to test swapchain destruction on iOS.
2021-03-26 17:45:16 -04:00
Bill Hollings
79ba1d8e1e
Merge pull request #1323 from billhollings/tmp-buff-alloc
Enhancements and fixes to temporary MTLBuffer allocation.
2021-03-22 15:01:24 -04:00
Bill Hollings
55a2fe6467 Remove private flag from MVKCommandEncoder::copyToTempMTLBufferAllocation().
MVKMTLBufferAllocationPool subclass from MVKDeviceTrackingMixin.
MVKDeviceObjectPool subclass from MVKDeviceTrackingMixin.
2021-03-22 07:51:07 -04:00
Bill Hollings
ef1990306d Enhancements and fixes to temporary MTLBuffer allocation.
Check allocations are larger than MTLBuffer alignment to avoid Metal errors.
Align returning safely with allocating safely, and change callers to use
MVKMTLBufferAllocation::returnToPool() globally, to ensure this match.
Fix use of const on returnToPool();
Move MVKCommandEncoder::copyToTempMTLBufferAllocation()
and support setting private and dedicated flags.
Align constructor parameter order on MVKMTLBufferAllocationPool
with that of MVKMTLBufferAllocator.
Move subclass overrides of MVKObjectPool::newObject() to protected access.
2021-03-21 21:53:16 -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