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.
This commit is contained in:
parent
40df55a9b4
commit
2d4de6db68
@ -56,16 +56,21 @@ About **MoltenVK**
|
||||
graphics and compute API, that runs on Apple's [*Metal*](https://developer.apple.com/metal)
|
||||
graphics and compute framework on both *iOS* and *macOS*.
|
||||
|
||||
**MoltenVK** allows you to use the *Vulkan* graphics and compute API to develop modern, cross-platform,
|
||||
high-performance graphical games and applications, and to run them across many platforms, including
|
||||
both *iOS* and *macOS*.
|
||||
**MoltenVK** allows you to use the *Vulkan* graphics and compute API to develop modern,
|
||||
cross-platform, high-performance graphical games and applications, and to run them across
|
||||
many platforms, including both *iOS* and *macOS*.
|
||||
|
||||
*Metal* uses a different shading language, the *Metal Shading Language (MSL)*, than
|
||||
*Vulkan*, which uses *SPIR-V*. However, fear not, as **MoltenVK** will automatically convert
|
||||
your *SPIR-V* shaders to their *MSL* equivalents. This can be performed transparently at run time,
|
||||
using the **Runtime Shader Conversion** feature of **MoltenVK**, or at development time using the
|
||||
[**MoltenVKShaderConverter**](#shader_converter_tool) tool provided with this **MoltenVK** distribution
|
||||
package.
|
||||
*Vulkan*, which uses *SPIR-V*. **MoltenVK** automatically converts your *SPIR-V* shaders
|
||||
to their *MSL* equivalents. This can be performed transparently at run time, using the
|
||||
**Runtime Shader Conversion** feature of **MoltenVK**, or at development time using the
|
||||
[**MoltenVKShaderConverter**] (#shader_converter_tool) tool provided with this **MoltenVK**
|
||||
distribution package.
|
||||
|
||||
To provide *Vulkan* capability to the *iOS* and *macOS* platforms, **MoltenVK** uses *Apple's*
|
||||
publicly available API's, including *Metal*. **MoltenVK** does **_not_** use any private or
|
||||
undocumented API calls or features, so your app will be compatible with all standard distribution
|
||||
channels, including *Apple's App Store*.
|
||||
|
||||
|
||||
<a name="install"></a>
|
||||
|
@ -1 +1 @@
|
||||
be7425ef70231ab82930331959ab487d605d0482
|
||||
cc7679ee4586a2e19cb6277fe40228b03d191760
|
||||
|
@ -13,10 +13,6 @@
|
||||
A90C8DEB1F45354D009CB32C /* MVKCommandEncodingPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A90C8DE81F45354D009CB32C /* MVKCommandEncodingPool.h */; };
|
||||
A90C8DEC1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = A90C8DE91F45354D009CB32C /* MVKCommandEncodingPool.mm */; };
|
||||
A90C8DED1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = A90C8DE91F45354D009CB32C /* MVKCommandEncodingPool.mm */; };
|
||||
A92CAF392098166B009DA08E /* NSString+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A92CAF342098166A009DA08E /* NSString+MoltenVK.h */; };
|
||||
A92CAF3A2098166B009DA08E /* NSString+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A92CAF342098166A009DA08E /* NSString+MoltenVK.h */; };
|
||||
A92CAF3B2098166B009DA08E /* NSString+MoltenVK.mm in Sources */ = {isa = PBXBuildFile; fileRef = A92CAF382098166B009DA08E /* NSString+MoltenVK.mm */; };
|
||||
A92CAF3C2098166B009DA08E /* NSString+MoltenVK.mm in Sources */ = {isa = PBXBuildFile; fileRef = A92CAF382098166B009DA08E /* NSString+MoltenVK.mm */; };
|
||||
A948BB7F1E51642700DE59F2 /* mvk_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A948BB7E1E51642700DE59F2 /* mvk_vulkan.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A948BB801E51642700DE59F2 /* mvk_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A948BB7E1E51642700DE59F2 /* mvk_vulkan.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
A94FB7B01C7DFB4800632CA3 /* mvk_datatypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A94FB7671C7DFB4800632CA3 /* mvk_datatypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -151,10 +147,6 @@
|
||||
A98149561FB6A3F7005F00B4 /* MVKFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = A98149451FB6A3F7005F00B4 /* MVKFoundation.mm */; };
|
||||
A98149571FB6A3F7005F00B4 /* MVKObjectPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149461FB6A3F7005F00B4 /* MVKObjectPool.h */; };
|
||||
A98149581FB6A3F7005F00B4 /* MVKObjectPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149461FB6A3F7005F00B4 /* MVKObjectPool.h */; };
|
||||
A98149591FB6A3F7005F00B4 /* MVKOSExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149471FB6A3F7005F00B4 /* MVKOSExtensions.h */; };
|
||||
A981495A1FB6A3F7005F00B4 /* MVKOSExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149471FB6A3F7005F00B4 /* MVKOSExtensions.h */; };
|
||||
A981495B1FB6A3F7005F00B4 /* MVKOSExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A98149481FB6A3F7005F00B4 /* MVKOSExtensions.mm */; };
|
||||
A981495C1FB6A3F7005F00B4 /* MVKOSExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A98149481FB6A3F7005F00B4 /* MVKOSExtensions.mm */; };
|
||||
A981495D1FB6A3F7005F00B4 /* MVKWatermark.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149491FB6A3F7005F00B4 /* MVKWatermark.h */; };
|
||||
A981495E1FB6A3F7005F00B4 /* MVKWatermark.h in Headers */ = {isa = PBXBuildFile; fileRef = A98149491FB6A3F7005F00B4 /* MVKWatermark.h */; };
|
||||
A981495F1FB6A3F7005F00B4 /* MVKWatermark.mm in Sources */ = {isa = PBXBuildFile; fileRef = A981494A1FB6A3F7005F00B4 /* MVKWatermark.mm */; };
|
||||
@ -167,24 +159,40 @@
|
||||
A981496C1FB6A998005F00B4 /* MVKStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = A981496A1FB6A998005F00B4 /* MVKStrings.h */; };
|
||||
A98149A21FB6B9E1005F00B4 /* MoltenVKSPIRVToMSLConverter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A98149821FB6B566005F00B4 /* MoltenVKSPIRVToMSLConverter.framework */; };
|
||||
A98149A51FB6B9F2005F00B4 /* MoltenVKSPIRVToMSLConverter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A98149841FB6B566005F00B4 /* MoltenVKSPIRVToMSLConverter.framework */; };
|
||||
A9917FF7209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF1209CC588004069EB /* MTLSamplerDescriptor+MoltenVK.m */; };
|
||||
A9917FF8209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF1209CC588004069EB /* MTLSamplerDescriptor+MoltenVK.m */; };
|
||||
A9917FF9209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF2209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h */; };
|
||||
A9917FFA209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF2209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h */; };
|
||||
A9917FFB209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF3209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h */; };
|
||||
A9917FFC209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF3209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h */; };
|
||||
A9917FFD209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF4209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m */; };
|
||||
A9917FFE209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF4209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m */; };
|
||||
A9917FFF209CC589004069EB /* CAMetalLayer+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF5209CC589004069EB /* CAMetalLayer+MoltenVK.h */; };
|
||||
A9918000209CC589004069EB /* CAMetalLayer+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9917FF5209CC589004069EB /* CAMetalLayer+MoltenVK.h */; };
|
||||
A9918001209CC589004069EB /* CAMetalLayer+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF6209CC589004069EB /* CAMetalLayer+MoltenVK.m */; };
|
||||
A9918002209CC589004069EB /* CAMetalLayer+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9917FF6209CC589004069EB /* CAMetalLayer+MoltenVK.m */; };
|
||||
A9C96DD01DDC20C20053187F /* MVKMTLBufferAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C96DCE1DDC20C20053187F /* MVKMTLBufferAllocation.h */; };
|
||||
A9C96DD11DDC20C20053187F /* MVKMTLBufferAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C96DCE1DDC20C20053187F /* MVKMTLBufferAllocation.h */; };
|
||||
A9C96DD21DDC20C20053187F /* MVKMTLBufferAllocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9C96DCF1DDC20C20053187F /* MVKMTLBufferAllocation.mm */; };
|
||||
A9C96DD31DDC20C20053187F /* MVKMTLBufferAllocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9C96DCF1DDC20C20053187F /* MVKMTLBufferAllocation.mm */; };
|
||||
A9E4B7891E1D8AF10046A4CE /* MVKMTLResourceBindings.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E4B7881E1D8AF10046A4CE /* MVKMTLResourceBindings.h */; };
|
||||
A9E4B78A1E1D8AF10046A4CE /* MVKMTLResourceBindings.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E4B7881E1D8AF10046A4CE /* MVKMTLResourceBindings.h */; };
|
||||
A9E53DD72100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DCD2100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m */; };
|
||||
A9E53DD82100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DCD2100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m */; };
|
||||
A9E53DD92100B197002781DD /* MVKOSExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DCE2100B197002781DD /* MVKOSExtensions.h */; };
|
||||
A9E53DDA2100B197002781DD /* MVKOSExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DCE2100B197002781DD /* MVKOSExtensions.h */; };
|
||||
A9E53DDB2100B197002781DD /* MVKOSExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DCF2100B197002781DD /* MVKOSExtensions.mm */; };
|
||||
A9E53DDC2100B197002781DD /* MVKOSExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DCF2100B197002781DD /* MVKOSExtensions.mm */; };
|
||||
A9E53DDD2100B197002781DD /* MTLTextureDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD02100B197002781DD /* MTLTextureDescriptor+MoltenVK.h */; };
|
||||
A9E53DDE2100B197002781DD /* MTLTextureDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD02100B197002781DD /* MTLTextureDescriptor+MoltenVK.h */; };
|
||||
A9E53DDF2100B197002781DD /* CAMetalLayer+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD12100B197002781DD /* CAMetalLayer+MoltenVK.h */; };
|
||||
A9E53DE02100B197002781DD /* CAMetalLayer+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD12100B197002781DD /* CAMetalLayer+MoltenVK.h */; };
|
||||
A9E53DE12100B197002781DD /* NSString+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD22100B197002781DD /* NSString+MoltenVK.h */; };
|
||||
A9E53DE22100B197002781DD /* NSString+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD22100B197002781DD /* NSString+MoltenVK.h */; };
|
||||
A9E53DE32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h */; };
|
||||
A9E53DE42100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DD32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h */; };
|
||||
A9E53DE52100B197002781DD /* NSString+MoltenVK.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD42100B197002781DD /* NSString+MoltenVK.mm */; };
|
||||
A9E53DE62100B197002781DD /* NSString+MoltenVK.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD42100B197002781DD /* NSString+MoltenVK.mm */; };
|
||||
A9E53DE72100B197002781DD /* MTLTextureDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD52100B197002781DD /* MTLTextureDescriptor+MoltenVK.m */; };
|
||||
A9E53DE82100B197002781DD /* MTLTextureDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD52100B197002781DD /* MTLTextureDescriptor+MoltenVK.m */; };
|
||||
A9E53DE92100B197002781DD /* CAMetalLayer+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD62100B197002781DD /* CAMetalLayer+MoltenVK.m */; };
|
||||
A9E53DEA2100B197002781DD /* CAMetalLayer+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DD62100B197002781DD /* CAMetalLayer+MoltenVK.m */; };
|
||||
A9E53DF32100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DEE2100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h */; };
|
||||
A9E53DF42100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DEE2100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h */; };
|
||||
A9E53DF52100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DF22100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m */; };
|
||||
A9E53DF62100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DF22100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m */; };
|
||||
A9E53DFF21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DFA21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m */; };
|
||||
A9E53E0021064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E53DFA21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m */; };
|
||||
A9E53E0121064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DFE21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h */; };
|
||||
A9E53E0221064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = A9E53DFE21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h */; };
|
||||
A9F042A41FB4CF83009FCCB8 /* MVKCommonEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F0429D1FB4CF82009FCCB8 /* MVKCommonEnvironment.h */; };
|
||||
A9F042A51FB4CF83009FCCB8 /* MVKCommonEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F0429D1FB4CF82009FCCB8 /* MVKCommonEnvironment.h */; };
|
||||
A9F042A61FB4CF83009FCCB8 /* MVKLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F0429E1FB4CF82009FCCB8 /* MVKLogging.h */; };
|
||||
@ -248,8 +256,6 @@
|
||||
A9096E5D1F81E16300DFBEA6 /* MVKCmdDispatch.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKCmdDispatch.mm; sourceTree = "<group>"; };
|
||||
A90C8DE81F45354D009CB32C /* MVKCommandEncodingPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKCommandEncodingPool.h; sourceTree = "<group>"; };
|
||||
A90C8DE91F45354D009CB32C /* MVKCommandEncodingPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKCommandEncodingPool.mm; sourceTree = "<group>"; };
|
||||
A92CAF342098166A009DA08E /* NSString+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A92CAF382098166B009DA08E /* NSString+MoltenVK.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSString+MoltenVK.mm"; sourceTree = "<group>"; };
|
||||
A948BB7E1E51642700DE59F2 /* mvk_vulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mvk_vulkan.h; sourceTree = "<group>"; };
|
||||
A94FB7671C7DFB4800632CA3 /* mvk_datatypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mvk_datatypes.h; sourceTree = "<group>"; };
|
||||
A94FB7691C7DFB4800632CA3 /* vk_mvk_moltenvk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vk_mvk_moltenvk.h; sourceTree = "<group>"; };
|
||||
@ -317,19 +323,11 @@
|
||||
A98149441FB6A3F7005F00B4 /* MVKFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKFoundation.h; sourceTree = "<group>"; };
|
||||
A98149451FB6A3F7005F00B4 /* MVKFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKFoundation.mm; sourceTree = "<group>"; };
|
||||
A98149461FB6A3F7005F00B4 /* MVKObjectPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKObjectPool.h; sourceTree = "<group>"; };
|
||||
A98149471FB6A3F7005F00B4 /* MVKOSExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKOSExtensions.h; sourceTree = "<group>"; };
|
||||
A98149481FB6A3F7005F00B4 /* MVKOSExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKOSExtensions.mm; sourceTree = "<group>"; };
|
||||
A98149491FB6A3F7005F00B4 /* MVKWatermark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKWatermark.h; sourceTree = "<group>"; };
|
||||
A981494A1FB6A3F7005F00B4 /* MVKWatermark.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKWatermark.mm; sourceTree = "<group>"; };
|
||||
A981494B1FB6A3F7005F00B4 /* MVKWatermarkShaderSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKWatermarkShaderSource.h; sourceTree = "<group>"; };
|
||||
A981494C1FB6A3F7005F00B4 /* MVKWatermarkTextureContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKWatermarkTextureContent.h; sourceTree = "<group>"; };
|
||||
A981496A1FB6A998005F00B4 /* MVKStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKStrings.h; sourceTree = "<group>"; };
|
||||
A9917FF1209CC588004069EB /* MTLSamplerDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLSamplerDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9917FF2209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLSamplerDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9917FF3209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLTextureDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9917FF4209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLTextureDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9917FF5209CC589004069EB /* CAMetalLayer+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CAMetalLayer+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9917FF6209CC589004069EB /* CAMetalLayer+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAMetalLayer+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9AD67C72054DD6C00ED3C08 /* vulkan */ = {isa = PBXFileReference; lastKnownFileType = folder; path = vulkan; sourceTree = "<group>"; };
|
||||
A9B8EE0A1A98D796009C5A02 /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MoltenVKShaderConverter.xcodeproj; path = ../MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj; sourceTree = "<group>"; };
|
||||
@ -338,6 +336,20 @@
|
||||
A9CBEE011B6299D800E45FDC /* MoltenVK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A9DE1083200598C500F18F80 /* icd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = icd; sourceTree = "<group>"; };
|
||||
A9E4B7881E1D8AF10046A4CE /* MVKMTLResourceBindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKMTLResourceBindings.h; sourceTree = "<group>"; };
|
||||
A9E53DCD2100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLSamplerDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9E53DCE2100B197002781DD /* MVKOSExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKOSExtensions.h; sourceTree = "<group>"; };
|
||||
A9E53DCF2100B197002781DD /* MVKOSExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKOSExtensions.mm; sourceTree = "<group>"; };
|
||||
A9E53DD02100B197002781DD /* MTLTextureDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLTextureDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9E53DD12100B197002781DD /* CAMetalLayer+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CAMetalLayer+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9E53DD22100B197002781DD /* NSString+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9E53DD32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLSamplerDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9E53DD42100B197002781DD /* NSString+MoltenVK.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSString+MoltenVK.mm"; sourceTree = "<group>"; };
|
||||
A9E53DD52100B197002781DD /* MTLTextureDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLTextureDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9E53DD62100B197002781DD /* CAMetalLayer+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAMetalLayer+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9E53DEE2100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLRenderPassDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9E53DF22100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLRenderPassDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9E53DFA21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLRenderPipelineDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
|
||||
A9E53DFE21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLRenderPipelineDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
|
||||
A9F0429D1FB4CF82009FCCB8 /* MVKCommonEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKCommonEnvironment.h; sourceTree = "<group>"; };
|
||||
A9F0429E1FB4CF82009FCCB8 /* MVKLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKLogging.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@ -369,6 +381,7 @@
|
||||
A94FB76B1C7DFB4800632CA3 /* Commands */,
|
||||
A94FB77E1C7DFB4800632CA3 /* GPUObjects */,
|
||||
A94FB79F1C7DFB4800632CA3 /* Loader */,
|
||||
A9E53DCC2100B197002781DD /* OS */,
|
||||
A98149401FB6A3F7005F00B4 /* Utility */,
|
||||
A94FB7A81C7DFB4800632CA3 /* Vulkan */,
|
||||
);
|
||||
@ -481,26 +494,16 @@
|
||||
A98149401FB6A3F7005F00B4 /* Utility */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9917FF5209CC589004069EB /* CAMetalLayer+MoltenVK.h */,
|
||||
A9917FF6209CC589004069EB /* CAMetalLayer+MoltenVK.m */,
|
||||
A9917FF2209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h */,
|
||||
A9917FF1209CC588004069EB /* MTLSamplerDescriptor+MoltenVK.m */,
|
||||
A9917FF3209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h */,
|
||||
A9917FF4209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m */,
|
||||
A98149411FB6A3F7005F00B4 /* MVKBaseObject.cpp */,
|
||||
A98149421FB6A3F7005F00B4 /* MVKBaseObject.h */,
|
||||
A98149431FB6A3F7005F00B4 /* MVKEnvironment.h */,
|
||||
A98149441FB6A3F7005F00B4 /* MVKFoundation.h */,
|
||||
A98149451FB6A3F7005F00B4 /* MVKFoundation.mm */,
|
||||
A98149461FB6A3F7005F00B4 /* MVKObjectPool.h */,
|
||||
A98149471FB6A3F7005F00B4 /* MVKOSExtensions.h */,
|
||||
A98149481FB6A3F7005F00B4 /* MVKOSExtensions.mm */,
|
||||
A98149491FB6A3F7005F00B4 /* MVKWatermark.h */,
|
||||
A981494A1FB6A3F7005F00B4 /* MVKWatermark.mm */,
|
||||
A981494B1FB6A3F7005F00B4 /* MVKWatermarkShaderSource.h */,
|
||||
A981494C1FB6A3F7005F00B4 /* MVKWatermarkTextureContent.h */,
|
||||
A92CAF342098166A009DA08E /* NSString+MoltenVK.h */,
|
||||
A92CAF382098166B009DA08E /* NSString+MoltenVK.mm */,
|
||||
);
|
||||
path = Utility;
|
||||
sourceTree = "<group>";
|
||||
@ -525,6 +528,27 @@
|
||||
path = include;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9E53DCC2100B197002781DD /* OS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9E53DD12100B197002781DD /* CAMetalLayer+MoltenVK.h */,
|
||||
A9E53DD62100B197002781DD /* CAMetalLayer+MoltenVK.m */,
|
||||
A9E53DEE2100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h */,
|
||||
A9E53DF22100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m */,
|
||||
A9E53DFE21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h */,
|
||||
A9E53DFA21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m */,
|
||||
A9E53DD32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h */,
|
||||
A9E53DCD2100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m */,
|
||||
A9E53DD02100B197002781DD /* MTLTextureDescriptor+MoltenVK.h */,
|
||||
A9E53DD52100B197002781DD /* MTLTextureDescriptor+MoltenVK.m */,
|
||||
A9E53DCE2100B197002781DD /* MVKOSExtensions.h */,
|
||||
A9E53DCF2100B197002781DD /* MVKOSExtensions.mm */,
|
||||
A9E53DD22100B197002781DD /* NSString+MoltenVK.h */,
|
||||
A9E53DD42100B197002781DD /* NSString+MoltenVK.mm */,
|
||||
);
|
||||
path = OS;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9F0429B1FB4CF82009FCCB8 /* Common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -569,17 +593,22 @@
|
||||
A98149511FB6A3F7005F00B4 /* MVKEnvironment.h in Headers */,
|
||||
A948BB7F1E51642700DE59F2 /* mvk_vulkan.h in Headers */,
|
||||
A94FB8101C7DFB4800632CA3 /* MVKSurface.h in Headers */,
|
||||
A9E53E0121064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7F41C7DFB4800632CA3 /* MVKInstance.h in Headers */,
|
||||
A95870F81C90D29F009EB096 /* MVKCommandResourceFactory.h in Headers */,
|
||||
A9E53DD92100B197002781DD /* MVKOSExtensions.h in Headers */,
|
||||
A94FB7FC1C7DFB4800632CA3 /* MVKQueryPool.h in Headers */,
|
||||
A95B7D691D3EE486003183D3 /* MVKCommandEncoderState.h in Headers */,
|
||||
A94FB7D81C7DFB4800632CA3 /* MVKCommandPipelineStateFactoryShaderSource.h in Headers */,
|
||||
A94FB7E01C7DFB4800632CA3 /* MVKDescriptorSet.h in Headers */,
|
||||
A9E53DE12100B197002781DD /* NSString+MoltenVK.h in Headers */,
|
||||
A9E53DDF2100B197002781DD /* CAMetalLayer+MoltenVK.h in Headers */,
|
||||
A94FB8041C7DFB4800632CA3 /* MVKRenderPass.h in Headers */,
|
||||
A9F042A61FB4CF83009FCCB8 /* MVKLogging.h in Headers */,
|
||||
A94FB8001C7DFB4800632CA3 /* MVKQueue.h in Headers */,
|
||||
A94FB7EC1C7DFB4800632CA3 /* MVKFramebuffer.h in Headers */,
|
||||
A98149611FB6A3F7005F00B4 /* MVKWatermarkShaderSource.h in Headers */,
|
||||
A9E53DE32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB8181C7DFB4800632CA3 /* MVKSync.h in Headers */,
|
||||
A94FB7E41C7DFB4800632CA3 /* MVKDevice.h in Headers */,
|
||||
A94FB7D41C7DFB4800632CA3 /* MVKCommandPool.h in Headers */,
|
||||
@ -593,24 +622,21 @@
|
||||
A94FB7DC1C7DFB4800632CA3 /* MVKBuffer.h in Headers */,
|
||||
A9F042A41FB4CF83009FCCB8 /* MVKCommonEnvironment.h in Headers */,
|
||||
A981495D1FB6A3F7005F00B4 /* MVKWatermark.h in Headers */,
|
||||
A9917FFB209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7C41C7DFB4800632CA3 /* MVKCmdRenderPass.h in Headers */,
|
||||
A94FB7BC1C7DFB4800632CA3 /* MVKCmdPipeline.h in Headers */,
|
||||
A94FB7F81C7DFB4800632CA3 /* MVKPipeline.h in Headers */,
|
||||
A92CAF392098166B009DA08E /* NSString+MoltenVK.h in Headers */,
|
||||
A94FB7F01C7DFB4800632CA3 /* MVKImage.h in Headers */,
|
||||
A94FB7B81C7DFB4800632CA3 /* MVKCmdTransfer.h in Headers */,
|
||||
A94FB7C81C7DFB4800632CA3 /* MVKCmdDraw.h in Headers */,
|
||||
A94FB7D01C7DFB4800632CA3 /* MVKCommandBuffer.h in Headers */,
|
||||
A9E53DF32100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h in Headers */,
|
||||
A98149631FB6A3F7005F00B4 /* MVKWatermarkTextureContent.h in Headers */,
|
||||
A98149531FB6A3F7005F00B4 /* MVKFoundation.h in Headers */,
|
||||
A9917FF9209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7E81C7DFB4800632CA3 /* MVKDeviceMemory.h in Headers */,
|
||||
A98149591FB6A3F7005F00B4 /* MVKOSExtensions.h in Headers */,
|
||||
A9E4B7891E1D8AF10046A4CE /* MVKMTLResourceBindings.h in Headers */,
|
||||
A90C8DEA1F45354D009CB32C /* MVKCommandEncodingPool.h in Headers */,
|
||||
A94FB8081C7DFB4800632CA3 /* MVKResource.h in Headers */,
|
||||
A9917FFF209CC589004069EB /* CAMetalLayer+MoltenVK.h in Headers */,
|
||||
A9E53DDD2100B197002781DD /* MTLTextureDescriptor+MoltenVK.h in Headers */,
|
||||
A981496B1FB6A998005F00B4 /* MVKStrings.h in Headers */,
|
||||
A94FB81C1C7DFB4800632CA3 /* MVKLayers.h in Headers */,
|
||||
);
|
||||
@ -625,17 +651,22 @@
|
||||
A98149521FB6A3F7005F00B4 /* MVKEnvironment.h in Headers */,
|
||||
A948BB801E51642700DE59F2 /* mvk_vulkan.h in Headers */,
|
||||
A94FB8111C7DFB4800632CA3 /* MVKSurface.h in Headers */,
|
||||
A9E53E0221064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7F51C7DFB4800632CA3 /* MVKInstance.h in Headers */,
|
||||
A95870F91C90D29F009EB096 /* MVKCommandResourceFactory.h in Headers */,
|
||||
A9E53DDA2100B197002781DD /* MVKOSExtensions.h in Headers */,
|
||||
A94FB7FD1C7DFB4800632CA3 /* MVKQueryPool.h in Headers */,
|
||||
A95B7D6A1D3EE486003183D3 /* MVKCommandEncoderState.h in Headers */,
|
||||
A94FB7D91C7DFB4800632CA3 /* MVKCommandPipelineStateFactoryShaderSource.h in Headers */,
|
||||
A94FB7E11C7DFB4800632CA3 /* MVKDescriptorSet.h in Headers */,
|
||||
A9E53DE22100B197002781DD /* NSString+MoltenVK.h in Headers */,
|
||||
A9E53DE02100B197002781DD /* CAMetalLayer+MoltenVK.h in Headers */,
|
||||
A94FB8051C7DFB4800632CA3 /* MVKRenderPass.h in Headers */,
|
||||
A9F042A71FB4CF83009FCCB8 /* MVKLogging.h in Headers */,
|
||||
A94FB8011C7DFB4800632CA3 /* MVKQueue.h in Headers */,
|
||||
A94FB7ED1C7DFB4800632CA3 /* MVKFramebuffer.h in Headers */,
|
||||
A98149621FB6A3F7005F00B4 /* MVKWatermarkShaderSource.h in Headers */,
|
||||
A9E53DE42100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB8191C7DFB4800632CA3 /* MVKSync.h in Headers */,
|
||||
A94FB7E51C7DFB4800632CA3 /* MVKDevice.h in Headers */,
|
||||
A94FB7D51C7DFB4800632CA3 /* MVKCommandPool.h in Headers */,
|
||||
@ -649,24 +680,21 @@
|
||||
A94FB7DD1C7DFB4800632CA3 /* MVKBuffer.h in Headers */,
|
||||
A9F042A51FB4CF83009FCCB8 /* MVKCommonEnvironment.h in Headers */,
|
||||
A981495E1FB6A3F7005F00B4 /* MVKWatermark.h in Headers */,
|
||||
A9917FFC209CC589004069EB /* MTLTextureDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7C51C7DFB4800632CA3 /* MVKCmdRenderPass.h in Headers */,
|
||||
A94FB7BD1C7DFB4800632CA3 /* MVKCmdPipeline.h in Headers */,
|
||||
A94FB7F91C7DFB4800632CA3 /* MVKPipeline.h in Headers */,
|
||||
A92CAF3A2098166B009DA08E /* NSString+MoltenVK.h in Headers */,
|
||||
A94FB7F11C7DFB4800632CA3 /* MVKImage.h in Headers */,
|
||||
A94FB7B91C7DFB4800632CA3 /* MVKCmdTransfer.h in Headers */,
|
||||
A94FB7C91C7DFB4800632CA3 /* MVKCmdDraw.h in Headers */,
|
||||
A94FB7D11C7DFB4800632CA3 /* MVKCommandBuffer.h in Headers */,
|
||||
A9E53DF42100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.h in Headers */,
|
||||
A98149641FB6A3F7005F00B4 /* MVKWatermarkTextureContent.h in Headers */,
|
||||
A98149541FB6A3F7005F00B4 /* MVKFoundation.h in Headers */,
|
||||
A9917FFA209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.h in Headers */,
|
||||
A94FB7E91C7DFB4800632CA3 /* MVKDeviceMemory.h in Headers */,
|
||||
A981495A1FB6A3F7005F00B4 /* MVKOSExtensions.h in Headers */,
|
||||
A9E4B78A1E1D8AF10046A4CE /* MVKMTLResourceBindings.h in Headers */,
|
||||
A90C8DEB1F45354D009CB32C /* MVKCommandEncodingPool.h in Headers */,
|
||||
A94FB8091C7DFB4800632CA3 /* MVKResource.h in Headers */,
|
||||
A9918000209CC589004069EB /* CAMetalLayer+MoltenVK.h in Headers */,
|
||||
A9E53DDE2100B197002781DD /* MTLTextureDescriptor+MoltenVK.h in Headers */,
|
||||
A981496C1FB6A998005F00B4 /* MVKStrings.h in Headers */,
|
||||
A94FB81D1C7DFB4800632CA3 /* MVKLayers.h in Headers */,
|
||||
);
|
||||
@ -829,22 +857,23 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A9E53DFF21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB80A1C7DFB4800632CA3 /* MVKResource.mm in Sources */,
|
||||
A94FB7E21C7DFB4800632CA3 /* MVKDescriptorSet.mm in Sources */,
|
||||
A9917FFD209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m in Sources */,
|
||||
A9E53DE72100B197002781DD /* MTLTextureDescriptor+MoltenVK.m in Sources */,
|
||||
A95870FA1C90D29F009EB096 /* MVKCommandResourceFactory.mm in Sources */,
|
||||
A90C8DEC1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */,
|
||||
A981495F1FB6A3F7005F00B4 /* MVKWatermark.mm in Sources */,
|
||||
A981494D1FB6A3F7005F00B4 /* MVKBaseObject.cpp in Sources */,
|
||||
A9E53DE52100B197002781DD /* NSString+MoltenVK.mm in Sources */,
|
||||
A9E53DDB2100B197002781DD /* MVKOSExtensions.mm in Sources */,
|
||||
A94FB8321C7DFB4800632CA3 /* vulkan.mm in Sources */,
|
||||
A94FB8121C7DFB4800632CA3 /* MVKSurface.mm in Sources */,
|
||||
A94FB7FE1C7DFB4800632CA3 /* MVKQueryPool.mm in Sources */,
|
||||
A92CAF3B2098166B009DA08E /* NSString+MoltenVK.mm in Sources */,
|
||||
A94FB7F61C7DFB4800632CA3 /* MVKInstance.mm in Sources */,
|
||||
A94FB7EA1C7DFB4800632CA3 /* MVKDeviceMemory.mm in Sources */,
|
||||
A94FB7F21C7DFB4800632CA3 /* MVKImage.mm in Sources */,
|
||||
A94FB7D61C7DFB4800632CA3 /* MVKCommandPool.mm in Sources */,
|
||||
A9917FF7209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB7CA1C7DFB4800632CA3 /* MVKCmdDraw.mm in Sources */,
|
||||
A94FB7D21C7DFB4800632CA3 /* MVKCommandBuffer.mm in Sources */,
|
||||
A94FB7C61C7DFB4800632CA3 /* MVKCmdRenderPass.mm in Sources */,
|
||||
@ -852,8 +881,10 @@
|
||||
A94FB82A1C7DFB4800632CA3 /* mvk_datatypes.mm in Sources */,
|
||||
A98149551FB6A3F7005F00B4 /* MVKFoundation.mm in Sources */,
|
||||
A94FB7E61C7DFB4800632CA3 /* MVKDevice.mm in Sources */,
|
||||
A9E53DF52100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB7FA1C7DFB4800632CA3 /* MVKPipeline.mm in Sources */,
|
||||
A94FB8021C7DFB4800632CA3 /* MVKQueue.mm in Sources */,
|
||||
A9E53DD72100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB8061C7DFB4800632CA3 /* MVKRenderPass.mm in Sources */,
|
||||
A94FB7BA1C7DFB4800632CA3 /* MVKCmdTransfer.mm in Sources */,
|
||||
A94FB7C21C7DFB4800632CA3 /* MVKCmdQueries.mm in Sources */,
|
||||
@ -867,8 +898,7 @@
|
||||
A94FB81E1C7DFB4800632CA3 /* MVKLayers.mm in Sources */,
|
||||
A94FB7EE1C7DFB4800632CA3 /* MVKFramebuffer.mm in Sources */,
|
||||
A9C96DD21DDC20C20053187F /* MVKMTLBufferAllocation.mm in Sources */,
|
||||
A981495B1FB6A3F7005F00B4 /* MVKOSExtensions.mm in Sources */,
|
||||
A9918001209CC589004069EB /* CAMetalLayer+MoltenVK.m in Sources */,
|
||||
A9E53DE92100B197002781DD /* CAMetalLayer+MoltenVK.m in Sources */,
|
||||
A9096E5E1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -877,22 +907,23 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A9E53E0021064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB80B1C7DFB4800632CA3 /* MVKResource.mm in Sources */,
|
||||
A94FB7E31C7DFB4800632CA3 /* MVKDescriptorSet.mm in Sources */,
|
||||
A9917FFE209CC589004069EB /* MTLTextureDescriptor+MoltenVK.m in Sources */,
|
||||
A9E53DE82100B197002781DD /* MTLTextureDescriptor+MoltenVK.m in Sources */,
|
||||
A95870FB1C90D29F009EB096 /* MVKCommandResourceFactory.mm in Sources */,
|
||||
A90C8DED1F45354D009CB32C /* MVKCommandEncodingPool.mm in Sources */,
|
||||
A98149601FB6A3F7005F00B4 /* MVKWatermark.mm in Sources */,
|
||||
A981494E1FB6A3F7005F00B4 /* MVKBaseObject.cpp in Sources */,
|
||||
A9E53DE62100B197002781DD /* NSString+MoltenVK.mm in Sources */,
|
||||
A9E53DDC2100B197002781DD /* MVKOSExtensions.mm in Sources */,
|
||||
A94FB8331C7DFB4800632CA3 /* vulkan.mm in Sources */,
|
||||
A94FB8131C7DFB4800632CA3 /* MVKSurface.mm in Sources */,
|
||||
A94FB7FF1C7DFB4800632CA3 /* MVKQueryPool.mm in Sources */,
|
||||
A92CAF3C2098166B009DA08E /* NSString+MoltenVK.mm in Sources */,
|
||||
A94FB7F71C7DFB4800632CA3 /* MVKInstance.mm in Sources */,
|
||||
A94FB7EB1C7DFB4800632CA3 /* MVKDeviceMemory.mm in Sources */,
|
||||
A94FB7F31C7DFB4800632CA3 /* MVKImage.mm in Sources */,
|
||||
A94FB7D71C7DFB4800632CA3 /* MVKCommandPool.mm in Sources */,
|
||||
A9917FF8209CC589004069EB /* MTLSamplerDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB7CB1C7DFB4800632CA3 /* MVKCmdDraw.mm in Sources */,
|
||||
A94FB7D31C7DFB4800632CA3 /* MVKCommandBuffer.mm in Sources */,
|
||||
A94FB7C71C7DFB4800632CA3 /* MVKCmdRenderPass.mm in Sources */,
|
||||
@ -900,8 +931,10 @@
|
||||
A94FB82B1C7DFB4800632CA3 /* mvk_datatypes.mm in Sources */,
|
||||
A98149561FB6A3F7005F00B4 /* MVKFoundation.mm in Sources */,
|
||||
A94FB7E71C7DFB4800632CA3 /* MVKDevice.mm in Sources */,
|
||||
A9E53DF62100B302002781DD /* MTLRenderPassDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB7FB1C7DFB4800632CA3 /* MVKPipeline.mm in Sources */,
|
||||
A94FB8031C7DFB4800632CA3 /* MVKQueue.mm in Sources */,
|
||||
A9E53DD82100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m in Sources */,
|
||||
A94FB8071C7DFB4800632CA3 /* MVKRenderPass.mm in Sources */,
|
||||
A94FB7BB1C7DFB4800632CA3 /* MVKCmdTransfer.mm in Sources */,
|
||||
A94FB7C31C7DFB4800632CA3 /* MVKCmdQueries.mm in Sources */,
|
||||
@ -915,8 +948,7 @@
|
||||
A94FB81F1C7DFB4800632CA3 /* MVKLayers.mm in Sources */,
|
||||
A94FB7EF1C7DFB4800632CA3 /* MVKFramebuffer.mm in Sources */,
|
||||
A9C96DD31DDC20C20053187F /* MVKMTLBufferAllocation.mm in Sources */,
|
||||
A981495C1FB6A3F7005F00B4 /* MVKOSExtensions.mm in Sources */,
|
||||
A9918002209CC589004069EB /* CAMetalLayer+MoltenVK.m in Sources */,
|
||||
A9E53DEA2100B197002781DD /* CAMetalLayer+MoltenVK.m in Sources */,
|
||||
A9096E5F1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -265,13 +265,25 @@ uint32_t mvkMipmapLevels3D(VkExtent3D extent);
|
||||
* Returns the size of the specified zero-based mipmap level,
|
||||
* when the size of the base level is the specified size.
|
||||
*/
|
||||
VkExtent2D mvkMipmapLevelSizeFromBaseSize(VkExtent2D baseSize, uint32_t level);
|
||||
VkExtent2D mvkMipmapLevelSizeFromBaseSize2D(VkExtent2D baseSize, uint32_t level);
|
||||
|
||||
/**
|
||||
* Returns the size of the specified zero-based mipmap level,
|
||||
* when the size of the base level is the specified size.
|
||||
*/
|
||||
VkExtent3D mvkMipmapLevelSizeFromBaseSize3D(VkExtent3D baseSize, uint32_t level);
|
||||
|
||||
/**
|
||||
* Returns the size of the mipmap base level, when the size of
|
||||
* the specified zero-based mipmap level is the specified size.
|
||||
*/
|
||||
VkExtent2D mvkMipmapBaseSizeFromLevelSize(VkExtent2D levelSize, uint32_t level);
|
||||
VkExtent2D mvkMipmapBaseSizeFromLevelSize2D(VkExtent2D levelSize, uint32_t level);
|
||||
|
||||
/**
|
||||
* Returns the size of the mipmap base level, when the size of
|
||||
* the specified zero-based mipmap level is the specified size.
|
||||
*/
|
||||
VkExtent3D mvkMipmapBaseSizeFromLevelSize3D(VkExtent3D levelSize, uint32_t level);
|
||||
|
||||
|
||||
#pragma mark Samplers
|
||||
@ -319,10 +331,12 @@ MTLVertexStepFunction mvkMTLVertexStepFunctionFromVkVertexInputRate(VkVertexInpu
|
||||
/** Returns the Metal MTLPrimitiveType corresponding to the specified Vulkan VkPrimitiveTopology. */
|
||||
MTLPrimitiveType mvkMTLPrimitiveTypeFromVkPrimitiveTopology(VkPrimitiveTopology vkTopology);
|
||||
|
||||
#if MVK_MACOS
|
||||
/** Returns the Metal MTLPrimitiveTopologyClass corresponding to the specified Vulkan VkPrimitiveTopology. */
|
||||
MTLPrimitiveTopologyClass mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(VkPrimitiveTopology vkTopology);
|
||||
#endif
|
||||
/**
|
||||
* Returns the Metal MTLPrimitiveTopologyClass corresponding to the specified Vulkan VkPrimitiveTopology.
|
||||
*
|
||||
* The value is treated as an NSUInteger to support OS versions on which the enum is unavailable.
|
||||
*/
|
||||
NSUInteger mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(VkPrimitiveTopology vkTopology);
|
||||
|
||||
/** Returns the Metal MTLLoadAction corresponding to the specified Vulkan VkAttachmentLoadOp. */
|
||||
MTLLoadAction mvkMTLLoadActionFromVkAttachmentLoadOp(VkAttachmentLoadOp vkLoadOp);
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
||||
*/
|
||||
#define MVK_VERSION_MAJOR 1
|
||||
#define MVK_VERSION_MINOR 0
|
||||
#define MVK_VERSION_PATCH 15
|
||||
#define MVK_VERSION_PATCH 16
|
||||
|
||||
#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
|
||||
#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH)
|
||||
|
@ -242,7 +242,7 @@ protected:
|
||||
void populateVertices(VkClearRect& clearRect, float attWidth, float attHeight);
|
||||
|
||||
std::vector<VkClearRect> _clearRects;
|
||||
std::vector<simd::float2> _vertices;
|
||||
std::vector<simd::float4> _vertices;
|
||||
simd::float4 _clearColors[kMVKAttachmentFormatCount];
|
||||
VkClearValue _vkClearValues[kMVKAttachmentFormatCount];
|
||||
MVKRPSKeyClearAtt _rpsKey;
|
||||
@ -279,9 +279,9 @@ protected:
|
||||
MVKImage* _image;
|
||||
VkImageLayout _imgLayout;
|
||||
std::vector<VkImageSubresourceRange> _subresourceRanges;
|
||||
simd::float4 _clearColors[kMVKAttachmentFormatCount];
|
||||
MVKRPSKeyClearAtt _rpsKey;
|
||||
uint32_t _mtlStencilValue;
|
||||
MTLClearColor _mtlColorClearValue;
|
||||
double _mtlDepthClearValue;
|
||||
uint32_t _mtlStencilClearValue;
|
||||
bool _isDepthStencilClear;
|
||||
};
|
||||
|
||||
@ -396,7 +396,7 @@ void mvkCmdClearAttachments(MVKCommandBuffer* cmdBuff,
|
||||
const VkClearRect* pRects);
|
||||
|
||||
/** Adds a clear color image command to the specified command buffer. */
|
||||
void mvkCmdClearImage(MVKCommandBuffer* cmdBuff,
|
||||
void mvkCmdClearColorImage(MVKCommandBuffer* cmdBuff,
|
||||
VkImage image,
|
||||
VkImageLayout imageLayout,
|
||||
const VkClearColorValue* pColor,
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "MVKBuffer.h"
|
||||
#include "MVKFramebuffer.h"
|
||||
#include "MVKRenderPass.h"
|
||||
#include "MTLRenderPassDescriptor+MoltenVK.h"
|
||||
#include "mvk_datatypes.h"
|
||||
|
||||
|
||||
@ -774,7 +775,14 @@ void MVKCmdClearAttachments::populateVertices(VkClearRect& clearRect, float attW
|
||||
bottomPos = (bottomPos * 2.0) - 1.0;
|
||||
topPos = (topPos * 2.0) - 1.0;
|
||||
|
||||
simd::float2 vtx;
|
||||
simd::float4 vtx;
|
||||
|
||||
uint32_t startLayer = clearRect.baseArrayLayer;
|
||||
uint32_t endLayer = startLayer + clearRect.layerCount;
|
||||
for (uint32_t layer = startLayer; layer < endLayer; layer++) {
|
||||
|
||||
vtx.z = 0.0;
|
||||
vtx.w = layer;
|
||||
|
||||
// Top left vertex - First triangle
|
||||
vtx.y = topPos;
|
||||
@ -803,6 +811,7 @@ void MVKCmdClearAttachments::populateVertices(VkClearRect& clearRect, float attW
|
||||
vtx.y = topPos;
|
||||
vtx.x = leftPos;
|
||||
_vertices.push_back(vtx);
|
||||
}
|
||||
}
|
||||
|
||||
void MVKCmdClearAttachments::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
@ -840,7 +849,7 @@ void MVKCmdClearAttachments::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
|
||||
cmdEncoder->setVertexBytes(mtlRendEnc, _clearColors, sizeof(_clearColors), 0);
|
||||
cmdEncoder->setFragmentBytes(mtlRendEnc, _clearColors, sizeof(_clearColors), 0);
|
||||
cmdEncoder->setVertexBytes(mtlRendEnc, _vertices.data(), vtxCnt * sizeof(simd::float2), vtxBuffIdx);
|
||||
cmdEncoder->setVertexBytes(mtlRendEnc, _vertices.data(), vtxCnt * sizeof(_vertices[0]), vtxBuffIdx);
|
||||
[mtlRendEnc drawPrimitives: MTLPrimitiveTypeTriangle vertexStart: 0 vertexCount: vtxCnt];
|
||||
[mtlRendEnc popDebugGroup];
|
||||
}
|
||||
@ -858,23 +867,10 @@ void MVKCmdClearImage::setContent(VkImage image,
|
||||
_image = (MVKImage*)image;
|
||||
_imgLayout = imageLayout;
|
||||
_isDepthStencilClear = isDepthStencilClear;
|
||||
_mtlStencilValue = 0;
|
||||
|
||||
_rpsKey = kMVKRPSKeyClearAttDefault;
|
||||
_rpsKey.mtlSampleCount = _image->getSampleCount();
|
||||
|
||||
if (_isDepthStencilClear) {
|
||||
_rpsKey.enable(kMVKAttachmentFormatDepthStencilIndex);
|
||||
_rpsKey.attachmentMTLPixelFormats[kMVKAttachmentFormatDepthStencilIndex] = _image->getMTLPixelFormat();
|
||||
float mtlDepthVal = mvkMTLClearDepthFromVkClearValue(clearValue);
|
||||
_clearColors[kMVKAttachmentFormatDepthStencilIndex] = { mtlDepthVal, mtlDepthVal, mtlDepthVal, mtlDepthVal };
|
||||
_mtlStencilValue = mvkMTLClearStencilFromVkClearValue(clearValue);
|
||||
} else {
|
||||
_rpsKey.enable(0);
|
||||
_rpsKey.attachmentMTLPixelFormats[0] = _image->getMTLPixelFormat();
|
||||
MTLClearColor mtlCC = mvkMTLClearColorFromVkClearValue(clearValue, _image->getVkFormat());
|
||||
_clearColors[0] = { (float)mtlCC.red, (float)mtlCC.green, (float)mtlCC.blue, (float)mtlCC.alpha};
|
||||
}
|
||||
_mtlColorClearValue = mvkMTLClearColorFromVkClearValue(clearValue, _image->getVkFormat());
|
||||
_mtlDepthClearValue = mvkMTLClearDepthFromVkClearValue(clearValue);
|
||||
_mtlStencilClearValue = mvkMTLClearStencilFromVkClearValue(clearValue);
|
||||
|
||||
// Add subresource ranges
|
||||
_subresourceRanges.clear();
|
||||
@ -883,64 +879,51 @@ void MVKCmdClearImage::setContent(VkImage image,
|
||||
_subresourceRanges.push_back(pRanges[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void MVKCmdClearImage::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
|
||||
MTLPixelFormat imgMTLPixFmt = _image->getMTLPixelFormat();
|
||||
id<MTLTexture> imgMTLTex = _image->getMTLTexture();
|
||||
if ( !imgMTLTex ) { return; }
|
||||
|
||||
VkExtent3D imgBaseExtent = _image->getExtent3D();
|
||||
NSString* mtlRendEncName = (_isDepthStencilClear
|
||||
? mvkMTLRenderCommandEncoderLabel(kMVKCommandUseClearDepthStencilImage)
|
||||
: mvkMTLRenderCommandEncoderLabel(kMVKCommandUseClearColorImage));
|
||||
|
||||
cmdEncoder->endCurrentMetalEncoding();
|
||||
|
||||
static const simd::float2 vertices[] = {
|
||||
{ -1.0, -1.0 }, // Bottom-left
|
||||
{ 1.0, -1.0 }, // Bottom-right
|
||||
{ -1.0, 1.0 }, // Top-left
|
||||
{ 1.0, 1.0 }, // Top-right
|
||||
};
|
||||
|
||||
uint32_t vtxBuffIdx = getDevice()->getMetalBufferIndexForVertexAttributeBinding(kMVKVertexContentBufferIndex);
|
||||
for (auto& srRange : _subresourceRanges) {
|
||||
|
||||
MTLRenderPassDescriptor* mtlRPDesc = [MTLRenderPassDescriptor renderPassDescriptor];
|
||||
MTLRenderPassAttachmentDescriptor* mtlRPCADesc = nil;
|
||||
MTLRenderPassAttachmentDescriptor* mtlRPDADesc = nil;
|
||||
MTLRenderPassAttachmentDescriptor* mtlRPSADesc = nil;
|
||||
NSString* mtlRendEncName;
|
||||
NSString* mtlDebugGroupName;
|
||||
if (_isDepthStencilClear) {
|
||||
if (mvkMTLPixelFormatIsDepthFormat(imgMTLPixFmt)) {
|
||||
mtlRPDADesc = mtlRPDesc.depthAttachment;
|
||||
mtlRPDADesc.texture = imgMTLTex;
|
||||
mtlRPDADesc.loadAction = MTLLoadActionLoad;
|
||||
mtlRPDADesc.storeAction = MTLStoreActionStore;
|
||||
}
|
||||
if (mvkMTLPixelFormatIsStencilFormat(imgMTLPixFmt)) {
|
||||
mtlRPSADesc = mtlRPDesc.stencilAttachment;
|
||||
mtlRPSADesc.texture = imgMTLTex;
|
||||
mtlRPSADesc.loadAction = MTLLoadActionLoad;
|
||||
mtlRPSADesc.storeAction = MTLStoreActionStore;
|
||||
}
|
||||
mtlDebugGroupName = @"vkCmdClearDepthStencilImage";
|
||||
mtlRendEncName = mvkMTLRenderCommandEncoderLabel(kMVKCommandUseClearDepthStencilImage);
|
||||
} else {
|
||||
mtlRPCADesc = mtlRPDesc.colorAttachments[0];
|
||||
mtlRPCADesc.texture = imgMTLTex;
|
||||
mtlRPCADesc.loadAction = MTLLoadActionLoad;
|
||||
mtlRPCADesc.storeAction = MTLStoreActionStore;
|
||||
mtlDebugGroupName = @"vkCmdClearColorImage";
|
||||
mtlRendEncName = mvkMTLRenderCommandEncoderLabel(kMVKCommandUseClearColorImage);
|
||||
}
|
||||
|
||||
MVKCommandEncodingPool* cmdEncPool = cmdEncoder->getCommandEncodingPool();
|
||||
id<MTLRenderPipelineState> mtlRPS = cmdEncPool->getCmdClearMTLRenderPipelineState(_rpsKey);
|
||||
|
||||
size_t srCnt = _subresourceRanges.size();
|
||||
for (uint32_t srIdx = 0; srIdx < srCnt; srIdx++) {
|
||||
auto& srRange = _subresourceRanges[srIdx];
|
||||
MTLRenderPassColorAttachmentDescriptor* mtlRPCADesc = nil;
|
||||
MTLRenderPassDepthAttachmentDescriptor* mtlRPDADesc = nil;
|
||||
MTLRenderPassStencilAttachmentDescriptor* mtlRPSADesc = nil;
|
||||
|
||||
bool isClearingColor = !_isDepthStencilClear && mvkIsAnyFlagEnabled(srRange.aspectMask, VK_IMAGE_ASPECT_COLOR_BIT);
|
||||
bool isClearingDepth = _isDepthStencilClear && mvkIsAnyFlagEnabled(srRange.aspectMask, VK_IMAGE_ASPECT_DEPTH_BIT);
|
||||
bool isClearingStencil = _isDepthStencilClear && mvkIsAnyFlagEnabled(srRange.aspectMask, VK_IMAGE_ASPECT_STENCIL_BIT);
|
||||
id<MTLDepthStencilState> mtlDSS = cmdEncPool->getMTLDepthStencilState(isClearingDepth, isClearingStencil);
|
||||
|
||||
if (isClearingColor) {
|
||||
mtlRPCADesc = mtlRPDesc.colorAttachments[0];
|
||||
mtlRPCADesc.texture = imgMTLTex;
|
||||
mtlRPCADesc.loadAction = MTLLoadActionClear;
|
||||
mtlRPCADesc.storeAction = MTLStoreActionStore;
|
||||
mtlRPCADesc.clearColor = _mtlColorClearValue;
|
||||
}
|
||||
|
||||
if (isClearingDepth) {
|
||||
mtlRPDADesc = mtlRPDesc.depthAttachment;
|
||||
mtlRPDADesc.texture = imgMTLTex;
|
||||
mtlRPDADesc.loadAction = MTLLoadActionClear;
|
||||
mtlRPDADesc.storeAction = MTLStoreActionStore;
|
||||
mtlRPDADesc.clearDepth = _mtlDepthClearValue;
|
||||
}
|
||||
|
||||
if (isClearingStencil) {
|
||||
mtlRPSADesc = mtlRPDesc.stencilAttachment;
|
||||
mtlRPSADesc.texture = imgMTLTex;
|
||||
mtlRPSADesc.loadAction = MTLLoadActionClear;
|
||||
mtlRPSADesc.storeAction = MTLStoreActionStore;
|
||||
mtlRPSADesc.clearStencil = _mtlStencilClearValue;
|
||||
}
|
||||
|
||||
// Extract the mipmap levels that are to be updated
|
||||
uint32_t mipLvlStart = srRange.baseMipLevel;
|
||||
@ -961,6 +944,7 @@ void MVKCmdClearImage::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
mtlRPCADesc.level = mipLvl;
|
||||
mtlRPDADesc.level = mipLvl;
|
||||
mtlRPSADesc.level = mipLvl;
|
||||
mtlRPDesc.renderTargetArrayLengthMVK = mvkMipmapLevelSizeFromBaseSize3D(imgBaseExtent, mipLvl).depth;
|
||||
|
||||
for (uint32_t layer = layerStart; layer < layerEnd; layer++) {
|
||||
mtlRPCADesc.slice = layer;
|
||||
@ -969,17 +953,6 @@ void MVKCmdClearImage::encode(MVKCommandEncoder* cmdEncoder) {
|
||||
|
||||
id<MTLRenderCommandEncoder> mtlRendEnc = [cmdEncoder->_mtlCmdBuffer renderCommandEncoderWithDescriptor: mtlRPDesc];
|
||||
mtlRendEnc.label = mtlRendEncName;
|
||||
|
||||
[mtlRendEnc pushDebugGroup: mtlDebugGroupName];
|
||||
[mtlRendEnc setRenderPipelineState: mtlRPS];
|
||||
[mtlRendEnc setDepthStencilState: mtlDSS];
|
||||
[mtlRendEnc setStencilReferenceValue: _mtlStencilValue];
|
||||
|
||||
cmdEncoder->setVertexBytes(mtlRendEnc, _clearColors, sizeof(_clearColors), 0);
|
||||
cmdEncoder->setFragmentBytes(mtlRendEnc, _clearColors, sizeof(_clearColors), 0);
|
||||
cmdEncoder->setVertexBytes(mtlRendEnc, vertices, sizeof(vertices), vtxBuffIdx);
|
||||
[mtlRendEnc drawPrimitives: MTLPrimitiveTypeTriangleStrip vertexStart: 0 vertexCount: kMVKBlitVertexCount];
|
||||
[mtlRendEnc popDebugGroup];
|
||||
[mtlRendEnc endEncoding];
|
||||
}
|
||||
}
|
||||
@ -1138,7 +1111,7 @@ void mvkCmdClearAttachments(MVKCommandBuffer* cmdBuff,
|
||||
cmdBuff->addCommand(cmd);
|
||||
}
|
||||
|
||||
void mvkCmdClearImage(MVKCommandBuffer* cmdBuff,
|
||||
void mvkCmdClearColorImage(MVKCommandBuffer* cmdBuff,
|
||||
VkImage image,
|
||||
VkImageLayout imageLayout,
|
||||
const VkClearColorValue* pColor,
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "MVKFramebuffer.h"
|
||||
#include "MVKQueryPool.h"
|
||||
#include "MVKFoundation.h"
|
||||
#include "MTLRenderPassDescriptor+MoltenVK.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -225,6 +226,7 @@ void MVKCommandEncoder::beginMetalRenderPass() {
|
||||
MTLRenderPassDescriptor* mtlRPDesc = [MTLRenderPassDescriptor renderPassDescriptor];
|
||||
getSubpass()->populateMTLRenderPassDescriptor(mtlRPDesc, _framebuffer, _clearValues, _isRenderingEntireAttachment);
|
||||
mtlRPDesc.visibilityResultBuffer = _occlusionQueryState.getVisibilityResultMTLBuffer();
|
||||
mtlRPDesc.renderTargetArrayLengthMVK = _framebuffer->getLayerCount();
|
||||
|
||||
_mtlRenderEncoder = [_mtlCmdBuffer renderCommandEncoderWithDescriptor: mtlRPDesc]; // not retained
|
||||
_mtlRenderEncoder.label = getMTLRenderCommandEncoderName();
|
||||
@ -314,7 +316,7 @@ void MVKCommandEncoder::clearRenderArea() {
|
||||
VkClearRect clearRect;
|
||||
clearRect.rect = _renderArea;
|
||||
clearRect.baseArrayLayer = 0;
|
||||
clearRect.layerCount = 1;
|
||||
clearRect.layerCount = _framebuffer->getLayerCount();
|
||||
|
||||
// Create and execute a temporary clear attachments command.
|
||||
// To be threadsafe...do NOT acquire and return the command from the pool.
|
||||
|
@ -16,19 +16,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "MVKCommonEnvironment.h"
|
||||
|
||||
/** This file contains static source code for the MoltenVK command shaders. */
|
||||
|
||||
/** This file contains static MSL source code for the MoltenVK command shaders. */
|
||||
|
||||
static const char* _MVKStaticCmdShaderSource = " \n\
|
||||
#include <metal_stdlib> \n\
|
||||
using namespace metal; \n\
|
||||
\n\
|
||||
typedef struct { \n\
|
||||
float2 a_position [[attribute(0)]]; \n\
|
||||
float4 a_position [[attribute(0)]]; \n\
|
||||
} AttributesPos; \n\
|
||||
\n\
|
||||
typedef struct { \n\
|
||||
float4 v_position [[position]]; \n\
|
||||
uint layer%s; \n\
|
||||
} VaryingsPos; \n\
|
||||
\n\
|
||||
typedef struct { \n\
|
||||
@ -56,6 +59,7 @@ vertex VaryingsPos vtxCmdClearAttachments(AttributesPos attributes [[stage_in]],
|
||||
constant ClearColorsIn& ccIn [[buffer(0)]]) { \n\
|
||||
VaryingsPos varyings; \n\
|
||||
varyings.v_position = float4(attributes.a_position.x, -attributes.a_position.y, ccIn.colors[8].r, 1.0); \n\
|
||||
varyings.layer = uint(attributes.a_position.w); \n\
|
||||
return varyings; \n\
|
||||
} \n\
|
||||
\n\
|
||||
@ -74,4 +78,12 @@ kernel void compCopyBufferBytes(device uint8_t* src [[ buffer(0) ]],
|
||||
}; \n\
|
||||
";
|
||||
|
||||
#if MVK_MACOS
|
||||
static const char* _MVKAttrRTAI = " [[render_target_array_index]]";
|
||||
#endif
|
||||
|
||||
#if MVK_IOS
|
||||
static const char* _MVKAttrRTAI = "";
|
||||
#endif
|
||||
|
||||
#define MVKStaticCmdShaderSource [NSString stringWithFormat: @(_MVKStaticCmdShaderSource), _MVKAttrRTAI]
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "MVKPipeline.h"
|
||||
#include "MVKFoundation.h"
|
||||
#include "NSString+MoltenVK.h"
|
||||
#include "MTLRenderPipelineDescriptor+MoltenVK.h"
|
||||
#include "MVKLogging.h"
|
||||
|
||||
using namespace std;
|
||||
@ -31,7 +32,7 @@ using namespace std;
|
||||
|
||||
id<MTLRenderPipelineState> MVKCommandResourceFactory::newCmdBlitImageMTLRenderPipelineState(MVKRPSKeyBlitImg& blitKey) {
|
||||
MTLRenderPipelineDescriptor* plDesc = [[[MTLRenderPipelineDescriptor alloc] init] autorelease];
|
||||
plDesc.label = [NSString stringWithFormat: @"CmdBlitImage"];
|
||||
plDesc.label = @"CmdBlitImage";
|
||||
|
||||
plDesc.vertexFunction = getFunctionNamed("vtxCmdBlitImage");
|
||||
plDesc.fragmentFunction = getBlitFragFunction(blitKey);
|
||||
@ -85,10 +86,11 @@ id<MTLSamplerState> MVKCommandResourceFactory::newCmdBlitImageMTLSamplerState(MT
|
||||
|
||||
id<MTLRenderPipelineState> MVKCommandResourceFactory::newCmdClearMTLRenderPipelineState(MVKRPSKeyClearAtt& attKey) {
|
||||
MTLRenderPipelineDescriptor* plDesc = [[[MTLRenderPipelineDescriptor alloc] init] autorelease];
|
||||
plDesc.label = [NSString stringWithFormat: @"CmdClearAttachments"];
|
||||
plDesc.label = @"CmdClearAttachments";
|
||||
plDesc.vertexFunction = getFunctionNamed("vtxCmdClearAttachments");
|
||||
plDesc.fragmentFunction = getClearFragFunction(attKey);
|
||||
plDesc.sampleCount = attKey.mtlSampleCount;
|
||||
plDesc.inputPrimitiveTopologyMVK = mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);
|
||||
|
||||
for (uint32_t caIdx = 0; caIdx < kMVKAttachmentFormatDepthStencilIndex; caIdx++) {
|
||||
MTLRenderPipelineColorAttachmentDescriptor* colorDesc = plDesc.colorAttachments[caIdx];
|
||||
@ -109,10 +111,10 @@ id<MTLRenderPipelineState> MVKCommandResourceFactory::newCmdClearMTLRenderPipeli
|
||||
|
||||
// Vertex location
|
||||
vaDesc = vaDescArray[0];
|
||||
vaDesc.format = MTLVertexFormatFloat2;
|
||||
vaDesc.format = MTLVertexFormatFloat4;
|
||||
vaDesc.bufferIndex = vtxBuffIdx;
|
||||
vaDesc.offset = vtxStride;
|
||||
vtxStride += sizeof(simd::float2);
|
||||
vtxStride += sizeof(simd::float4);
|
||||
|
||||
// Vertex attribute buffer.
|
||||
MTLVertexBufferLayoutDescriptorArray* vbDescArray = vtxDesc.layouts;
|
||||
@ -357,7 +359,7 @@ void MVKCommandResourceFactory::initMTLLibrary() {
|
||||
@autoreleasepool {
|
||||
MTLCompileOptions* shdrOpts = [[MTLCompileOptions new] autorelease];
|
||||
NSError* err = nil;
|
||||
_mtlLibrary = [getMTLDevice() newLibraryWithSource: @(_MVKStaticCmdShaderSource)
|
||||
_mtlLibrary = [getMTLDevice() newLibraryWithSource: MVKStaticCmdShaderSource
|
||||
options: shdrOpts
|
||||
error: &err]; // retained
|
||||
MVKAssert( !err, "Could not compile command shaders %s (code %li) %s", err.localizedDescription.UTF8String, (long)err.code, err.localizedFailureReason.UTF8String);
|
||||
|
@ -81,6 +81,9 @@ public:
|
||||
/** Populates the specified structure with the properties of this device. */
|
||||
void getProperties(VkPhysicalDeviceProperties* properties);
|
||||
|
||||
/** Returns whether the specified format is supported. */
|
||||
bool getFormatIsSupported(VkFormat format);
|
||||
|
||||
/** Populates the specified structure with the format properties of this device. */
|
||||
void getFormatProperties(VkFormat format, VkFormatProperties* pFormatProperties);
|
||||
|
||||
|
@ -65,22 +65,31 @@ void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties* properties) {
|
||||
if (properties) { *properties = _properties; }
|
||||
}
|
||||
|
||||
#define MVK_FMT_NO_FEATS { 0, 0, 0 }
|
||||
bool MVKPhysicalDevice::getFormatIsSupported(VkFormat format) {
|
||||
|
||||
if ( !mvkVkFormatIsSupported(format) ) { return false; }
|
||||
|
||||
// Special-case certain formats that not all GPU's support.
|
||||
#if MVK_MACOS
|
||||
switch (mvkMTLPixelFormatFromVkFormat(format)) {
|
||||
case MTLPixelFormatDepth24Unorm_Stencil8:
|
||||
return getMTLDevice().isDepth24Stencil8PixelFormatSupported;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MVKPhysicalDevice::getFormatProperties(VkFormat format,
|
||||
VkFormatProperties* pFormatProperties) {
|
||||
if ( !pFormatProperties ) { return; }
|
||||
|
||||
*pFormatProperties = mvkVkFormatProperties(format);
|
||||
|
||||
#if MVK_MACOS
|
||||
// Special-case certain formats that not all macOS GPU's support.
|
||||
// Lookup from Metal to Vulkan to avoid logging error message when going the other way.
|
||||
if (format == mvkVkFormatFromMTLPixelFormat(MTLPixelFormatDepth24Unorm_Stencil8) &&
|
||||
!getMTLDevice().isDepth24Stencil8PixelFormatSupported) {
|
||||
*pFormatProperties = MVK_FMT_NO_FEATS;
|
||||
static VkFormatProperties noFmtFeats = { 0, 0, 0 };
|
||||
if (pFormatProperties) {
|
||||
*pFormatProperties = getFormatIsSupported(format) ? mvkVkFormatProperties(format) : noFmtFeats;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
VkResult MVKPhysicalDevice::getImageFormatProperties(VkFormat format,
|
||||
@ -90,7 +99,7 @@ VkResult MVKPhysicalDevice::getImageFormatProperties(VkFormat format,
|
||||
VkImageCreateFlags flags,
|
||||
VkImageFormatProperties* pImageFormatProperties) {
|
||||
|
||||
if ( !mvkVkFormatIsSupported(format) ) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }
|
||||
if ( !getFormatIsSupported(format) ) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }
|
||||
|
||||
if ( !pImageFormatProperties ) { return VK_SUCCESS; }
|
||||
|
||||
|
@ -33,6 +33,9 @@ public:
|
||||
/** Returns the dimensions of this framebuffer. */
|
||||
inline VkExtent2D getExtent2D() { return _extent; }
|
||||
|
||||
/** Returns the layers covered by this framebuffer. */
|
||||
inline uint32_t getLayerCount() { return _layerCount; }
|
||||
|
||||
/** Returns the attachment at the specified index. */
|
||||
inline MVKImageView* getAttachment(uint32_t index) { return _attachments[index]; }
|
||||
|
||||
@ -44,6 +47,7 @@ public:
|
||||
|
||||
protected:
|
||||
VkExtent2D _extent;
|
||||
uint32_t _layerCount;
|
||||
std::vector<MVKImageView*> _attachments;
|
||||
};
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
MVKFramebuffer::MVKFramebuffer(MVKDevice* device,
|
||||
const VkFramebufferCreateInfo* pCreateInfo) : MVKBaseDeviceObject(device) {
|
||||
_extent = { .width = pCreateInfo->width, .height = pCreateInfo->height };
|
||||
_layerCount = pCreateInfo->layers;
|
||||
|
||||
// Add clear values
|
||||
_attachments.reserve(pCreateInfo->attachmentCount);
|
||||
|
@ -35,27 +35,16 @@ VkImageType MVKImage::getImageType() { return mvkVkImageTypeFromMTLTextureType(_
|
||||
VkFormat MVKImage::getVkFormat() { return mvkVkFormatFromMTLPixelFormat(_mtlPixelFormat); }
|
||||
|
||||
VkExtent3D MVKImage::getExtent3D(uint32_t mipLevel) {
|
||||
VkExtent2D baseExtent = { _extent.width, _extent.height };
|
||||
VkExtent2D mipLvlExt = mvkMipmapLevelSizeFromBaseSize(baseExtent, mipLevel);
|
||||
|
||||
VkExtent3D extent;
|
||||
extent.width = mipLvlExt.width;
|
||||
extent.height = mipLvlExt.height;
|
||||
extent.depth = _extent.depth;
|
||||
return extent;
|
||||
return mvkMipmapLevelSizeFromBaseSize3D(_extent, mipLevel);
|
||||
}
|
||||
|
||||
VkDeviceSize MVKImage::getBytesPerRow(uint32_t mipLevel) {
|
||||
VkExtent2D baseExtent = { _extent.width, _extent.height };
|
||||
VkExtent2D mipLvlExt = mvkMipmapLevelSizeFromBaseSize(baseExtent, mipLevel);
|
||||
size_t bytesPerRow = mvkMTLPixelFormatBytesPerRow(_mtlPixelFormat, mipLvlExt.width);
|
||||
size_t bytesPerRow = mvkMTLPixelFormatBytesPerRow(_mtlPixelFormat, getExtent3D(mipLevel).width);
|
||||
return (uint32_t)mvkAlignByteOffset(bytesPerRow, _byteAlignment);
|
||||
}
|
||||
|
||||
VkDeviceSize MVKImage::getBytesPerLayer(uint32_t mipLevel) {
|
||||
VkExtent2D baseExtent = { _extent.width, _extent.height };
|
||||
VkExtent2D mipLvlExt = mvkMipmapLevelSizeFromBaseSize(baseExtent, mipLevel);
|
||||
return mvkMTLPixelFormatBytesPerLayer(_mtlPixelFormat, getBytesPerRow(mipLevel), mipLvlExt.height);
|
||||
return mvkMTLPixelFormatBytesPerLayer(_mtlPixelFormat, getBytesPerRow(mipLevel), getExtent3D(mipLevel).height);
|
||||
}
|
||||
|
||||
VkResult MVKImage::getSubresourceLayout(const VkImageSubresource* pSubresource,
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "MVKFoundation.h"
|
||||
#include "MVKOSExtensions.h"
|
||||
#include "MVKStrings.h"
|
||||
#include "MTLRenderPipelineDescriptor+MoltenVK.h"
|
||||
#include "mvk_datatypes.h"
|
||||
|
||||
#include <cereal/archives/binary.hpp>
|
||||
@ -343,11 +344,9 @@ MTLRenderPipelineDescriptor* MVKGraphicsPipeline::getMTLRenderPipelineDescriptor
|
||||
plDesc.alphaToOneEnabled = pCreateInfo->pMultisampleState->alphaToOneEnable;
|
||||
}
|
||||
|
||||
#if MVK_MACOS
|
||||
if (pCreateInfo->pInputAssemblyState) {
|
||||
plDesc.inputPrimitiveTopology = mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(pCreateInfo->pInputAssemblyState->topology);
|
||||
plDesc.inputPrimitiveTopologyMVK = mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(pCreateInfo->pInputAssemblyState->topology);
|
||||
}
|
||||
#endif
|
||||
|
||||
return plDesc;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
#include "MVKCommonEnvironment.h"
|
||||
#import "CAMetalLayer+MoltenVK.h"
|
||||
#include "CAMetalLayer+MoltenVK.h"
|
||||
|
||||
@implementation CAMetalLayer (MoltenVK)
|
||||
|
34
MoltenVK/MoltenVK/OS/MTLRenderPassDescriptor+MoltenVK.h
Normal file
34
MoltenVK/MoltenVK/OS/MTLRenderPassDescriptor+MoltenVK.h
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* MTLRenderPassDescriptor+MoltenVK.h
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Metal/Metal.h>
|
||||
|
||||
/** Extensions to MTLRenderPassDescriptor to support MoltenVK. */
|
||||
@interface MTLRenderPassDescriptor (MoltenVK)
|
||||
|
||||
/**
|
||||
* Replacement for the renderTargetArrayLength property.
|
||||
*
|
||||
* This property allows support under all OS versions. Delegates to the renderTargetArrayLength
|
||||
* property if it is available. otherwise, returns 0 when read and does nothing when set.
|
||||
*/
|
||||
@property(nonatomic, readwrite) NSUInteger renderTargetArrayLengthMVK;
|
||||
|
||||
@end
|
44
MoltenVK/MoltenVK/OS/MTLRenderPassDescriptor+MoltenVK.m
Normal file
44
MoltenVK/MoltenVK/OS/MTLRenderPassDescriptor+MoltenVK.m
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* MTLRenderPassDescriptor+MoltenVK.m
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include "MTLRenderPassDescriptor+MoltenVK.h"
|
||||
#include "MVKCommonEnvironment.h"
|
||||
|
||||
@implementation MTLRenderPassDescriptor (MoltenVK)
|
||||
|
||||
-(NSUInteger) renderTargetArrayLengthMVK {
|
||||
|
||||
#if MVK_MACOS
|
||||
return self.renderTargetArrayLength;
|
||||
#endif
|
||||
#if MVK_IOS
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
-(void) setRenderTargetArrayLengthMVK: (NSUInteger) length {
|
||||
|
||||
#if MVK_MACOS
|
||||
self.renderTargetArrayLength = length;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@end
|
38
MoltenVK/MoltenVK/OS/MTLRenderPipelineDescriptor+MoltenVK.h
Normal file
38
MoltenVK/MoltenVK/OS/MTLRenderPipelineDescriptor+MoltenVK.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* MTLRenderPipelineDescriptor+MoltenVK.h
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Metal/Metal.h>
|
||||
|
||||
|
||||
/** Extensions to MTLRenderPassDescriptor to support MoltenVK. */
|
||||
@interface MTLRenderPipelineDescriptor (MoltenVK)
|
||||
|
||||
/**
|
||||
* Replacement for the inputPrimitiveTopology property.
|
||||
*
|
||||
* This property allows support under all OS versions. Delegates to the inputPrimitiveTopology
|
||||
* property if it is available. otherwise, returns MTLPrimitiveTopologyClassUnspecified when
|
||||
* read and does nothing when set.
|
||||
*
|
||||
* The value is treated as an NSUInteger to support OS versions on which the enum is unavailable.
|
||||
*/
|
||||
@property(nonatomic, readwrite) NSUInteger inputPrimitiveTopologyMVK;
|
||||
|
||||
@end
|
44
MoltenVK/MoltenVK/OS/MTLRenderPipelineDescriptor+MoltenVK.m
Normal file
44
MoltenVK/MoltenVK/OS/MTLRenderPipelineDescriptor+MoltenVK.m
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* MTLRenderPipelineDescriptor+MoltenVK.m
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include "MTLRenderPipelineDescriptor+MoltenVK.h"
|
||||
#include "MVKCommonEnvironment.h"
|
||||
|
||||
@implementation MTLRenderPipelineDescriptor (MoltenVK)
|
||||
|
||||
-(NSUInteger) inputPrimitiveTopologyMVK {
|
||||
|
||||
#if MVK_MACOS
|
||||
return self.inputPrimitiveTopology;
|
||||
#endif
|
||||
#if MVK_IOS
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
-(void) setInputPrimitiveTopologyMVK: (NSUInteger) topology {
|
||||
|
||||
#if MVK_MACOS
|
||||
self.inputPrimitiveTopology = topology;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@end
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Metal/Metal.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* MTLTextureDescriptor+MoltenVK.m
|
||||
* MTLSamplerDescriptor+MoltenVK.m
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#import "MTLTextureDescriptor+MoltenVK.h"
|
||||
#include "MTLSamplerDescriptor+MoltenVK.h"
|
||||
|
||||
@implementation MTLSamplerDescriptor (MoltenVK)
|
||||
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <Metal/Metal.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* MTLSamplerDescriptor+MoltenVK.m
|
||||
* MTLTextureDescriptor+MoltenVK.m
|
||||
*
|
||||
* Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com)
|
||||
*
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#import "MTLSamplerDescriptor+MoltenVK.h"
|
||||
#include "MTLTextureDescriptor+MoltenVK.h"
|
||||
|
||||
@implementation MTLTextureDescriptor (MoltenVK)
|
||||
|
@ -16,12 +16,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* This file contains convenient functions for accessing Metal components during execution. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MVKCommonEnvironment.h"
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#import <Metal/Metal.h>
|
@ -19,19 +19,20 @@
|
||||
|
||||
#include "MVKOSExtensions.h"
|
||||
#include "MVKFoundation.h"
|
||||
#include "MVKCommonEnvironment.h"
|
||||
|
||||
#include <vector>
|
||||
#include <mach/mach_host.h>
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
#if MVK_MACOS
|
||||
#import <CoreFoundation/CFData.h>
|
||||
#import <IOKit/IOKitLib.h>
|
||||
#import <IOKit/IOKitKeys.h>
|
||||
# import <CoreFoundation/CFData.h>
|
||||
# import <IOKit/IOKitLib.h>
|
||||
# import <IOKit/IOKitKeys.h>
|
||||
#endif
|
||||
|
||||
#if MVK_IOS
|
||||
#import <UIKit/UIDevice.h>
|
||||
# import <UIKit/UIDevice.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
@ -16,12 +16,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
/* This file contains convenient functions for accessing Metal components during execution. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MVKCommonEnvironment.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
@ -213,6 +213,12 @@ void mvkFlipVertically(void* rowMajorData, uint32_t rowCount, size_t bytesPerRow
|
||||
|
||||
#pragma mark Vulkan structure support functions
|
||||
|
||||
/** Returns a VkExtent2D created from the width and height of a VkExtent3D. */
|
||||
static inline VkExtent2D mvkVkExtent2DFromVkExtent3D(VkExtent3D e) { return {e.width, e.height }; }
|
||||
|
||||
/** Returns a VkExtent3D, created from a VkExtent2D, and with depth of 1. */
|
||||
static inline VkExtent3D mvkVkExtent3DFromVkExtent2D(VkExtent2D e) { return {e.width, e.height, 1U }; }
|
||||
|
||||
/** Returns whether the two Vulkan extents are equal by comparing their respective components. */
|
||||
static inline bool mvkVkExtent2DsAreEqual(VkExtent2D e1, VkExtent2D e2) {
|
||||
return (e1.width == e2.width) && (e1.height == e2.height);
|
||||
|
@ -340,8 +340,8 @@ static const MVKFormatDesc _formatDescriptions[] {
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_R64G64B64A64_SINT, MTLPixelFormatInvalid, MTLPixelFormatInvalid, kMTLFmtNA, kMTLFmtNA, 1, 1, 32, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_NO_FEATS, MVK_FMT_NO_FEATS ),
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_R64G64B64A64_SFLOAT, MTLPixelFormatInvalid, MTLPixelFormatInvalid, kMTLFmtNA, kMTLFmtNA, 1, 1, 32, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_NO_FEATS, MVK_FMT_NO_FEATS ),
|
||||
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_B10G11R11_UFLOAT_PACK32, MTLPixelFormatRG11B10Float, MTLPixelFormatInvalid, 8.0, 10.11, 1, 1, 4, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_COLOR_FEATS, MVK_FMT_BUFFER_FEATS ), // Vulkan packed is reversed
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, MTLPixelFormatRGB9E5Float, MTLPixelFormatInvalid, 8.0, 10.11, 1, 1, 4, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_COLOR_FEATS, MVK_FMT_BUFFER_FEATS ), // Vulkan packed is reversed
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_B10G11R11_UFLOAT_PACK32, MTLPixelFormatInvalid, MTLPixelFormatInvalid, 8.0, 10.11, 1, 1, 4, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_COLOR_FEATS, MVK_FMT_BUFFER_FEATS ), // Vulkan packed is reversed
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, MTLPixelFormatInvalid, MTLPixelFormatInvalid, 8.0, 10.11, 1, 1, 4, MTLVertexFormatInvalid, kMVKFormatColorFloat, MVK_FMT_COLOR_FEATS, MVK_FMT_BUFFER_FEATS ), // Vulkan packed is reversed
|
||||
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_D32_SFLOAT, MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, 8.0, 10.11, 1, 1, 4, MTLVertexFormatInvalid, kMVKFormatDepthStencil, MVK_FMT_DEPTH_FEATS, MVK_FMT_BUFFER_FEATS ),
|
||||
MVK_MAKE_FMT_STRUCT( VK_FORMAT_D32_SFLOAT_S8_UINT, MTLPixelFormatDepth32Float_Stencil8, MTLPixelFormatInvalid, 9.0, 10.11, 1, 1, 5, MTLVertexFormatInvalid, kMVKFormatDepthStencil, MVK_FMT_DEPTH_FEATS, MVK_FMT_BUFFER_FEATS ),
|
||||
@ -813,7 +813,7 @@ MVK_PUBLIC_SYMBOL uint32_t mvkMipmapLevels(uint32_t dim) {
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL uint32_t mvkMipmapLevels2D(VkExtent2D extent) {
|
||||
return mvkMipmapLevels3D( {extent.width, extent.height, 1} );
|
||||
return mvkMipmapLevels3D(mvkVkExtent3DFromVkExtent2D(extent));
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL uint32_t mvkMipmapLevels3D(VkExtent3D extent) {
|
||||
@ -821,21 +821,27 @@ MVK_PUBLIC_SYMBOL uint32_t mvkMipmapLevels3D(VkExtent3D extent) {
|
||||
return max(mvkMipmapLevels(maxDim), 1U);
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL VkExtent2D mvkMipmapLevelSizeFromBaseSize(VkExtent2D baseSize, uint32_t level) {
|
||||
// Before shifting, ensure dims are treated as unsigned
|
||||
uint32_t width = baseSize.width;
|
||||
uint32_t height = baseSize.height;
|
||||
MVK_PUBLIC_SYMBOL VkExtent2D mvkMipmapLevelSizeFromBaseSize2D(VkExtent2D baseSize, uint32_t level) {
|
||||
return mvkVkExtent2DFromVkExtent3D(mvkMipmapLevelSizeFromBaseSize3D(mvkVkExtent3DFromVkExtent2D(baseSize), level));
|
||||
}
|
||||
|
||||
VkExtent2D lvlSize;
|
||||
lvlSize.width = MAX(width >> level, 1);
|
||||
lvlSize.height = MAX(height >> level, 1);
|
||||
MVK_PUBLIC_SYMBOL VkExtent3D mvkMipmapLevelSizeFromBaseSize3D(VkExtent3D baseSize, uint32_t level) {
|
||||
VkExtent3D lvlSize;
|
||||
lvlSize.width = max(baseSize.width >> level, 1U);
|
||||
lvlSize.height = max(baseSize.height >> level, 1U);
|
||||
lvlSize.depth = max(baseSize.depth >> level, 1U);
|
||||
return lvlSize;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL VkExtent2D mvkMipmapBaseSizeFromLevelSize(VkExtent2D levelSize, uint32_t level) {
|
||||
VkExtent2D baseSize;
|
||||
MVK_PUBLIC_SYMBOL VkExtent2D mvkMipmapBaseSizeFromLevelSize2D(VkExtent2D levelSize, uint32_t level) {
|
||||
return mvkVkExtent2DFromVkExtent3D(mvkMipmapBaseSizeFromLevelSize3D(mvkVkExtent3DFromVkExtent2D(levelSize), level));
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL VkExtent3D mvkMipmapBaseSizeFromLevelSize3D(VkExtent3D levelSize, uint32_t level) {
|
||||
VkExtent3D baseSize;
|
||||
baseSize.width = levelSize.width << level;
|
||||
baseSize.height = levelSize.height << level;
|
||||
baseSize.depth = levelSize.depth << level;
|
||||
return baseSize;
|
||||
}
|
||||
|
||||
@ -968,8 +974,8 @@ MVK_PUBLIC_SYMBOL MTLPrimitiveType mvkMTLPrimitiveTypeFromVkPrimitiveTopology(Vk
|
||||
}
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL NSUInteger mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(VkPrimitiveTopology vkTopology) {
|
||||
#if MVK_MACOS
|
||||
MVK_PUBLIC_SYMBOL MTLPrimitiveTopologyClass mvkMTLPrimitiveTopologyClassFromVkPrimitiveTopology(VkPrimitiveTopology vkTopology) {
|
||||
switch (vkTopology) {
|
||||
case VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
|
||||
return MTLPrimitiveTopologyClassPoint;
|
||||
@ -992,8 +998,11 @@ MVK_PUBLIC_SYMBOL MTLPrimitiveTopologyClass mvkMTLPrimitiveTopologyClassFromVkPr
|
||||
mvkNotifyErrorWithText(VK_ERROR_FORMAT_NOT_SUPPORTED, "VkPrimitiveTopology value %d is not supported for render pipelines.", vkTopology);
|
||||
return MTLPrimitiveTopologyClassUnspecified;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if MVK_IOS
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL MTLLoadAction mvkMTLLoadActionFromVkAttachmentLoadOp(VkAttachmentLoadOp vkLoadOp) {
|
||||
switch (vkLoadOp) {
|
||||
|
@ -1281,7 +1281,7 @@ MVK_PUBLIC_SYMBOL void vkCmdClearColorImage(
|
||||
const VkImageSubresourceRange* pRanges) {
|
||||
|
||||
MVKCommandBuffer* cmdBuff = MVKCommandBuffer::getMVKCommandBuffer(commandBuffer);
|
||||
mvkCmdClearImage(cmdBuff, image, imageLayout, pColor, rangeCount, pRanges);
|
||||
mvkCmdClearColorImage(cmdBuff, image, imageLayout, pColor, rangeCount, pRanges);
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL void vkCmdClearDepthStencilImage(
|
||||
|
@ -75,9 +75,8 @@ MVK_PUBLIC_SYMBOL bool mvkConvertGLSLFileToSPIRV(const char* glslFilepath,
|
||||
error: &err];
|
||||
if (err) {
|
||||
if (pResultLog) {
|
||||
NSString* errMsg = [NSString stringWithFormat: @"Unable to convert GLSL in file %s to SPIR-V: %s (code %li) %s",
|
||||
filePath.UTF8String, err.localizedDescription.UTF8String,
|
||||
(long)err.code, err.localizedFailureReason.UTF8String];
|
||||
NSString* errMsg = [NSString stringWithFormat: @"Unable to convert GLSL in file %@ to SPIR-V: %@ (code %li) %@",
|
||||
filePath, err.localizedDescription, (long)err.code, err.localizedFailureReason];
|
||||
*pResultLog = (char*)malloc(errMsg.length + 1);
|
||||
strcpy(*pResultLog, errMsg.UTF8String);
|
||||
}
|
||||
|
@ -64,9 +64,8 @@ MVK_PUBLIC_SYMBOL bool mvkConvertSPIRVFileToMSL(const char* spvFilepath,
|
||||
NSData* spv = [NSData dataWithContentsOfFile: filePath options: 0 error: &err];
|
||||
if (err) {
|
||||
if (pResultLog) {
|
||||
NSString* errMsg = [NSString stringWithFormat: @"Unable to convert SPIR-V in file %s to MSL: %s (code %li) %s",
|
||||
filePath.UTF8String, err.localizedDescription.UTF8String,
|
||||
(long)err.code, err.localizedFailureReason.UTF8String];
|
||||
NSString* errMsg = [NSString stringWithFormat: @"Unable to convert SPIR-V in file %@ to MSL: %@ (code %li) %@",
|
||||
filePath, err.localizedDescription, (long)err.code, err.localizedFailureReason];
|
||||
*pResultLog = (char*)malloc(errMsg.length + 1);
|
||||
strcpy(*pResultLog, errMsg.UTF8String);
|
||||
}
|
||||
|
30
README.md
30
README.md
@ -47,18 +47,34 @@ If you are just looking for a pre-built **MoltenVK** runtime binary, you can dow
|
||||
Introduction
|
||||
------------
|
||||
|
||||
**MoltenVK** is an implementation of the [*Vulkan 1.0*](https://www.khronos.org/vulkan)
|
||||
graphics and compute API, that runs on Apple's [*Metal*](https://developer.apple.com/metal)
|
||||
graphics and compute framework on both *iOS* and *macOS*.
|
||||
|
||||
**MoltenVK** allows you to use the *Vulkan* graphics and compute API to develop modern,
|
||||
cross-platform, high-performance graphical games and applications, and to run them across
|
||||
many platforms, including both *iOS* and *macOS*.
|
||||
|
||||
*Metal* uses a different shading language, the *Metal Shading Language (MSL)*, than
|
||||
*Vulkan*, which uses *SPIR-V*. **MoltenVK** automatically converts your *SPIR-V* shaders
|
||||
to their *MSL* equivalents.
|
||||
|
||||
To provide *Vulkan* capability to the *iOS* and *macOS* platforms, **MoltenVK** uses *Apple's*
|
||||
publicly available API's, including *Metal*. **MoltenVK** does **_not_** use any private or
|
||||
undocumented API calls or features, so your app will be compatible with all standard distribution
|
||||
channels, including *Apple's App Store*.
|
||||
|
||||
**MoltenVK** contains two products:
|
||||
|
||||
- **MoltenVK** is an implementation of the [*Vulkan 1.0*](https://www.khronos.org/vulkan)
|
||||
graphics and compute API, that runs on Apple's [*Metal*](https://developer.apple.com/metal)
|
||||
graphics and compute framework on both *iOS* and *macOS*.
|
||||
graphics and compute API.
|
||||
|
||||
- **MoltenVKShaderConverter** converts *SPIR-V* shader code to *Metal Shading Language (MSL)*
|
||||
shader source code, and converts *GLSL* shader source code to *SPIR-V* shader code and/or
|
||||
*Metal Shading Language (MSL)* shader source code, for use with **MoltenVK**. The converter
|
||||
can run at runtime as a component of the *MoltenVK* runtime, or it can be packaged into a
|
||||
stand-alone command-line *macOS* tool. The *Xcode* project contains several targets,
|
||||
reflecting this multi-use capability.
|
||||
shader code, and converts *GLSL* shader source code to *SPIR-V* shader code and/or
|
||||
*Metal Shading Language (MSL)* shader code. The *SPIR-V* converter is included in the
|
||||
**MoltenVK** runtime to automatically convert *SPIR-V* shaders to their *MSL* equivalents.
|
||||
In addition, both the *SPIR-V* and *GLSL* converters can be be packaged into a stand-alone
|
||||
command-line *macOS* tool for converting shaders at development time.
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user