139 Commits

Author SHA1 Message Date
Bill Hollings
216e86de19 Allow logging level to be controlled via runtime environment variable. 2019-01-29 21:10:31 -05:00
Bill Hollings
e5a890775b Add support for VK_EXTX_portability_subset extension.
Add KhronosGroup/Vulkan-Portability as external dependency repo.
Add ExternalRevisions/Vulkan-Portability_repo_revision.
Add vk_extx_portability_subset.h header file to mvk_vulkan.h.
MVKImageView allow constructor with no image or device.
Add mvkVkComponentMappingsMatch() & mvkVkComponentSwizzlesMatch() functions.
Cleanup some local var init warnings.
2019-01-27 19:52:59 -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
76146fc2a8
Merge pull request #437 from billhollings/master
Support iOS builds for arm64e architecture.
2018-12-31 18:07:37 -05:00
Chip Davis
5c8a472a1b Add support for uploading 3D S3TC-compressed images.
This allows clients to initialize 3D image objects with data in a BC1,
BC2, or BC3 (aka DXTn, aka S3TC) format. Since Metal doesn't support
this natively, DXTn-compressed image data are manually decompressed
prior to upload or copying. This particular algorithm was derived from
Wine, from code originally authored by Connor McAdams. It's somewhat
primitive, and could probably stand some vectorization, but it's a good
first start.

The meat of the algorithm is pulled into a header, "MVKDXTnCodec.def",
intended to be used by both CPU and shader code. CPU uploads, which in
MoltenVK happen when binding a `VkDeviceMemory` object to an image, run
the code normally. GPU uploads, i.e. copying from a buffer to a texture,
run the algorithm as a compute shader, possibly storing the results to
an intermediate buffer to then copy directly to the texture.
Intermediate buffers are used when uploading to mip levels higher than
0, since desktop Metal doesn't support directly writing to higher mip
levels from a shader.

Only uploads are supported. Downloads are not implemented yet.

Theoretically, this could be extended to other compressed formats as
well, allowing MoltenVK to support all texture compression formats on
all platforms.
2018-12-31 15:51:06 -06:00
Bill Hollings
66a407dcc6 Support iOS builds for arm64e architecture. 2018-12-31 16:46:45 -05:00
aerofly
3587bcf02f mvk_vector 2018-12-09 17:18:40 +01:00
Bill Hollings
38160b3eb3 MoltenVK 1.0.26.
Fixes to create_dylib.sh to cleanup bitcode and architecture support.
Update to latest SPIRV-Cross version.
Update MoltenVK version to 1.0.26.
Update Xcode projects to Xcode 10.1.
Update What's New document.
2018-11-06 16:01:36 -05:00
Bill Hollings
1d64dae0cc
Merge pull request #326 from DiegoAce/master
Force Bitcode When Building
2018-11-05 17:14:57 -05:00
Ryan Schmidt
7354f8ddcd Use the -arch flag(s) specified by Xcode 2018-11-05 06:57:19 -06:00
DiegoAce
b91882cfc8 Force Bitcode When Building
Enabling bitcode in Xcode only adds the -fembed-bitcode-marker flag, which doesn't actually create bitcode. The Archive action transforms that flag to -fembed-bitcode which actually creates the bitcode. Adding the User-Defined Setting BITCODE_GENERATION_MODE=bitcode forces bitcode to be created without archiving.
2018-10-31 16:44:59 -05:00
Bill Hollings
025259426c Refactor the build environment.
Support creation of static library and build framework and dynamic library from it.
Add Makefile to better support command line or script building integration.
Update demos to each use one of framework, static library, and dynamic library.
Refactor and rename the build scripts.
Refactor and rename the Xcode Schemes.
Update build and runtime documentation.
Update What's New document.
2018-10-30 23:16:12 -04:00
Bill Hollings
7dd143411a
Merge pull request #298 from francoisbertelatschrodinger/whitespaces
Make PhaseScriptExecution works when SRCROOT path has whitespaces.
2018-10-15 13:54:07 -04:00
François Bertel
014b936c4e Make PhaseScriptExecution works when SRCROOT path has whitespaces. 2018-10-08 14:11:39 -04:00
Bill Hollings
4fba647123 Optimize scheme configuration and make consistent. 2018-10-03 10:09:47 -04:00
Bill Hollings
c933330406 Allocate MVKDescriptorSets from a pool within MVKDescriptorPool,
keyed by MVKDescriptorSetLayout reference.

Add MVKObjectPool subclass MVKDeviceObjectPool.
Enlarge window dimensions on macOS Cube demo.
2018-09-30 18:07:13 -04:00
Chip Davis
ec522f0168 Pull extension definitions into a common file.
`#include` this file to define the various bits and pieces needed to
support an extension. Now instead of having to change three places, we
now only need change one.

Also, sort the list of extensions. This list is starting to get a little
long and unruly, so before it gets completely out of hand, let's apply a
little semblance of order to it. The extensions are now arranged in the
following order: first, the Khronos-blessed extensions; then multivendor
extensions; then our (`MVK`) extensions; and finally other vendors'
extensions. These subgroups are sorted alphabetically, as Khronos'
master list is.

I'm not happy about the `MVK_EXTENSION_LAST` kluge. But, C++ apparently
doesn't let you stick a dangling comma on a constructor's initializer
list.
2018-09-19 20:57:29 -05:00
Bill Hollings
e721dd6e2c Update build process.
Allow building and packaging MoltenVK for of only iOS or only macOS.
Move packaging scripts out of Xcode projects and into script files.
2018-09-07 11:46:58 -04:00
Bill Hollings
63ce4cf1f5 Vulkan extension enhancements.
Add MVKExtensionList struct to track supported and enabled Vulkan extensions within MVKInstance & MVKDevice.
Log supported and enabled Vulkan extensions for VkInstance & VkDevice.
Add error handling for descriptor sets & 3D images in VK_KHR_maintenance1 extension.
All header files load mvk_vulkan.h instead of vulkan.h for consistent use of macOS & iOS extensions.
2018-09-01 16:42:10 -04:00
Bill Hollings
c8a9841d8c Support pre-linking on both Xcode 9 & 10. Update library dependencies.
Remove linking MoltenVKSPIRVToMSLConverter from Build Phase in favour of PreLink.
Update to Vulkan header 1.1.83.
Update to latest version of library dependencies.
2018-08-23 14:02:05 -04:00
Bill Hollings
5bc8403cc1 Support Xcode 10.
Explicitly specify MoltenVKSPIRVToMSLConverter as prelink library.
Update build setting verification check.
2018-08-22 16:22:37 -04:00
Bill Hollings
008274ba67 Support Metal GPU capture scopes.
Add MVKGPUCaptureScope class.
MVKQueue support separate presentation and submission scopes.
2018-08-14 12:32:01 -04:00
Bill Hollings
2d4de6db68 Fixes to attachment and image clearing to pass CTS tests.
MVKCmdClearAttachments support clearing multiple attachment layers.
MVKCmdClearImage use renderpass clear, and support clearning multiple image layers.
Rename mvkCmdClearImage() to mvkCmdClearColorImage().
MVKDevice add getFormatIsSupported() to allow devices to test for format support.
MVKFramebuffer support multiple layers.
mvk_datatypes.h support both 2D and 3D mipmap calculations and allow
mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology() in iOS.
Remove support for VK_FORMAT_B10G11R11_UFLOAT_PACK32 & VK_FORMAT_E5B9G9R9_UFLOAT_PACK32
since format components are reversed on Metal.
Move OS extension source files to new OS directory.
Update to latest SPIRV-Cross version.
Update MoltenVK version to 1.0.16.
2018-07-23 20:12:57 -04:00
Bill Hollings
86bb51554b Support IOSurface on iOS only if IPHONEOS_DEPLOYMENT_TARGET is at least iOS 11.0.
On iOS, only compile IOSurface support, and link IOSurface framework to
libMoltenVK.dylib, if IPHONEOS_DEPLOYMENT_TARGET is at least iOS 11.0.
Update to latest version of SPIRV-Cross.
Update MoltenVK version to 1.0.15.
2018-07-12 18:26:54 -04:00
Nat Brown
4ef6a0f8c9 Removes references to IOSurface framework on IOS and markes the IOSurface features as unavailable. A better solution would be to not support IOSurface features prior to iOS 11.0 when the framework became partially public, but this is a good initial solution. 2018-07-09 06:26:11 -07:00
Bill Hollings
9ae35d73c4 Update Xcode version checks to Xcode 9.4. 2018-06-14 12:46:41 -04:00
Bill Hollings
84f92e0d0e Fix merge conflicts and missing OSX files from class extension file refactoring. 2018-05-04 13:02:07 -04:00
Bill Hollings
f857011ec1 Add features to support Vulkan CTS.
Dynamically create frag shaders for clearning attachments and images.
Dynamically create frag shaders for blitting scaled images.
MVKGraphicsPipeline don't create MTLRenderPipelineState if vertex function conversion fails.
MVKComputePipeline don't create MTLComputePipelineState if compute function conversion fails.
Handle SPIRV-Cross errors thrown during SPIR-V parsing in compiler construction.
Set undefined property limits to large, but not max, values to avoid casting issues in app.
Mark multiDrawIndirect features as available.
Update to latest SPIRV-Cross version.
Update to MoltenVK version 1.0.5.
2018-05-04 12:11:19 -04:00
Hanton Yang
723fa9650d Separate categories from MVKOSExtensions.
MTLTextureDescriptor+MoltenVK
MTLSamplerDescriptor+MoltenVK
CAMetalLayer+MoltenVK
2018-04-27 23:04:28 +08:00
Bill Hollings
9fe7e3659a Clean up reference to SDK in dylib build script. 2018-04-09 17:42:51 -04:00
Bill Hollings
20c98e5e46 Add support for caching converted MSL shader code offline from pipeline cache
via vkGetPipelineCacheData(), vkCreatePipelineCache() & vkMergePipelineCaches().

Add the cereal serialization framework as a dependency.
Update documentation. Update project settings to Xcode 9.3.
2018-03-30 12:13:50 -04:00
Bill Hollings
00fda690ca Align versioning of external libraries with those used by LunarG SDK.
Load external library versions using script instead of Git submodules.
SPIRV-Cross, Vulkan-LoaderAndValidationLayers & VulkanSamples versions recorded in files.
glslang version determined by Vulkan-LoaderAndValidationLayers.
SPIRV-Tools & SPIRV-Headers versions loaded by glslang.
When MoltenVK is built as part of the LunarG SDK, use external libraries
sourced from parent Vulkan-LoaderAndValidationLayers.
Use Vulkan headers from Vulkan-LoaderAndValidationLayers.
No longer generate Vulkan specification.
Update documentation.
2018-03-12 10:02:13 -04:00
Bill Hollings
a4e4222140 Populate VkPhysicalDeviceProperties vendorID, deviceID and pipelineCacheUUID.
Fix MVKShaderLibrary missing function prototype warning.
Update to latest SPIRV-Cross.
Update to latest Vulkan-Hpp.
Update to latest Vulkan-LoaderAndValidationLayers.
2018-02-21 14:24:21 -05:00
Karl Schultz
c4ce08402d Disable watermark in debug builds 2018-02-13 12:47:18 -07:00
Bill Hollings
9c4d66d7a6 Add Vulkan Loader and Validation Layer ICD JSON file. 2018-01-09 21:12:02 -05:00
Bill Hollings
9b185a9c3a Fixes to compute workgroup sizes and barriers.
Improved extraction of entry point name and workgroup size from SPIR-V.
Consolidate to a single ThirdPartyConfig.md document.
MSL enhancements to nested function use of globals.
Support customizing MSL based on iOS or macOS platform.
MSL threadgroup barrier memory scope only on iOS MSL 2.0.
Update to latest SPIRV libraries.
2017-12-26 22:20:20 -05:00
Bill Hollings
83f96078ec Add support for LunarG Vulkan Loader ICD API.
Return Loader-compatible structure for dispatchable Vulkan objects.
Add Vulkan-LoaderAndValidationLayers repository as submodule.
2017-12-21 10:48:51 -05:00
Bill Hollings
780d3efe62 Updates and fixes to dynamic library creation process.
Use clang instead of libtool for building dynamic library from static library.
Fix SDK issue when building dylib with Xcode 9 on Sierra.
Add scripts to update submodules to latest versions.
Update to latest versions of submodules.
Remove Brenwill code signing IDs from Demo projects.
2017-11-26 15:37:55 -05:00
Bill Hollings
fd7b8234f9 Initial open-source commit. 2017-11-17 11:14:29 -05:00