Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Geometry shaders #1815

Open
wants to merge 134 commits into
base: geometry-shaders
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
6f3a2b7
Allow to disable Explicit LOD Workaround
italomandara Apr 4, 2023
912b2ed
Merge pull request #1861 from italomandara/allow-disable-explicit-lod…
billhollings Apr 4, 2023
5183856
Several simple maintenance fixes.
billhollings Apr 12, 2023
1d213e5
Merge pull request #1865 from billhollings/timeline-semaphore-mem-leak
billhollings Apr 12, 2023
5092330
Support BC compression on iOS/tvOS, where available.
billhollings Apr 12, 2023
b0e6df6
Replace references to macOS 10.16 with 11.0, and standardize use
billhollings Apr 12, 2023
f99ea66
Merge pull request #1866 from billhollings/ios-support-bc-compression
billhollings Apr 12, 2023
13e8103
Ensure shaders using PhysicalStorageBufferAddresses encode the associ…
billhollings Apr 14, 2023
5cbeaaa
Merge pull request #1868 from billhollings/gpu-addr-buff-use
billhollings Apr 15, 2023
fc8e818
Disable pipeline cache compression prior to macOS 10.15 and iOS/tvOS …
billhollings Apr 24, 2023
4aa2b6d
Support separate depth and stencil attachments during dynamic rendering.
billhollings Apr 24, 2023
abb12a5
Fix Metal validation errors with dynamic rendering.
billhollings Apr 26, 2023
331cea9
Merge pull request #1877 from billhollings/pipeline-compress-older-os…
billhollings Apr 26, 2023
fd6b973
Clear attachments support separate depth and stencil attachments.
billhollings Apr 27, 2023
e50cb32
Merge pull request #1878 from billhollings/dyn-rend-separate-depth-st…
billhollings Apr 28, 2023
937b0bf
Deprecate the obsolete and non-standard VK_MVK_moltenvk extension.
billhollings May 1, 2023
f33e718
Expose pointers to functions from removed VK_MVK_moltenvk extension.
billhollings May 3, 2023
d2f57fc
Merge pull request #1881 from billhollings/deprecate-VK_MVK_moltenvk-…
billhollings May 3, 2023
789d432
Avoid Metal validation warning when depth component swizzled away.
billhollings May 4, 2023
53a4eb2
Merge pull request #1885 from billhollings/fix-mtl-valid-err-depth-sw…
billhollings May 4, 2023
3db62a1
Reinstate VK_MVK_moltenvk extension and add simplified config functions.
billhollings May 4, 2023
cfa0ed2
Merge pull request #1886 from billhollings/reinstate-mvk-extn
billhollings May 4, 2023
cde220a
Remove vkGetMoltenVKConfiguration2MVK() and vkSetMoltenVKConfiguratio…
billhollings May 5, 2023
af9544d
Merge pull request #1889 from billhollings/rmv-config2
billhollings May 5, 2023
9e46669
Fix race condition when updating values in VkPastPresentationTimingGO…
billhollings May 5, 2023
dfc0af8
Merge pull request #1890 from billhollings/fix-display-timing-race-co…
billhollings May 5, 2023
ab5429b
GitHub CI improvements.
billhollings May 8, 2023
fbaba84
Merge pull request #1893 from billhollings/ci-improvements
billhollings May 9, 2023
f19ac2c
Add GitHub Actions workflow for automatically creating releases.
May 10, 2023
5bce402
Merge pull request #1895 from Steveice10/main
billhollings May 10, 2023
3247bd4
GitHub CI streamline uploaded artifact sizes.
billhollings May 10, 2023
dd5faf2
Merge pull request #1896 from billhollings/ci-reduce-artifact-sizes
billhollings May 10, 2023
0618c43
Update release action artifact glob.
May 11, 2023
c893a03
Merge pull request #1897 from Steveice10/main
billhollings May 11, 2023
9c72022
Make the GitHub Actions release workflow more lenient.
May 12, 2023
1b6750b
Respect the bind point supplied to vkCmdBindDescriptorSets
etang-cw May 10, 2023
d3b64c8
Merge pull request #1900 from Steveice10/release-workflow-patch
billhollings May 12, 2023
734a185
Merge pull request #1898 from etang-cw/PushBindPoint
billhollings May 12, 2023
47ce47a
Fix reorder-ctor warning
etang-cw May 12, 2023
0139b95
Fix simulator feature discovery
ChibiDenDen May 12, 2023
9bdc29a
Merge pull request #1902 from etang-cw/FixReorderCtor
billhollings May 13, 2023
7d4f574
Merge pull request #1903 from ChibiDenDen/simulator_feature_discovery…
billhollings May 13, 2023
4893f78
Identify each unsupported device feature flag that the app attempts t…
billhollings May 15, 2023
9c55ef3
Merge pull request #1905 from billhollings/id-unsupp-dvc-feat-flags
billhollings May 15, 2023
65ce195
Ensure swapchain image presented time is always populated when reques…
billhollings May 15, 2023
44c3063
Merge pull request #1906 from billhollings/ensure-present-time
billhollings May 15, 2023
d29092a
Do not fail on request for timestamp query pool that is too large.
billhollings May 16, 2023
6111aab
Merge pull request #1910 from billhollings/fix-ts-qp
billhollings May 17, 2023
665ef6d
Improve support for deviceUUID and deviceLUID.
billhollings May 16, 2023
ae0ee6a
Merge pull request #1908 from billhollings/fix-deviceUUID
billhollings May 17, 2023
75b4d26
Check if shader compiled before adding it to a pipeline
etang-cw May 17, 2023
b3ae0f4
Merge pull request #1911 from etang-cw/NoAbortOnCompilationFailure
billhollings May 18, 2023
6c633a7
update SPIRV-Cross revision to include explicit LOD workaround regres…
italomandara May 20, 2023
0125e5b
Revert "Allow to disable Explicit LOD Workaround"
italomandara May 20, 2023
1a386e0
Merge pull request #1913 from italomandara/update-spirv-cross-revision
billhollings May 21, 2023
c231c90
Update dependency libraries to match Vulkan SDK 1.3.250.
billhollings May 23, 2023
a832e38
Merge pull request #1916 from billhollings/sdk-1.3.250
billhollings May 23, 2023
b863ece
Accumulate render stages when a resource is used by multiple descript…
billhollings May 23, 2023
3d7f996
Merge pull request #1918 from billhollings/accumulate-render-stages
billhollings May 23, 2023
b26ce32
Advertise VK_KHR_depth_stencil_resolve extension on all devices.
billhollings May 23, 2023
4c6bfbe
Merge pull request #1920 from billhollings/always-advertise-VK_KHR_de…
billhollings May 24, 2023
83a1811
Ensure compute encoding state is marked dirty for non-dispatch commands.
billhollings May 26, 2023
2a4e415
Merge pull request #1922 from billhollings/fix-comp-enc-state
billhollings May 26, 2023
107be11
Add support for VK_PRESENT_MODE_IMMEDIATE_KHR to macOS Cube demo.
billhollings May 31, 2023
0332055
Merge pull request #1927 from billhollings/demo-support-immediate-pre…
billhollings May 31, 2023
6fb5347
Support VK_PRESENT_MODE_IMMEDIATE_KHR if VkPresentTimeGOOGLE::desired…
billhollings Jun 5, 2023
3fbde16
update SPIRV-Cross revision to include function constant fix; closes …
rcombs Jun 6, 2023
3690a52
Merge pull request #1942 from rcombs/spirv-cross-fix
billhollings Jun 7, 2023
750adca
Advertise the VK_EXT_shader_demote_to_helper_invocation extension.
cdavis5e Oct 29, 2020
4974860
Merge pull request #1935 from cdavis5e/shader-demote-to-helper
billhollings Jun 7, 2023
4949c34
Merge pull request #1936 from billhollings/present-imm-mode-unless-pr…
billhollings Jun 7, 2023
e724357
Allows maximizing the concurrent executing compilation tasks.
RaafatAkkad Jun 10, 2023
bdbf9ab
Merge pull request #1944 from RaafatAkkad/main
billhollings Jun 14, 2023
b94553d
Allow both renderPass and VkPipelineRenderingCreateInfo to be missing.
billhollings Jun 14, 2023
4a9bf78
Merge pull request #1946 from billhollings/no-rendpass-no-dyn-rend-info
billhollings Jun 15, 2023
425505d
Don't call MTLCreateSystemDefaultDevice() on every swapchain creation.
billhollings Jun 15, 2023
e69c249
Log more info about SPIR-V to MSL conversion errors.
billhollings Jun 15, 2023
78f3e1e
Merge pull request #1951 from billhollings/log-shdr-conv-err-info
billhollings Jun 16, 2023
9356c89
Merge pull request #1949 from billhollings/swap-system-GPU-fix
billhollings Jun 16, 2023
33cd6f2
Implemented Deferred Host Operations
AntarticCoder Jun 19, 2023
ab70871
Fixed comments for deferred operations
AntarticCoder Jun 20, 2023
c0705c8
Made some fixes for Deferred Operations
AntarticCoder Jun 20, 2023
fa19fcc
Push to Compile MVKSmallVector with void*
AntarticCoder Jun 20, 2023
e5bfc2d
C-Style Arrays instead of MVKSmallVector
AntarticCoder Jun 21, 2023
3e1fb4f
Merge pull request #1954 from AntarticCoder/khr-deferred-operation
billhollings Jun 22, 2023
5d173d0
Support the `VK_EXT_4444_formats` extension.
cdavis5e Jun 7, 2023
16990ef
Support building for visionOS
ifiddynine Jun 23, 2023
d8b5a7d
Merge branch 'main' of https://github.com/KhronosGroup/MoltenVK into …
ifiddynine Jun 23, 2023
a756b8c
Fix MVK_MACOS_OR_IOS_OR_VISIONOS check
ifiddynine Jun 23, 2023
67814ba
Fix build with latest main
ifiddynine Jun 23, 2023
591eb6b
Merge pull request #1955 from cdavis5e/4444-formats
cdavis5e Jun 23, 2023
4540175
Fix mvkOSVersionIsAtLeast on Vision
ifiddynine Jun 23, 2023
4e3ac69
Support the `VK_EXT_calibrated_timestamps` extension.
cdavis5e Jun 23, 2023
5253e6f
Advertise the `VK_KHR_shader_non_semantic_info` extension.
cdavis5e Jun 24, 2023
714781e
Merge pull request #1958 from cdavis5e/calibrated-timestamps
billhollings Jun 26, 2023
b74feb7
Support `VK_EXT_shader_subgroup_ballot` and `VK_EXT_shader_subgroup_v…
cdavis5e Jun 24, 2023
c85507b
Merge pull request #1960 from cdavis5e/shader-non-semantic-info
billhollings Jun 26, 2023
96204ad
Merge pull request #1961 from cdavis5e/legacy-subgroup
billhollings Jun 26, 2023
e5d3939
Add support for VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN.
billhollings Jun 28, 2023
c34bb54
Fix unreachable code in MVKDeferredOperation::join().
billhollings Jun 29, 2023
27f68eb
Merge pull request #1964 from billhollings/fix-unreachable-code
billhollings Jun 30, 2023
41dbd9d
Merge pull request #1962 from billhollings/tri-fans
billhollings Jul 1, 2023
6bca44c
Added MSL Version 3.1 for switch case
AntarticCoder Jul 5, 2023
056dec8
Completed the support for MSL 3.1 enum
AntarticCoder Jul 5, 2023
2db85ea
Merge pull request #1966 from AntarticCoder/msl-3-1
billhollings Jul 5, 2023
21ac744
MVKDevice: Don't enable sample LoD depth array workaround for macOS S…
cdavis5e Jul 7, 2023
3914b0f
Support the `VK_KHR_incremental_present` extension.
cdavis5e Jul 10, 2023
ca8e060
Merge pull request #1969 from cdavis5e/sonoma-depth-array-lod
billhollings Jul 10, 2023
561e14b
Support the `VK_EXT_pipeline_creation_feedback` extension.
cdavis5e Jul 7, 2023
1728f7f
Merge pull request #1968 from cdavis5e/pipeline-creation-feedback
billhollings Jul 11, 2023
dff64e9
Merge pull request #1972 from cdavis5e/incremental-present
billhollings Jul 11, 2023
855c7a6
Merge branch 'visionOS' of https://github.com/nginetechnologies/Molte…
billhollings Jul 11, 2023
6374d9d
Fix visionOS build errors and warnings where possible.
billhollings Jul 11, 2023
97eb80b
Merge pull request #1976 from billhollings/nginetechnologies-visionOS
billhollings Jul 12, 2023
f6ba6f2
Drop official support for using Xcode 11 to build MoltenVK.
billhollings Jul 12, 2023
42fa511
Merge pull request #1977 from billhollings/drop-support-xcode-11
billhollings Jul 12, 2023
817038e
Fix regression caused by #1922
mbechard Jul 19, 2023
cf531d0
Merge pull request #1980 from mbechard/main
billhollings Jul 19, 2023
5294c19
Fix bad access regression to prematurely-deallocated MTLFunction.
billhollings Jul 19, 2023
d9b32e0
Merge pull request #1981 from billhollings/fix-bad-access-regression
billhollings Jul 20, 2023
f7e0d7d
Don't fetch a submodule if the commit is already known
stefand Jul 28, 2023
7cb6096
Merge pull request #1982 from stefand/main
billhollings Jul 31, 2023
dd31587
Fix sync delay between calls to vkQueueSubmit() on non-Apple-Silicon …
billhollings Aug 12, 2023
41a5a97
Ensure Xcode simulator always uses 256B buffer alignment.
billhollings Aug 14, 2023
8518a4f
Merge pull request #1992 from billhollings/fix-submit-sync-delay
billhollings Aug 14, 2023
47840b9
Merge pull request #1993 from billhollings/fix-sim-buff-align
billhollings Aug 14, 2023
4fe8811
Update dependency libraries to match Vulkan SDK 1.3.261.
billhollings Aug 15, 2023
b3c9f86
Merge pull request #1994 from billhollings/sdk-1.3.261
billhollings Aug 15, 2023
530bde1
Fix VkPhysicalDeviceLimits::timestampPeriod calculations on Intel GPU.
billhollings Aug 17, 2023
02a8c01
Merge pull request #1997 from billhollings/fix-Intel-timestampPeriod
billhollings Aug 17, 2023
7910083
Fix rare case where vertex attribute buffers are not bound to Metal.
billhollings Aug 23, 2023
fd418aa
Merge pull request #2001 from billhollings/fix-unbound-vtx-attr-buff
billhollings Aug 24, 2023
4544e76
Implement geometry shaders using mesh pipelines.
js6i Sep 8, 2023
8cbaaa6
Temporarily switch SPIRV-Cross repository.
js6i Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 30 additions & 37 deletions Docs/MoltenVK_Runtime_UserGuide.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ Table of Contents
- [Install *MoltenVK* replacing the Vulkan SDK `libMoltenVK.dylib`](#install_vksdk)
- [Build and Runtime Requirements](#requirements)
- [Interacting with the **MoltenVK** Runtime](#interaction)
- [MoltenVK `VK_MVK_moltenvk` Extension](#moltenvk_extension)
- [MoltenVK Header Files](#moltenvk_headers)
- [Configuring MoltenVK](#moltenvk_config)
- [*Metal Shading Language* Shaders](#shaders)
- [Troubleshooting Shader Conversion](#spv_vs_msl)
@@ -384,7 +384,6 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_EXT_texture_compression_astc_hdr` *(iOS and macOS, requires family 6 (A13) or better Apple GPU)*
- `VK_MVK_ios_surface` *(iOS) (Obsolete. Use `VK_EXT_metal_surface` instead.)*
- `VK_MVK_macos_surface` *(macOS) (Obsolete. Use `VK_EXT_metal_surface` instead.)*
- `VK_MVK_moltenvk`
- `VK_AMD_gpu_shader_half_float`
- `VK_AMD_negative_viewport_height`
- `VK_AMD_shader_image_load_store_lod` *(requires Apple GPU)*
@@ -425,14 +424,12 @@ extension in the *Vulkan* specification for more information about the use of th
`VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR` flag.


<a name="moltenvk_headers"></a>
### MoltenVK Header Files

<a name="moltenvk_extension"></a>
### MoltenVK `VK_MVK_moltenvk` Extension

The `VK_MVK_moltenvk` *Vulkan* extension provides functionality beyond standard *Vulkan* functionality,
to support configuration options and behaviour that is specific to the **MoltenVK** implementation of *Vulkan*
functionality. You can access this functionality by including the `vk_mvk_moltenvk.h` header file in your code.
The `vk_mvk_moltenvk.h` file also includes the API documentation for this `VK_MVK_moltenvk` extension.
**MoltenVK** provides additional functionality beyond standard *Vulkan* functionality,
to support configuration options and query behaviour that is specific to the **MoltenVK**
implementation of *Vulkan* functionality.

The following API header files are included in the **MoltenVK** package, each of which
can be included in your application source code as follows:
@@ -441,37 +438,33 @@ can be included in your application source code as follows:

where `HEADER_FILE` is one of the following:

- `vk_mvk_moltenvk.h` - Contains declarations and documentation for the functions, structures,
and enumerations that define the behaviour of the `VK_MVK_moltenvk` *Vulkan* extension.

- `mvk_vulkan.h` - This is a convenience header file that loads the `vulkan.h` header file
with the appropriate **MoltenVK** *Vulkan* platform surface extension automatically
enabled for *macOS*, *iOS*, or *tvOS*. Use this header file in place of the `vulkan.h`
header file, where access to a **MoltenVK** platform surface extension is required.

The `mvk_vulkan.h` header file automatically enables the `VK_USE_PLATFORM_METAL_EXT`
build setting and `VK_EXT_metal_surface` *Vulkan* extension.
- `mvk_vulkan.h` - This is a convenience header file that loads the `<vulkan/vulkan.h>` header file
with platform settings to enable the appropriate platform-surface and portability extensions.

- `mvk_datatypes.h` - Contains helpful functions for converting between *Vulkan* and *Metal* data types.
You do not need to use this functionality to use **MoltenVK**, as **MoltenVK** converts between
*Vulkan* and *Metal* datatypes automatically (using the functions declared in this header).
These functions are exposed in this header for your own purposes such as interacting with *Metal*
directly, or simply logging data values.

>***Note:*** Except for `vkGetMoltenVKConfigurationMVK()` and `vkSetMoltenVKConfigurationMVK()`,
the functions in `vk_mvk_moltenvk.h` are not supported by the *Vulkan SDK Loader and Layers*
framework. The opaque Vulkan objects used by the functions in `vk_mvk_moltenvk.h` (`VkPhysicalDevice`,
`VkShaderModule`, `VKImage`, ...), must have been retrieved directly from **MoltenVK**, and not through
the *Vulkan SDK Loader and Layers* framework. The *Vulkan SDK Loader and Layers* framework often changes
these opaque objects, and passing them from a higher layer directly to **MoltenVK** will result in
undefined behaviour.
- `mvk_config.h` - Contains public functions and structures to allow you to configure and
optimize **MoltenVK** for your particular application runtime requirements. For more
information, see the [Configuring MoltenVK](#moltenvk_config) section just below.

- `mvk_private_api.h` - Contains functions and structures to allow you to query **MoltenVK**
performance activity, and Metal capabilities on the platform. _**NOTE:**_ THESE
FUNCTIONS ARE NOT SUPPORTED BY THE *Vulkan Loader and Layers*, AND CAN ONLY BE USED
WHEN **MoltenVK** IS LINKED DIRECTLY TO YOUR APPLICATION.

- `mvk_datatypes.h` - Contains helpful functions for converting between *Vulkan* and *Metal*
data types. You do not need to use this functionality to use **MoltenVK**, as **MoltenVK**
converts between *Vulkan* and *Metal* datatypes automatically (using the functions declared
in this header). These functions are exposed in this header as a convienience for your own
purposes such as interacting with *Metal* directly, or simply logging data values.


<a name="moltenvk_config"></a>
### Configuring MoltenVK

The `VK_MVK_moltenvk` *Vulkan* extension provides the ability to configure and optimize
**MoltenVK** for your particular application runtime requirements.
The `mvk_config.h` header file provides the ability to configure and optimize **MoltenVK**
for your particular application runtime requirements. This can be helpful in situtations
where *Metal* behavior is different than *Vulkan* behavior, and the results or performance
you receive can depend on how **MoltenVK** works around those differences, which, in turn, may
depend on how you are using *Vulkan*. Different apps might benefit differently in this handling.

There are three mechanisms for setting the values of the **MoltenVK** configuration parameters:

@@ -488,9 +481,9 @@ by a corresponding environment variable, or if the environment variable is not s
by a corresponding build setting at the time **MoltenVK** is compiled. The environment
variable and build setting for each configuration parameter share the same name.

See the description of the `MVKConfiguration` structure parameters and corresponding environment
variables in the `vk_mvk_moltenvk.h` file for more info about configuring and optimizing
**MoltenVK** at runtime or build time.
See the description of the `MVKConfiguration` structure parameters and corresponding
environment variables in the `mvk_config.h` file for more info about configuring and
optimizing **MoltenVK** at runtime or build time.


<a name="shaders"></a>
1 change: 1 addition & 0 deletions Docs/Whats_New.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ Released TBD
- `VK_KHR_map_memory2`
- Support BC compression on iOS/tvOS where available (iOS/tvOS 16.4 and above and supported by the GPU).
- Support separate depth and stencil attachments during dynamic rendering.
- Deprecate the obsolete and non-standard `VK_MVK_moltenvk` extension.
- Fix memory leak when waiting on timeline semaphores.
- Ensure shaders that use `PhysicalStorageBufferAddresses` encode the use of the associated `MTLBuffer`.
- Disable pipeline cache compression prior to macOS 10.15 and iOS/tvOS 13.0.
Loading