141 Commits

Author SHA1 Message Date
Bill Hollings
2b05b95974 Add support for VK_EXT_metal_objects extension.
Update Vulkan-Headers version to include new VK_EXT_metal_objects extension.
Update MoltenVK version to 1.1.11.
Update What's New document.
2022-06-11 20:10:06 -04:00
Bill Hollings
292ea5e55a Update dependency libraries to match Vulkan SDK 1.3.216.
Update What's New document.
2022-06-04 21:06:56 -04:00
sean
6cc5110290
Add: Support for KHR_fragment_shader_barycentric 2022-05-24 23:37:04 +02:00
Bill Hollings
e00fef5b69 Update to latest SPIRV-Cross.
MSL: Emit interface block members of array length 1 as arrays instead of scalars.
2022-04-27 15:02:14 -04:00
Bill Hollings
be6f7a5083 Update dependency libraries to match Vulkan SDK 1.3.211.
Update What's New document.
2022-04-09 16:28:41 -04:00
Bill Hollings
728182cf75 MoltenVKShaderConverter tool defaults to the
highest MSL version supported on runtime OS.

Update to latest SPIRV-Cross.
Update Docs/Whats_New.md document.
2022-03-08 21:22:25 -05:00
Bill Hollings
f7ca132844 Update glslang version, to use python3 in glslang scripts,
to replace missing python on macOS 12.3.
2022-02-16 14:02:01 -05:00
Bill Hollings
24ff2106d9 Update dependency libraries to match Vulkan SDK 1.3.204.
Update What's New document.
2022-02-06 19:55:44 -05:00
Nikita Fediuchin
4efb90b3c1 Update license year 2022-02-04 13:33:27 +02:00
Bill Hollings
d4daba6687 MoltenVKShaderConverter updates.
mvk::getShaderOutputs() in SPRIVReflection.h support flattening nested structures.
MoltenVKShaderConverter tool support loading tessellation shader files.
MoltenVKShaderConverter tool update to MSL 2.4 by default.
Remove use of deprecated MTLCreateSystemDefaultDevice().
Update to latest version of SPIRV-Cross.
2022-01-19 15:55:44 -05:00
Bill Hollings
18642002ce Updates to better support Rosetta2 runtimes, and MSL 2.4 and 2.3 versions.
Do not use MTLEvent for VkSemaphore under Rosetta2.
Remove compile test for MVK_MACOS_APPLE_SILICON and MVK_APPLE_SILICON when testing
for Apple GPU families, to allow x86 builds to test for Apple GPU under Rosetta2.
Simplify identifying M1 GPU. All M1 SoCs currently support the A14 (Apple7) GPU.
Support compiling MSL 2.4 in runtime pipelines and MoltenVKShaderConverterTool.
Fix issue where MSL 2.3 only available on Apple Silicon, even on macOS.
Update to latest SPIRV-Cross (unrelated to Rosetta2).
2021-12-01 18:14:07 -05:00
Bill Hollings
a0ed3345b6 Update library dependencies to match Vulkan SDK 1.2.198.
Update What's New.md document.
2021-11-13 19:57:41 -05:00
Bill Hollings
025ffdc41e Let's try this again, this time with the actual SPIRV-Cross update! 2021-09-30 13:54:28 -04:00
Bill Hollings
ba9623cad5 Update to latest version of SPIRV-Cross.
Add additional SPIRV-Cross header files to ExternalDependencies.xcodeproj
to allow browsing these files in Xcode.
2021-09-30 13:45:54 -04:00
Bill Hollings
333084f739 Several updates for CTS test fixes.
Support maximum point primitive size of 511.
Update to latest SPIRV-Cross version to add support
for OpSpecConstantOp ops OpQuantizeToF16 and OpSRem.
Update MoltenVK version to 1.1.6.
2021-09-08 12:05:08 -04:00
Bill Hollings
a5ee3ead35 Update library dependencies to match Vulkan SDK 1.2.189.
Update What's New document.
2021-08-30 13:54:37 -04:00
Bill Hollings
43a133ff10 Update to latest version of SPIRV-Cross.
MSL: Support row-major transpose when storing matrix from constant RHS matrix.
MSL: Fix casting in constant expressions with different sizes.
MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused.
2021-08-23 18:31:45 -04:00
Bill Hollings
386bde9c78 Update to latest SPIRV-Cross version.
MSL: Adjust gl_SampleMaskIn for sample-shading and/or fixed sample mask.
MSL: Fix setting SPIRVCrossDecorationInterpolantComponentExpr decoration.
MSL: Simplify spvSubgroupBallot().
2021-07-22 11:03:52 -04:00
Bill Hollings
55c5cee233 Update dependency libraries to match Vulkan SDK 1.2.182. 2021-06-25 15:32:34 -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
Viktor Zoutman
fbaa616695
Update SPIRV-Cross_repo_revision 2021-03-02 11:06:52 +01:00
Bill Hollings
d78de04b56 Update external dependency libraries for Vulkan SDK 1.2.170. 2021-02-22 19:14:00 -05:00
Bill Hollings
7ce4e0ccbb Update to latest SPIRV-Cross to query shader invariance. 2021-01-29 15:33:27 -05:00
Bill Hollings
01d6feea07
Merge pull request #1211 from billhollings/non-functional-admin-changes
Non functional admin and documentation changes.
2021-01-22 08:47:16 -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
926e405c4f Update to latest SPIRV-Cross to fix conversion regression edge case. 2021-01-21 11:36:59 -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
8e11c41c40 MVKPhysicalDevice: Correct subgroup properties.
On systems not supporting this, the subgroup size is set to 1.

Make sure the subgroup size is fixed in the shader, at least until we
implement `VK_EXT_subgroup_size_control`.

According to the Metal feature set tables, SIMD-group reduction is only
supported on Mac family 2 GPUs and Apple family 7 GPUs. Previously, we
were exposing these on all Mac GPUs.

Quadgroup permutation is supported on all Apple GPUs starting from
family 4. We use them for regular group non-uniform ops as well, so
these are considered to have a subgroup size of 4. On Mac, it's a bit
more complicated. The 2.1 tables say that all Mac GPUs support this, but
the 3.0 and 4.0 tables say that only family 2 supports quadgroup ops.
I've allowed quad ops on family 1 for now.

Unfortunately, my testing shows that SIMD-group functions don't work in
fragment shaders on Mojave, so no fragment shader support until Metal 3.

Update SPIRV-Cross to pull in changes needed for all this.
2020-11-25 12:02:37 -06:00
Chip Davis
3b33c9ce05 MVKPhysicalDevice: Enable shaderResourceMinLod on iOS.
This was actually added in iOS 13, but it wasn't present in the betas.
Since the betas also didn't support family 6, this leads me to suspect
that `min_lod_clamp()` requires family 6. So to be safe, only enable the
feature on family 6.

Update SPIRV-Cross to pull in the changes needed for this.
2020-11-16 20:47:31 -06: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
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
Chip Davis
da0872b047 MVKPipeline: Fix calculation of atomic image buffer addresses.
Align the row address using the linear texture alignment for an
`R32Uint` texture.

Pull in the SPIRV-Cross changes needed to make this work.
2020-10-16 10:26:20 -05:00
Bill Hollings
9f2fc8f7d0 Update dependency libraries to match Vulkan SDK 1.2.154. 2020-09-28 19:03:00 -04:00
Bill Hollings
487305de6a Merge branch 'master' of https://github.com/billhollings/MoltenVK into xcode12 2020-09-21 13:09:06 -04:00
Bill Hollings
76828818ce Add support for VK_KHR_portability_subset extension.
Remove support for VK_EXTX_portability_subset extension.
2020-09-21 11:33:29 -04:00
Bill Hollings
122c15b696 Update Vulkan-Headers to version 1.1.154 to include VK_KHR_portability_subset. 2020-09-21 09:43:51 -04:00
Bill Hollings
51777ca49c Merge branch 'master' of https://github.com/billhollings/MoltenVK into xcode12 2020-09-11 14:03:03 -04:00
Chip Davis
34930eaf5b Support the VK_KHR_multiview extension.
Originally, Metal did not support this directly, and still largely
doesn't on GPUs other than Apple family 6. Therefore, this
implementation uses vertex instancing to draw the needed views. To
support the Vulkan requirement that only the layers for the enabled
views are loaded and stored in a multiview render pass, this
implementation uses multiple Metal render passes for multiple "clumps"
of enabled views.

For indirect draws, as with tessellation, we must adjust the draw
parameters at execution time to account for the extra views, so we need
to use deferred store actions here. Without them, tracking the state
becomes too involved.

If the implementation doesn't support either layered rendering or
deferred store actions, multiview render passes are instead unrolled and
rendered one view at a time. This will enable us to support the
extension even on older devices and OSes, but at the cost of additional
command buffer memory and (possibly) worse performance.

Eventually, we should consider using vertex amplification to accelerate
this, particularly since indirect multiview draws are terrible and
currently require a compute pass to adjust the instance count. Also,
instanced drawing in itself is terrible due to its subpar performance.
But, since vertex amplification on family 6 only supports two views,
when `VK_KHR_multiview` mandates a minimum of 6, we'll still need to use
instancing to support more than two views.

I have tested this extensively against the CTS. I'm very confident in
its correctness. The only failing tests are
`dEQP-VK.multiview.queries.*`, due to our inadequate implementation of
timestamp queries; and `dEQP-VK.multiview.depth.*`, due to what I assume
is a bug in the way Metal handles arrayed packed depth/stencil textures,
and which may only be a problem on Mojave. I need to test this on
Catalina and Big Sur.

Update SPIRV-Cross to pull in some fixes necessary for this to work.

Fixes #347.
2020-09-03 17:14:46 -05:00
Bill Hollings
56df7d61d7 Remove MoltenVK fat libraries and frameworks and use XCFramework instead.
- Delete fat library and framework scripts and templates.
- MoltenVK build package now only includes one XCFramework, and separate platform dylibs.
- Modify fetchDependencies and Makefile targets to not build fat libraries,
  and to build simulators separately than platforms instead.
- Script package_moltenvk.sh now copies dylibs for all built platforms.
- Consolidate package_all.sh and delete package_one_os.sh.
- Swap names of copy_lib_to_staging.sh and copy_to_staging.sh scripts.
- Cube demo now uses MoltenVK as XCFramework, and support Simulator builds.
- Hologram demo now uses MoltenVK as dylibs from new packaging location.
- API-Samples demo now uses MoltenVK as XCFramework.
- Update documentation.
2020-09-01 14:39:46 -04:00
Bill Hollings
834d391aec Update dependency libraries to match Vulkan SDK 1.2.148.
fetchDependencies support option to skip all library builds.
fetchDependencies avoid sync locks if not building in parallel.
fetchDependencies build glslang headers.
Update ExternalRevisions/README.md glslang build integration section.
Update What's New.
2020-07-27 22:25:44 -04:00
Chip Davis
cda8a2cf44 MVKPipeline: Pass the pipeline sample mask, if present, to SPIRV-Cross.
SPIRV-Cross can now AND the `gl_SampleMask` output with an additional
fixed mask, presumably from the pipeline. Use this new functionality to
implement pipeline sample mask handling.

Special thanks to Tomek Pontika and Corentin Wallez of Google for
graciously contributing their implementation to SPIRV-Cross.

Update SPIRV-Cross to pull in the change necessary for this.
2020-07-24 15:15:11 -05:00
Bill Hollings
fc0750d67c Set VkPhysicalDeviceDriverPropertiesKHR::driverID to VK_DRIVER_ID_MOLTENVK.
Update to latest version of Vulkan-Headers.
2020-07-20 14:51:40 -04:00
Bill Hollings
e40153abae Update to latest SPIRV-Cross version,
MSL: Workaround broken scalar access chain behavior in LLVM IR / AIR
2020-07-06 13:05:55 -04:00
Chip Davis
d14d4e918d MVKPipeline: Fix fragment inputs to have as many components as vertex outputs.
Metal is picky about interface matching. If the types of a vertex output
and its corresponding fragment input don't match, down to the number of
vector components, it fails pipeline compilation. To support cases where
the number of components in the fragment input is less than the
corresponding vertex output, we need to fix up the fragment shader to
accept the extra components.
2020-06-19 14:20:29 -05:00
Bill Hollings
4a5bf6953c Update fetchDependencies script to use pre-built spirv-tools files by default. 2020-06-02 13:30:52 -04:00
Bill Hollings
4840c97e94 Update dependency libraries to match Vulkan SDK 1.2.141. 2020-06-01 17:35:31 -04:00
Bill Hollings
e302a6d023 Update to latest version of SPIRV-Cross.
Remove use of obsolete SPIRV-Cross API MSLVertexAttr content.
ExternalDependencies.xcodeproj updated to Xcode 11.5.
Update What's New document.
2020-05-30 16:07:47 -04:00
Chip Davis
06662071a4 Update SPIRV-Cross again to pull in a fix for KhronosGroup/SPIRV-Cross#1322. 2020-04-15 13:40:44 -05:00
Chip Davis
4b479fefd4 Update SPIRV-Cross. 2020-04-14 14:32:00 -05:00