Skip to content

Commit

Permalink
Merge branch 'main' into ue4-nastys-patch-env
Browse files Browse the repository at this point in the history
  • Loading branch information
italomandara committed Jan 31, 2024
2 parents d4abc4f + 885960a commit c8825ae
Show file tree
Hide file tree
Showing 36 changed files with 615 additions and 324 deletions.
13 changes: 13 additions & 0 deletions Common/MVKCommonEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ extern "C" {
(__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000))
#endif

/**
* Enable use of private Metal APIs.
*
* Enabling this build setting during a MoltenVK build will allow MoltenVK to
* extend its functionality by using certain private Metal API calls, but it
* will also disqualify the app from being distributed via Apple App Stores.
*
* Disabled by default.
*/
#ifndef MVK_USE_METAL_PRIVATE_API
# define MVK_USE_METAL_PRIVATE_API 0
#endif

/** Directive to identify public symbols. */
#define MVK_PUBLIC_SYMBOL __attribute__((visibility("default"))) __attribute__((used))

Expand Down
13 changes: 13 additions & 0 deletions Docs/MoltenVK_Configuration_Parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,3 +663,16 @@ Determines the style used to implement _Vulkan_ semaphore (`VkSemaphore`) functi
In the special case of `VK_SEMAPHORE_TYPE_TIMELINE` semaphores, **MoltenVK** will always use
`MTLSharedEvent` if it is available on the platform, regardless of the value of this parameter.


---------------------------------------
#### MVK_CONFIG_USE_METAL_PRIVATE_API

##### Type: Boolean
##### Default: Value of `MVK_USE_METAL_PRIVATE_API`

If enabled, **MoltenVK** will _use_ private interfaces exposed by _Metal_ to implement _Vulkan_
features that are difficult to support otherwise.

Unlike `MVK_USE_METAL_PRIVATE_API`, this setting may be overridden at run time.

This option is not available unless MoltenVK were built with `MVK_USE_METAL_PRIVATE_API` set to `1`.
5 changes: 5 additions & 0 deletions Docs/Whats_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ Released TBD

- Add `MVK_USE_METAL_PRIVATE_API` build setting to allow **MoltenVK** to be built with access to _Metal_ private API calls.
- Add support for `VkPhysicalDeviceFeatures::wideLines` feature when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build.
- Add support for the `VkPhysicalDeviceFeatures::logicOp` feature when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build.
- Add support for the `VkPhysicalDeviceFeatures::depthBounds` feature on AMD GPUs when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build.
- Add support for the `VkPhysicalDevicePortabilitySubsetFeaturesKHR::samplerMipLodBias` feature when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build.
- Add support for Metal native pipeline sample masks when `MVK_USE_METAL_PRIVATE_API` is enabled in a **MoltenVK** build.
- Fix potential crash when using multi-planar images.
- Ensure buffers available for buffer addresses in push constants.
- Support `libMoltenVK.dylib` for _iOS Simulator_ architecture.
- Restore support for _iOS Simulator_ destination in recent update to _Cube_ demo that uses dynamic-linking.
- Don't update `currentExtent` of headless surface when swapchain attached.
- `runcts` script also output a file containing a list of the failed CTS tests.



Expand Down
12 changes: 12 additions & 0 deletions MoltenVK/MoltenVK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@
45557A5321C9EFF3008868BD /* MVKCodec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 45557A4D21C9EFF3008868BD /* MVKCodec.mm */; };
45557A5421C9EFF3008868BD /* MVKCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 45557A5121C9EFF3008868BD /* MVKCodec.h */; };
45557A5521C9EFF3008868BD /* MVKCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 45557A5121C9EFF3008868BD /* MVKCodec.h */; };
45E3A40B2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = 45E3A4062166B922005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h */; };
45E3A40C2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h in Headers */ = {isa = PBXBuildFile; fileRef = 45E3A4062166B922005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h */; };
45E3A40D2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = 45E3A40A2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m */; };
45E3A40E2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m in Sources */ = {isa = PBXBuildFile; fileRef = 45E3A40A2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m */; };
A9096E5E1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9096E5D1F81E16300DFBEA6 /* MVKCmdDispatch.mm */; };
A9096E5F1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9096E5D1F81E16300DFBEA6 /* MVKCmdDispatch.mm */; };
A909F65F213B190700FCD6BE /* MVKExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = A909F65A213B190600FCD6BE /* MVKExtensions.h */; };
Expand Down Expand Up @@ -582,6 +586,8 @@
45557A4D21C9EFF3008868BD /* MVKCodec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKCodec.mm; sourceTree = "<group>"; };
45557A5121C9EFF3008868BD /* MVKCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKCodec.h; sourceTree = "<group>"; };
45557A5721CD83C3008868BD /* MVKDXTnCodec.def */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MVKDXTnCodec.def; sourceTree = "<group>"; };
45E3A4062166B922005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h"; sourceTree = "<group>"; };
45E3A40A2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m"; sourceTree = "<group>"; };
A9096E5C1F81E16300DFBEA6 /* MVKCmdDispatch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVKCmdDispatch.h; sourceTree = "<group>"; };
A9096E5D1F81E16300DFBEA6 /* MVKCmdDispatch.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MVKCmdDispatch.mm; sourceTree = "<group>"; };
A909F65A213B190600FCD6BE /* MVKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKExtensions.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -904,6 +910,8 @@
453638302508A4C6000EFFD3 /* MTLRenderPassStencilAttachmentDescriptor+MoltenVK.m */,
A9E53DFE21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.h */,
A9E53DFA21064F84002781DD /* MTLRenderPipelineDescriptor+MoltenVK.m */,
45E3A4062166B922005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h */,
45E3A40A2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m */,
A9E53DD32100B197002781DD /* MTLSamplerDescriptor+MoltenVK.h */,
A9E53DCD2100B197002781DD /* MTLSamplerDescriptor+MoltenVK.m */,
A9E53DD02100B197002781DD /* MTLTextureDescriptor+MoltenVK.h */,
Expand Down Expand Up @@ -1086,6 +1094,7 @@
A94FB7BC1C7DFB4800632CA3 /* MVKCmdPipeline.h in Headers */,
A9F3D9DC24732A4D00745190 /* MVKSmallVectorAllocator.h in Headers */,
A9C327562AAFBD390025EE79 /* MVKConfigMembers.def in Headers */,
45E3A40B2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h in Headers */,
A94FB7F81C7DFB4800632CA3 /* MVKPipeline.h in Headers */,
A94FB7F01C7DFB4800632CA3 /* MVKImage.h in Headers */,
4553AEFD2251617100E8EBCD /* MVKBlockObserver.h in Headers */,
Expand Down Expand Up @@ -1163,6 +1172,7 @@
A94FB7C51C7DFB4800632CA3 /* MVKCmdRendering.h in Headers */,
A94FB7BD1C7DFB4800632CA3 /* MVKCmdPipeline.h in Headers */,
A9F3D9DD24732A4D00745190 /* MVKSmallVectorAllocator.h in Headers */,
45E3A40C2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.h in Headers */,
A94FB7F91C7DFB4800632CA3 /* MVKPipeline.h in Headers */,
A9C327582AAFBD3A0025EE79 /* MVKConfigMembers.def in Headers */,
A94FB7F11C7DFB4800632CA3 /* MVKImage.h in Headers */,
Expand Down Expand Up @@ -1776,6 +1786,7 @@
A9E53DE92100B197002781DD /* CAMetalLayer+MoltenVK.mm in Sources */,
A9096E5E1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */,
A99C90F0229455B300A061DA /* MVKCmdDebug.mm in Sources */,
45E3A40D2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1836,6 +1847,7 @@
A9E53DEA2100B197002781DD /* CAMetalLayer+MoltenVK.mm in Sources */,
A9096E5F1F81E16300DFBEA6 /* MVKCmdDispatch.mm in Sources */,
A99C90F1229455B300A061DA /* MVKCmdDebug.mm in Sources */,
45E3A40E2166B923005E3E38 /* MTLRenderPipelineColorAttachmentDescriptor+MoltenVK.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
3 changes: 3 additions & 0 deletions MoltenVK/MoltenVK/API/mvk_datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ MTLBlendOperation mvkMTLBlendOperationFromVkBlendOp(VkBlendOp vkBlendOp);
/** Returns the Metal MTLBlendFactor corresponding to the specified Vulkan VkBlendFactor. */
MTLBlendFactor mvkMTLBlendFactorFromVkBlendFactor(VkBlendFactor vkBlendFactor);

/** Returns the Metal MTLLogicOperation corresponding to the specified Vulkan VkLogicOp. */
NSUInteger mvkMTLLogicOperationFromVkLogicOp(VkLogicOp vkBlendOp);

/**
* Returns the Metal MTLVertexFormat corresponding to the specified
* Vulkan VkFormat as used as a vertex attribute format.
Expand Down
2 changes: 2 additions & 0 deletions MoltenVK/MoltenVK/API/mvk_private_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ typedef struct {
MVKConfigCompressionAlgorithm shaderSourceCompressionAlgorithm; /**< MVK_CONFIG_SHADER_COMPRESSION_ALGORITHM */
VkBool32 shouldMaximizeConcurrentCompilation; /**< MVK_CONFIG_SHOULD_MAXIMIZE_CONCURRENT_COMPILATION */
float timestampPeriodLowPassAlpha; /**< MVK_CONFIG_TIMESTAMP_PERIOD_LOWPASS_ALPHA */
VkBool32 useMetalPrivateAPI; /**< MVK_CONFIG_USE_METAL_PRIVATE_API */
uint32_t _unused_struct_padding;
} MVKConfiguration;

// Legacy support for renamed struct elements.
Expand Down
3 changes: 0 additions & 3 deletions MoltenVK/MoltenVK/Commands/MVKCmdDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class MVKCmdDebugMarker : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDebugMarkerBegin

/** Vulkan command to begin a marker region into the command buffer. */
class MVKCmdDebugMarkerBegin : public MVKCmdDebugMarker {

public:
Expand All @@ -57,7 +56,6 @@ class MVKCmdDebugMarkerBegin : public MVKCmdDebugMarker {
#pragma mark -
#pragma mark MVKCmdDebugMarkerEnd

/** Vulkan command to end an open marker region in the command buffer. */
class MVKCmdDebugMarkerEnd : public MVKCommand {

public:
Expand All @@ -74,7 +72,6 @@ class MVKCmdDebugMarkerEnd : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDebugMarkerInsert

/** Vulkan command to insert a debug marker into the command encoder. */
class MVKCmdDebugMarkerInsert : public MVKCmdDebugMarker {

public:
Expand Down
2 changes: 0 additions & 2 deletions MoltenVK/MoltenVK/Commands/MVKCmdDispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#pragma mark -
#pragma mark MVKCmdDispatch

/** Vulkan command to dispatch compute threadgroups. */
class MVKCmdDispatch : public MVKCommand {

public:
Expand All @@ -51,7 +50,6 @@ class MVKCmdDispatch : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDispatchIndirect

/** Vulkan command to dispatch compute threadgroups. */
class MVKCmdDispatchIndirect : public MVKCommand {

public:
Expand Down
5 changes: 0 additions & 5 deletions MoltenVK/MoltenVK/Commands/MVKCmdDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ typedef MVKCmdBindVertexBuffers<8> MVKCmdBindVertexBuffersMulti;
#pragma mark -
#pragma mark MVKCmdBindIndexBuffer

/** Vulkan command to bind a vertex index buffer. */
class MVKCmdBindIndexBuffer : public MVKCommand {

public:
Expand All @@ -82,7 +81,6 @@ class MVKCmdBindIndexBuffer : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDraw

/** Vulkan command to draw vertices. */
class MVKCmdDraw : public MVKCommand {

public:
Expand All @@ -108,7 +106,6 @@ class MVKCmdDraw : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDrawIndexed

/** Vulkan command to draw indexed vertices. */
class MVKCmdDrawIndexed : public MVKCommand {

public:
Expand Down Expand Up @@ -136,7 +133,6 @@ class MVKCmdDrawIndexed : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDrawIndirect

/** Vulkan command to draw vertices indirectly. */
class MVKCmdDrawIndirect : public MVKCommand {

public:
Expand All @@ -162,7 +158,6 @@ class MVKCmdDrawIndirect : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdDrawIndexedIndirect

/** Vulkan command to draw indexed vertices indirectly. */
class MVKCmdDrawIndexedIndirect : public MVKCommand {

public:
Expand Down
6 changes: 0 additions & 6 deletions MoltenVK/MoltenVK/Commands/MVKCmdPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class MVKCmdBindPipeline : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdBindGraphicsPipeline

/** Vulkan command to bind a graphics pipeline. */
class MVKCmdBindGraphicsPipeline : public MVKCmdBindPipeline {

public:
Expand All @@ -136,7 +135,6 @@ class MVKCmdBindGraphicsPipeline : public MVKCmdBindPipeline {
#pragma mark -
#pragma mark MVKCmdBindComputePipeline

/** Vulkan command to bind a compute pipeline. */
class MVKCmdBindComputePipeline : public MVKCmdBindPipeline {

public:
Expand Down Expand Up @@ -256,7 +254,6 @@ typedef MVKCmdPushConstants<512> MVKCmdPushConstantsMulti;
#pragma mark -
#pragma mark MVKCmdPushDescriptorSet

/** Vulkan command to update a descriptor set. */
class MVKCmdPushDescriptorSet : public MVKCommand {

public:
Expand Down Expand Up @@ -285,7 +282,6 @@ class MVKCmdPushDescriptorSet : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdPushDescriptorSetWithTemplate

/** Vulkan command to update a descriptor set from a template. */
class MVKCmdPushDescriptorSetWithTemplate : public MVKCommand {

public:
Expand All @@ -312,7 +308,6 @@ class MVKCmdPushDescriptorSetWithTemplate : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdSetEvent

/** Vulkan command to set an event. */
class MVKCmdSetEvent : public MVKCommand {

public:
Expand All @@ -336,7 +331,6 @@ class MVKCmdSetEvent : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdResetEvent

/** Vulkan command to reset an event. */
class MVKCmdResetEvent : public MVKCommand {

public:
Expand Down
5 changes: 0 additions & 5 deletions MoltenVK/MoltenVK/Commands/MVKCmdQueries.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class MVKCmdQuery : public MVKCommand {
#pragma mark -
#pragma mark MVKCmdBeginQuery

/** Vulkan command to begin a query. */
class MVKCmdBeginQuery : public MVKCmdQuery {

public:
Expand All @@ -65,7 +64,6 @@ class MVKCmdBeginQuery : public MVKCmdQuery {
#pragma mark -
#pragma mark MVKCmdEndQuery

/** Vulkan command to end a query. */
class MVKCmdEndQuery : public MVKCmdQuery {

public:
Expand All @@ -80,7 +78,6 @@ class MVKCmdEndQuery : public MVKCmdQuery {
#pragma mark -
#pragma mark MVKCmdWriteTimestamp

/** Vulkan command to write a timestamp. */
class MVKCmdWriteTimestamp : public MVKCmdQuery {

public:
Expand All @@ -101,7 +98,6 @@ class MVKCmdWriteTimestamp : public MVKCmdQuery {
#pragma mark -
#pragma mark MVKCmdResetQueryPool

/** Vulkan command to reset the results in a query pool. */
class MVKCmdResetQueryPool : public MVKCmdQuery {

public:
Expand All @@ -122,7 +118,6 @@ class MVKCmdResetQueryPool : public MVKCmdQuery {
#pragma mark -
#pragma mark MVKCmdCopyQueryPoolResults

/** Vulkan command to reset the results in a query pool. */
class MVKCmdCopyQueryPoolResults : public MVKCmdQuery {

public:
Expand Down
Loading

0 comments on commit c8825ae

Please sign in to comment.