543 Commits

Author SHA1 Message Date
Bill Hollings
e06eb3a892
Merge pull request #1370 from f32by/imageless_framebuffer
Support the VK_KHR_imageless_framebuffer extension.
2021-05-31 13:20:24 -04:00
UnsafeBy
a723dc1f21 Support the VK_KHR_imageless_framebuffer extension.
I'm not sure this is the elegant way but it works in my own
project:)
2021-05-28 23:28:20 +08:00
Philip Cheang
c70790bf0f
Fix minor typos in What's New 2021-05-28 02:18:48 +08:00
Philip Cheang
76abba6199
Fix minor typos in User Guide. 2021-05-28 02:02:15 +08:00
Bill Hollings
9e5ff3a614 Changes to MVKConfiguration::resumeLostDevice behavior.
On command buffer submission failure, if MVKConfiguration::resumeLostDevice enabled,
do not release waits on VkDevice, and do not return VK_ERROR_DEVICE_LOST, unless
VkPhysicalDevice is also lost.
2021-05-25 12:14:14 -04:00
Bill Hollings
4d2448db3f Fix inconsistent handling of linear attachment decisions on Apple Silicon. 2021-05-20 16:07:34 -04:00
Bill Hollings
378b5d5bc9 Fix synchronization issue with locking MTLArgumentEncoder.
Move mutex lock for using MTLArgumentEncoder to MVKMTLArgumentEncoder
to be tracked along with the MTLArgumentEncoder it guards.
2021-05-14 22:17:08 -04:00
Bill Hollings
8420988c73 Fixes for CTS dEQP-VK.info.device_properties failures.
Adjust VkPhysicalDeviceLimits values:
- minMemoryMapAlignment raised to MIN of 64 per Vulkan spec.
- pointSizeRange upper limit to 511 per Metal.
- lineWidthGranularity to 0 per Vulkan spec when wideLines disabled.
- maxSamplerLodBias set to 4 to cover setting in shader.
2021-05-07 21:28:56 -04:00
Bill Hollings
19f02fac3d Merge from master and fix PR conflicts. 2021-05-05 16:46:45 -04:00
Bill Hollings
f781ee720a MVKImagePlane::getMTLTexture() protect against
crash when image has no device memory bound.
2021-05-05 16:37:16 -04:00
Bill Hollings
523342dd2f Fix crash when requesting MTLCommandBuffer logs in runtime debug mode on older OS versions. 2021-05-05 14:46:36 -04:00
Bill Hollings
650e8f3a46 To improve cache hits when matching SPIRVToMSLConversionConfiguration structs
to each other to find cached shader, only consider current shader stage resources.

Rename more references to ShaderConverterContext to ShaderConversionConfig.
2021-05-04 20:06:34 -04:00
Bill Hollings
5b1f38fbb9 Miscellaneous non-functional maintainability updates.
Rename kMVKShaderStageMax to kMVKShaderStageCount
to clarify it's common use in array sizing and for loops.
Change mvkConfig() to return reference instead of pointer
to improve syntactic sugar to use . instead of ->.
Update MoltenVK version to 1.1.4.
Update What's New document.
2021-05-03 18:56:30 -04:00
Bill Hollings
8f94b820a8 Change documentation references to macOS 10.16 to macOS 11.0. 2021-04-27 12:53:02 -04:00
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
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
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
4371ef4d2b MVKDescriptorPool pools its descriptor sets. 2021-03-15 11:33:14 -04: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
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
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
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
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
7684f4a198 Update What's New document. 2021-03-01 17:47:03 -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
8e610a43a8 Support configuring supported Vulkan API version.
Add MVKConfiguration::apiVersionToAdvertise and MVK_CONFIG_API_VERSION_TO_ADVERTISE
env var to configure MoltenVK to advertise a particular Vulkan version.

Advertise MVKConfiguration::apiVersionToAdvertise in:
  vkEnumerateInstanceVersion()
  vkGetPhysicalDeviceProperties()
  vkEnumerateInstanceLayerProperties()
  vkEnumerateDeviceLayerProperties()

Add MVKConfiguration::advertiseExtensions and MVK_CONFIG_ADVERTISE_EXTENSIONS
env var to configure MoltenVK to not advertise support for any Vulkan  extensions.
Refactor population of MVKConfiguration from environment variables to better
support validating and baking config values set by app.
Update MoltenVK version to 1.1.3.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 31.
2021-02-24 16:32:14 -05:00
Bill Hollings
d78de04b56 Update external dependency libraries for Vulkan SDK 1.2.170. 2021-02-22 19:14:00 -05:00
Bill Hollings
c38f19dd20 Report accurate value for VkPhysicalDeviceLimits::maxBoundDescriptorSets.
This value is derived from limit expected by SPIRV-Cross.
The previous unbounded value was breaking CTS tests that used this value.
2021-02-18 13:47:45 -05:00
Bill Hollings
612c84d79e Remove official support for direct MSL shader loading from documentation. 2021-02-12 18:33:28 -05:00
Bill Hollings
4d60058efb Remove ONLY_ACTIVE_ARCH from Debug builds.
Debug builds now build for all platform architectures.
2021-02-12 09:50:17 -05:00
Bill Hollings
bbea8dabc9 Test for null string on MVKConfiguration copy.
When app sets MVKConfig not fully populated by app, or if app sets strings to null,
copy can fail. Test for this before copying.
2021-02-06 21:42:30 -05:00
Bill Hollings
95cf144ccf Add ability to automatically capture first GPU frame.
Refactor auto GPU capture code to support both device and frame capture.
Add ability to automatically capture first GPU frame by setting
`MVK_CONFIG_AUTO_GPU_CAPTURE_SCOPE` to `2`.
Wrap GPU capture in autorelease pool to handle both cases of capture call
being made in run loop as in an app GUI, or in one-shot app like CTS.
2021-02-04 11:56:28 -05:00
Bill Hollings
3e20e1a137 Support compiling MSL with position invariance if indicated in SPIRV shader.
Add SPIRVToMSLConversionResults::isPositionInvariant to query
position invariance from SPIR-V.
MVKDevice::getMTLCompileOptions() takes into consideration need to preserve invariance.
MVKShaderModule compile MSL to preserve invariance if required by shader.
2021-01-28 16:46:49 -05:00
Bill Hollings
2343c0267b Enable MSL ffast-math compilation option by default.
Support querying SignedZeroInfNanPreserve execution mode
from SPIR-V to disable fast-math for individual shaders.
Clean up namespace references in SPIRVToMSLConverter.cpp.
2021-01-28 08:05:33 -05:00
Bill Hollings
696de7a4e7 Make MVKConfiguration access global, ignoring provided VkInstance.
MVKConfiguration access is now global, and the VkInstance provided in the
vkGet/Set/MoltenVKConfigurationMVK() functions is ignored. This allows these
functions to be provided with a VkInstance object that originates from a
different Vulkan layer than MoltenVK, without risking breaking the API.

MVKConfiguration extended to cover all MoltenVK environment variables.

Move all environment variable declarations to MVKEnvironment.h.
Add MVKEnvironment.cpp to define config functions.
Cleanup .m files to use MVKCommonEnvironment.h instead of MVKEnvironment.h.
2021-01-26 17:59:13 -05:00
Bill Hollings
57763529b1 Advertise support for shaderInt64 feature.
Add MVKDevice::mslVersionIsAtLeast() to support tests for MSL version.
Also bump MSL support level of standalone MoltenVKShaderConverter tool.
2021-01-25 13:08:41 -05:00
Bill Hollings
ff8460ac0b Documentation updates.
Add link to Vulkan SDK Getting Started doc to README.md and
MoltenVK_Runtime_UserGuide.md documents.
Add Github CI badge to README.md, and remove Travis CI badge.
Make document notices of use of Markdown into comments
so they are invisible when using a Markdown reader.
2021-01-21 14:49:24 -05:00
Bill Hollings
015031c955 Update copyright notices to year 2021 and Xcode build settings check to Xcode 12.3. 2021-01-21 13:37:07 -05:00
Bill Hollings
94a81177cb Update MoltenVK to version 1.1.2.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 30.
Update What's New document.
2020-12-26 13:45:10 -05:00
Bill Hollings
1ccc0ab7b5 Update dependency libraries to match Vulkan SDK 1.2.162.
Fix Mac Catalyst build failure, plus several build warnings on other platforms.
Update What's New document.
2020-12-08 21:31:39 -05:00
Chip Davis
f74356e51c Re-enable MTLEvent-based binary semaphores.
I haven't seen any problems yet. It passes all the tests--even the
`signal_order` tests. I have tried it with some games, and it seems OK
there, too.
2020-12-02 20:13:43 -06:00
Bill Hollings
6110c349ce
Merge pull request #1168 from billhollings/mac-catalyst
Support Mac Catalyst on macOS 11.0+
2020-12-02 19:51:52 -05:00
Chip Davis
e0e5d3ce28 Support the VK_EXT_subgroup_size_control extension.
This extension allows the subgroup size to vary between draw/dispatch
calls, and even allows clients to declare that full subgroups must
always be dispatched. It corresponds better to how Metal actually works.

No support for declaring a required subgroup size, unfortunately.
2020-12-02 09:38:58 -06:00
Bill Hollings
1ec58c9a92 Support building for Mac Catalyst on macOS 11.0+.
Define MVK_MACCAT build macro and use it to conditionally compile code to align
with build features and capabilities of Mac Catalyst platform on macOS 11.0+.
Treat Mac Catalyst as minor variation of macOS 11.0.
Update documentation.

Currently only support Mac Catalyst on macOS 11.0+, to avoid complexities of
deselecting iOS features and capabilities for Mac Catalyst on previous macOS versions.

Mac Catalyst (and Simulators) require use of XCFrameworks.
Currently unable to generate a dylib for Mac Catalyst.
2020-12-01 19:26:15 -05:00
Bill Hollings
163e8e5b20 Merge branch 'master' of https://github.com/billhollings/MoltenVK into desc-set-cleanups 2020-11-05 15:14:02 -05:00
Chip Davis
75129b849b Support the VK_EXT_texture_compression_astc_hdr extension.
Requires Apple family 6.

This adds one too many `MTLPixelFormats`, so I bumped the
`_mtlPixelFormatCount`.

Fixes #738.
2020-11-05 10:17:42 -06:00
Bill Hollings
cdd5b458da Fix Metal validation error when unused elements in
an array of sampler are not populated by descriptors.

Populate a default MTLSampler in unused sampler descriptors.
2020-11-04 22:16:04 -05:00
Chip Davis
8bb9db2dce Enable VK_EXT_post_depth_coverage for Apple Silicon on Mac. 2020-11-04 16:23:33 -06:00
Chip Davis
51afe4745e Enable VK_AMD_shader_image_load_store_lod for Apple Silicon on Mac. 2020-11-04 16:23:33 -06:00