85 Commits

Author SHA1 Message Date
Bill Hollings
50828dde93 fetchDependencies supports iOS simulator fat external library builds.
fetchDependencies supports options for specifying which platform options to build for.
Fix SPIRV-Tools builds to avoid code stripping warnings.
2020-06-17 19:10:33 -04:00
Bill Hollings
491698e49d Support iOS simulator and fat library builds of external dependency libraries.
Create fat builds of external libraries if both iOS and simulator versions
have been created from separate manual Xcode builds.
Add Scripts/create_fat_libs.sh.
Remove Scripts/package_ext_libs_ios.sh and Scripts/package_ext_libs_macos.sh.
2020-06-17 13:22:10 -04:00
Aman Gupta
a0e357fab5 Merge remote-tracking branch 'upstream/master' into tvos 2020-06-17 10:05:40 -07:00
Aman Gupta
3a8dc355b5 try setting more tvos bits 2020-06-09 15:41:19 -07:00
Aman Gupta
118ef06371 add tvos targets to the xcode projects 2020-06-09 15:16:14 -07:00
Bill Hollings
752c1a908d Refactor Xcode build architectures
Set ARCHS build setting to $(ARCHS_STANDARD_64_BIT) in Xcode projects.
Remove ARCHS and VALID_ARCHS build settings in Xcode targets.
2020-06-09 16:39:23 -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
Bill Hollings
0904c49014 Alphabetize file sorting in Xcode Project Navigator. 2020-04-09 14:19:46 -04:00
Bill Hollings
a58f6bc441 Update to Vulkan SDK 1.2.135 library dependencies.
Add Scripts/packagePregenSpirvToolsHeaders script to automate packaging Spirv-Tools
headers in support of the fetchDependencies --skip-spirv-tools-build option.
Update Docs/Whats_New.md.
2020-04-02 16:35:48 -04:00
Bill Hollings
50eba6fee1 Support Xcode 11.4. 2020-03-25 20:24:07 -04:00
Bill Hollings
a64f62ee53 Update dependency libraries to match Vulkan SDK 1.1.130.
Update ExternalRevisions/README.md to document new glslang build settings.
Update What's New document.
2019-12-16 14:24:57 -05:00
Bill Hollings
b213996c5e Support Xcode 11.3.
Update What's New document.
2019-12-12 12:38:17 -05:00
Bill Hollings
025abe501a Support Xcode 11.2. 2019-11-04 20:39:41 -05:00
Bill Hollings
0b1189dc03 Update external libraries to support Vulkan SDK 1.1.126.
Update What's New document.
2019-10-29 11:55:16 -04:00
Bill Hollings
19c397e0b7 Move generation of SPIRV-Cross/mvkSpirvCrossRevisionDerived.h to separate script.
Add Scripts/gen_spirv_cross_rev_hdr.sh script and
call from ExternalDependencies SPIRV-Cross build.
2019-10-22 16:51:27 -04:00
Bill Hollings
69cc9c9759 ExternalDependencies Xcode project support Xcode 11. 2019-10-22 11:17:30 -04:00
Bill Hollings
a2951a19e6 Support Xcode 11.
Declare _formatDescriptions[] in mvk_datatypes.mm as officially writable
because Clang now locates static const in non-writable memory.
Update build settings to Xcode 11.
Update MoltenVK_Runtime_UserGuide.md about embedding `libMoltenVK.dylib` in an application.
2019-10-01 00:25:09 -04:00
Bill Hollings
d585a9819e Updates to support Vulkan SDK 1.1.121.
Remove obsolescence log message for vkCreateMacOSSurfaceMVK()
and vkCreateIOSSurfaceMVK() functions.
Fix test for alignment of invalid pixel formats.
Update dependency libraries to match Vulkan SDK 1.1.121.
Update to renaming of VK_INTEL_shader_integer_functions2
enums and structs in latest Vulkan headers.
Update Whats_New.md document.
2019-09-10 13:25:19 -04:00
Bill Hollings
2f468db9a2 Updates for SDK 1.1.114 release.
Update to latest external dependency libraries.
Rename components of VK_INTEL_shader_integer_functions2 to match 1.1.114 Vulkan spec.
Update What's New document.
2019-07-23 14:29:32 -04:00
Bill Hollings
bf8c7f8bb8 Updates for SDK 1.1.108 release.
Update to latest external dependency libraries.
MVKDescriptorSetLayoutBinding allow binding of null MVKBuffer.
Update What's New document.
2019-06-13 17:11:44 -04:00
Bill Hollings
ee6e6f5ad0 Enable AMD and NV GLSL extensions when building glslang for MoltenVKGLSLToSPIRVConverter. 2019-04-18 17:39:25 -04:00
Bill Hollings
62f374bf7e Allow building external dependency libraries in Debug mode.
Add ExternalDependencies (Debug) scheme to ExternalDependencies Xcode project.
Add --debug option to fetchDependencies script.
Support Release, Debug & Latest directories in External/build directory.
Enable DEPLOYMENT_POSTPROCESSING build setting when compiling
SPIRV-Tools to avoid warning spam when building dylibs.
Disable visibility warnings when building MoltenVKShaderConverter
in Release mode from external libraries built in Debug mode.
Always use -Xlinker -w option when creating dylibs to disable visibility warnings.
2019-04-18 15:08:39 -04:00
Bill Hollings
189a41e8d2 Update dependency libraries for SDK 1.1.106. 2019-04-11 17:52:50 -04:00
Bill Hollings
dfd5638a0f Clean up use of SPIRV_CROSS_NAMESPACE_OVERRIDE in Xcode projects.
Setting of SPIRV_CROSS_NAMESPACE_OVERRIDE in Xcode projects was stomping on DEBUG setting.
Update What's New document.
2019-04-01 22:41:20 -04:00
Hans-Kristian Arntzen
38edfdb3de Override namespace for SPIRV-Cross.
Some projects also link against SPIRV-Cross statically, and in order to
avoid ABI conflicts, we should use a private namespace for the
SPIRV-Cross dependency to avoid bugs. See SPIRV-Cross issue #902 for
more information. The new namespace is MVK_spirv_cross, and the code
now makes use of the SPIRV_CROSS_NAMESPACE macro rather than spirv_cross.
2019-03-29 11:34:55 +01:00
Bill Hollings
e4d96f6fa2 Support Xcode 10.2. 2019-03-26 11:50:39 -04:00
Bill Hollings
0ac1edbac0 Project build enhancements, and MoltenVKShaderConverter
tool now validates converted MSL with a test compilation.

Project build scripts now build dylib and framework in separate build directories
to enable MoltenVKShaderConverter to link to static library instead of dynamic library.
Final Package structure remains the same.
In Debug build, copy dylib dSYM files to Package.
Package/Latest directory now links relative to local Debug or Release directory.
Add install option to Makefile.
MoltenVKShaderConverter tool now validates converted MSL with a test compilation.
Clean up various MSL conversion and compilation error logging.
MVKCommandResourceFactory wrap Metal library compile with autorelease pool.
Build ExternalDependencies with same symbol hiding as MoltenVK to suppress visibility warnings.
Update What's New document.
2019-03-22 19:36:21 -04:00
Chip Davis
79d434553c Add support for tessellation.
At long last, tessellation comes to MoltenVK! With this change, clients
will now be able to specify tessellation shaders when creating
pipelines, and then draw tessellated patches with them.

Unfortunately, there seem to be a few gotchas with tessellation in
Metal. For one thing, tessellation pipelines in Metal are structured
very differently from Vulkan. There is no tessellation control or even
vertex stage. Instead, the tessellation evaluation shader takes the
place of the vertex function as a "post-tessellation vertex function."
The tessellation levels are supplied in a buffer to the tessellator,
which you are expected to populate. The most common way to do this is by
running a compute shader. MoltenVK thus runs the vertex shader and
tessellation control shader by themselves; a single `VkPipeline` object
then requires at least *three* `MTLPipelineState` objects.

But wait, there's more! The tessellation-control-as-compute stage uses
Metal's support for vertex-style stage input to a compute shader. But,
this support requires one to declare indexing *ahead of time*, when the
pipeline state is created. So a single `VkPipeline` object could have as
many as *five* `MTLPipelineState` objects.

Further, if there are more output than input control points for the
tessellation control stage, then later invocations may end up fetching
the wrong attributes! To get around this, this change uses index buffers
to ensure that all tessellation control shaders see the correct input.
Unfortunately, in the indexed draw case, this means that the incoming
index buffer needs to be munged.

Instancing is another pain point here. In Vulkan, as in OpenGL and
Direct3D, instancing is done in the vertex shader; but in Metal, it is
done at the tessellation evaluation stage. For this reason, only the
vertex stage of a tessellated draw supports instancing. Additional
memory is required to hold data for the extra vertices generated by
instancing. This also requires still more munging of index buffers for
indexed draws.

Indirect draws are even more painful. Because the number of vertices and
instances is unknown, storage for the maximum possible number of
vertices must be allocated. This change imposes a totally arbitrary
limit of 131072 vertices from a single draw, including all vertices
generated by instancing. On a Mac, this requires about 194-256 MB of
VRAM for all the temporary buffers.

There are some possible optimizations here. If we could prove that the
vertex shader's output doesn't depend on the instance ID, either
directly or through a per-instance attribute, then we could avoid
running the vertex and tess. control stages per instance, and take
advantage of Metal's support for tess. eval instancing. If we could
also prove that the vertex shader simply passes instance attributes
through (similarly with the tess. control shader), we could do this for
many more instanced draws as well. It should also be possible to cache
the output from the tess. control stage; if the draw comes up again, we
can then skip the vertex and tess. control stages entirely!

Fixes #56 and #501.
2019-03-11 14:19:49 -05:00
Bill Hollings
3b1e53002e Increase shader float constant accuracy beyond 6 digits of precision. 2019-03-06 08:58:27 -05:00
Bill Hollings
fd8aa3c412 Update to latest dependency libraries to support SDK 1.1.101.
Remove SPRIV-Cross source files erroneously compiling into libglslang.a.
2019-02-27 11:56:31 -05:00
Bill Hollings
991a1944fe Update to latest dependency libraries for Vulkan SDK 1.1.97.
Update to latest SPIRV-Cross version:
2019-01-17 15:27:20 -05:00
Bill Hollings
fde6d98866 Remove support for arm64e architecture until it is better supported by Xcode. 2019-01-03 16:43:50 -05:00
Bill Hollings
d34b0812fe Allow building external libraries from fetchDependencies script or Xcode.
The fetchDependencies script puts build files in External/build directory.
Xcode puts build files in standard Library/.../DerivedData directory.
Copy compiled external static library files to External/build/iOS &
External/build/macOS regardless of location of intermediates.
2018-12-25 21:43:29 -05:00
Bill Hollings
9b42574249 Build external dependencies into static libraries in External/build when fetched.
Add separate ExternalDependencies Xcode project.
Move external dependencies to ExternalDependencies project.
The fetchDependencies script builds external dependencies libraries into External/build.
The fetchDependencies script prepares SPIRV-Tools without preparing glslang.
MoltenVK links to pre-built external dependency static libraries.
MoltenVK includes external library headers using full relative paths.
2018-12-24 19:11:15 -05:00