1974 Commits

Author SHA1 Message Date
Bill Hollings
d208f94788
Merge pull request #1143 from cdavis5e/msl-interpolation-functions
MVKPhysicalDevice: Expose support for interpolation functions.
2020-11-08 17:13:32 -05:00
Chip Davis
e6d1f3cc67 MVKPhysicalDevice: Expose support for interpolation functions.
This is now supported in MSL 2.3. Support varies by device; devices that
support this return `YES` from `supportsPullModelInterpolation`. Based
on my testing, AMD devices do not yet support this, and Intel devices
do. Apple GPUs probably also support this, in order to support OpenGL on
top.

Update SPIRV-Cross to pull in the changes needed for this.
2020-11-07 12:05:12 -06:00
Bill Hollings
c593983ae0
Merge pull request #1142 from MarnixKuijs/master
Device fallback and fixed typo
2020-11-06 15:11:27 -05:00
Bill Hollings
bf65caa7e4
Merge pull request #1141 from billhollings/desc-set-cleanups
Descriptor code cleanups
2020-11-06 11:30:49 -05:00
MarnixKuijs
ac968db0b5 Device fallback and fixed typo 2020-11-05 23:39:29 +01:00
Bill Hollings
3308075107
Merge pull request #1140 from cdavis5e/apple-gpu-linear-blit-clear
Allow linear images on Apple GPUs in Blit and Clear commands.
2020-11-05 15:30:04 -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
415ad30bea Allow linear images on Apple GPUs in Blit and Clear commands.
They can now be used as blit destinations and be cleared with a render
pass.

This also fixes a bug where we were incorrectly validating that the
format supported shader writes if the image were linear, even on
iOS/tvOS.
2020-11-05 13:45:53 -06:00
Bill Hollings
3261d69be8
Merge pull request #1139 from billhollings/tvos-build-fixes
Fix tvOS builds and fix supportsGPUFamily: typo.
2020-11-05 14:28:16 -05:00
Bill Hollings
51ad6b3019
Merge pull request #1138 from cdavis5e/max-occlusion-queries
MVKPhysicalDevice: Set max visibility buffer size to 256 kiB where supported.
2020-11-05 14:03:08 -05:00
Bill Hollings
223a1f4d30 Fix build warnings.
Replace use of MTLDevice::supportsGPUFamily: with supportsFamily:.
Wrap unused variable of tvOS with conditional compile macro.
2020-11-05 13:58:30 -05:00
Bill Hollings
779ae2aa45 Fix tvOS builds.
Add macros to set MTLPixelFormatASTC_*_HDR to MTLPixelFormatInvalid on tvOS.
Use MTLRenderPipelineDescriptor::inputPrimitiveTopologyMVK instead of native method.
2020-11-05 13:41:55 -05:00
Chip Davis
8cb48464b4 MVKPhysicalDevice: Set max visibility buffer size to 256 kiB where supported.
Starting in macOS 10.15, all desktop GPUs support 256 kiB offsets. Apple
GPUs, however, do not support this until family 7. It isn't clear which
one is the supported limit on Apple Silicon Macs with family 5 or 6
GPUs, so I have left the Apple Silicon limit at 64 kiB for now.
2020-11-05 12:04:09 -06:00
Bill Hollings
426b699703
Merge pull request #1137 from cdavis5e/layered-blits
MVKCmdBlitImage: Use layered draws when possible.
2020-11-05 12:30:37 -05:00
Bill Hollings
46661417d4
Merge pull request #1136 from cdavis5e/tex-compress-astc-hdr
Support the VK_EXT_texture_compression_astc_hdr extension.
2020-11-05 12:28:05 -05:00
Bill Hollings
6defcea596 Simplify MVKDescriptor subclass implementations.
Don't pass descriptor type to MVKDescriptor functions, which already know their
descriptor type, and remove redundant switch tests in each subclass.
Move sanity tests for correct descriptor type to callers.
2020-11-05 11:31:50 -05:00
Chip Davis
b1e304bf91 MVKCmdBlitImage: Use layered draws when possible.
I wanted to do this in the last release, but I ran out of time.

It doesn't seem to provide much speed up.
2020-11-05 10:28:00 -06: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
a941ace5de
Merge pull request #1135 from cdavis5e/tsan-pipeline-layout-config
MVKPipelineLayout: Only set configuration result if validating.
2020-11-05 09:36:34 -05:00
Bill Hollings
cee558f484
Merge pull request #1134 from cdavis5e/apple-gpu-extensions
Enable extensions supported by Apple GPUs on Mac
2020-11-05 09:32:56 -05: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
23f113f1cd MVKPipelineLayout: Only set configuration result if validating.
Fixes a race condition picked up by `tsan`.
2020-11-04 16:25:39 -06:00
Bill Hollings
8cff884624 MVKDescriptorSetLayout sort and hold bindings by binding number.
MVKBufferDescriptor increment dynamic offset index as consumed during binding.
Remove need to track dynamic offset indexes in MVKDescriptorSetLayoutBinding.
2020-11-04 17:25:24 -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
Bill Hollings
53fd0b3640 Fix crash in vkUpdateDescriptorSets() when copying inline block descriptors.
Use temporary buffer to hold inline block data between
read and write stages while copying between descriptor sets.
2020-11-04 14:01:08 -05:00
Bill Hollings
5be7b2d8d5
Merge pull request #1131 from billhollings/VK_EXT_descriptor_indexing
Initial support for the VK_EXT_descriptor_indexing extension
2020-11-04 13:17:41 -05:00
Bill Hollings
e23ead807e Fix typo. 2020-11-04 13:00:49 -05:00
Bill Hollings
6e5984832f Sync VK_EXT_descriptor_indexing branch with master. 2020-11-04 11:07:27 -05:00
Bill Hollings
ae20a01c17
Merge pull request #1133 from cdavis5e/dylib-ubsan
Scripts: Support ubsan when building the dylib.
2020-11-04 10:59:32 -05:00
Bill Hollings
77dc97631e
Merge pull request #1132 from cdavis5e/tvos-supported-extensions
MVKExtensions: Add missing tvOS case for unsupported extensions.
2020-11-04 10:58:41 -05:00
Bill Hollings
3288a3f445
Merge pull request #1130 from cdavis5e/apple-gpu-pixel-formats-mac
Support Apple GPU pixel formats with Apple Silicon on Mac.
2020-11-04 10:57:43 -05:00
Chip Davis
0f5af085e7 Scripts: Support ubsan when building the dylib. 2020-11-03 16:25:59 -06:00
Chip Davis
abf2cba022 MVKExtensions: Add missing tvOS case for unsupported extensions. 2020-11-03 16:24:09 -06:00
Chip Davis
d635d19de4 Support Apple GPU pixel formats with Apple Silicon on Mac.
Also, enable rendering caps on linear textures. This is supported on
Apple GPUs.

Conversely, disable capabilities supported by desktop GPUs that are not
supported on Apple GPUs.

Sadly, no support for 16-bit packed pixel formats on non-Apple GPUs.
2020-11-03 16:23:36 -06:00
Bill Hollings
3910f09b6f Sync VK_EXT_descriptor_indexing branch with master. 2020-11-03 12:10:00 -05:00
Bill Hollings
d3155bd811 VK_EXT_descriptor_indexing add support for update after binding.
MVKDevice track enabled VkPhysicalDeviceInlineUniformBlockFeaturesEXT features.
Disable prefilled MTLCommandBuffers if update after binding enabled.
Update to latest SPIRV-Cross that includes support for unsized arrays.
2020-11-03 11:40:10 -05:00
Bill Hollings
3d952d5ed4 Support setting sizes of SPIR-V unsized arrays.
Set SPIRV-Cross MSLResourceBinding::size value
from MVKDescriptorSetLayoutBinding descriptor count.
2020-10-31 17:50:08 -04:00
Bill Hollings
6bd5b76a14
Merge pull request #1128 from cdavis5e/memoryless-mac
Expose MTLStorageTypeMemoryless for Apple Silicon on Mac.
2020-10-30 11:53:24 -04:00
Chip Davis
387763797d Expose MTLStorageTypeMemoryless for Apple Silicon on Mac. 2020-10-29 12:39:34 -05:00
Bill Hollings
ef7f42035d
Merge pull request #1126 from cdavis5e/apple-gpu-properties-mac
MVKDevice: Set properties for Apple Silicon GPUs on macOS.
2020-10-29 13:30:53 -04:00
Bill Hollings
4055d84a22 Use variable descriptor count when determining descriptor binding count.
MVKDescriptorSetLayoutBinding::getDescriptorCount() considers descriptor set
it is being applied to if it has a variable descriptor count.
Consolidate descriptor creation for inline uniform block with other types.
Don't track dynamic offsets consumed by the descriptor set layout. Instead,
during descriptor binding, track dynamic offsets consumed by each binding and set.
2020-10-28 22:36:59 -04:00
Chip Davis
d73017f4db MVKDevice: Set properties for Apple Silicon GPUs on macOS. 2020-10-28 19:35:24 -05:00
Bill Hollings
0098e94668 Set VK_EXT_descriptor_indexing features and properties.
Increase per-stage texture count to 96 for A11 SoC's and above.
Report VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages as Metal limit of 8.
Add MVKPhysicalDeviceMetalFeatures::maxPerStageStorageTextureCount and set to 8.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 29.
2020-10-28 19:36:33 -04:00
Bill Hollings
4a1a5179bd
Merge pull request #1124 from cdavis5e/khr-timeline-semaphore
Support the VK_KHR_timeline_semaphore extension.
2020-10-28 12:58:41 -04:00
Chip Davis
2b7f9aee43 Support the VK_KHR_timeline_semaphore extension.
This implementation uses `MTLSharedEvent` where possible, and emulates
it on the host otherwise. Unlike binary semaphores, `MTLSharedEvent`s
map well to timeline semaphores; there should be no problems using them
when they're available.

I'm extremely confident in the `MTLSharedEvent`-based implementation. It
passes nearly all the synchronization tests. I'm less confident in the
emulated implementation.
2020-10-27 18:56:00 -05:00
Bill Hollings
794edc5ec1 Initial support for handling VK_EXT_descriptor_indexing structures.
VK_EXT_descriptor_indexing adds no new functions, but does add six structures to
existing pNext chains. This initial commit processes these structs, but does not
yet perform any operational functionality for this extension.
2020-10-27 11:32:06 -04:00
Bill Hollings
dd08daa478
Merge pull request #1123 from cdavis5e/intel-nv-strictlines
MVKPhysicalDevice: Enable strictLines for Intel and NVIDIA.
2020-10-27 10:20:45 -04:00
Bill Hollings
c156ccb11b
Merge pull request #1121 from cdavis5e/3d-blit-r-offset
MVKCmdBlitImage: Add 0.5 to layer index before interpolating.
2020-10-27 10:05:21 -04:00
Chip Davis
1aad3c3659 MVKPhysicalDevice: Enable strictLines for Intel and NVIDIA.
Both Intel and NV Vulkan drivers enable `strictLines`. My testing shows
in fact that AMD and Apple Silicon exhibit the non-strict-line behavior,
while Intel shows the strict-line behavior.
2020-10-26 17:53:27 -05:00