diff --git a/PluginSource/projects/Xcode/RenderingPlugin.xcodeproj/project.pbxproj b/PluginSource/projects/Xcode/RenderingPlugin.xcodeproj/project.pbxproj index 08f683df..c2d47c42 100644 --- a/PluginSource/projects/Xcode/RenderingPlugin.xcodeproj/project.pbxproj +++ b/PluginSource/projects/Xcode/RenderingPlugin.xcodeproj/project.pbxproj @@ -7,12 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 2B6899B81CF8396700C4BA4F /* RenderAPI_OpenGLCoreES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B6899B01CF8396700C4BA4F /* RenderAPI_OpenGLCoreES.cpp */; }; 2B6899B91CF8396700C4BA4F /* RenderAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B6899B11CF8396700C4BA4F /* RenderAPI.cpp */; }; 2B6899BA1CF8396700C4BA4F /* RenderingPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B6899B31CF8396700C4BA4F /* RenderingPlugin.cpp */; }; 2B6899C91CF83DB000C4BA4F /* RenderingPlugin.bundle in Copy Bundle into Unity project */ = {isa = PBXBuildFile; fileRef = 8D576316048677EA00EA77CD /* RenderingPlugin.bundle */; }; 2B6899CB1CF8409A00C4BA4F /* RenderAPI_Metal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2B6899CA1CF8409A00C4BA4F /* RenderAPI_Metal.mm */; }; - 2BC2A8D5144C433D00D5EF79 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BC2A8D4144C433D00D5EF79 /* OpenGL.framework */; }; + 8A0E9E8B3022106C005CEB36 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A0E9E8A3022106C005CEB36 /* Metal.framework */; }; 8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; }; /* End PBXBuildFile section */ @@ -33,9 +32,6 @@ /* Begin PBXFileReference section */ 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 2B6899AB1CF8396700C4BA4F /* PlatformBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformBase.h; path = ../../source/PlatformBase.h; sourceTree = ""; }; - 2B6899AD1CF8396700C4BA4F /* RenderAPI_D3D11.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderAPI_D3D11.cpp; path = ../../source/RenderAPI_D3D11.cpp; sourceTree = ""; }; - 2B6899AE1CF8396700C4BA4F /* RenderAPI_D3D12.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderAPI_D3D12.cpp; path = ../../source/RenderAPI_D3D12.cpp; sourceTree = ""; }; - 2B6899B01CF8396700C4BA4F /* RenderAPI_OpenGLCoreES.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderAPI_OpenGLCoreES.cpp; path = ../../source/RenderAPI_OpenGLCoreES.cpp; sourceTree = ""; }; 2B6899B11CF8396700C4BA4F /* RenderAPI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderAPI.cpp; path = ../../source/RenderAPI.cpp; sourceTree = ""; }; 2B6899B21CF8396700C4BA4F /* RenderAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderAPI.h; path = ../../source/RenderAPI.h; sourceTree = ""; }; 2B6899B31CF8396700C4BA4F /* RenderingPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderingPlugin.cpp; path = ../../source/RenderingPlugin.cpp; sourceTree = ""; }; @@ -46,7 +42,7 @@ 2B6899C61CF839A600C4BA4F /* IUnityGraphicsMetal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IUnityGraphicsMetal.h; path = ../../source/Unity/IUnityGraphicsMetal.h; sourceTree = ""; }; 2B6899C71CF839A600C4BA4F /* IUnityInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IUnityInterface.h; path = ../../source/Unity/IUnityInterface.h; sourceTree = ""; }; 2B6899CA1CF8409A00C4BA4F /* RenderAPI_Metal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RenderAPI_Metal.mm; path = ../../source/RenderAPI_Metal.mm; sourceTree = ""; }; - 2BC2A8D4144C433D00D5EF79 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 8A0E9E8A3022106C005CEB36 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; 8D576316048677EA00EA77CD /* RenderingPlugin.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RenderingPlugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -56,8 +52,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8A0E9E8B3022106C005CEB36 /* Metal.framework in Frameworks */, 8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */, - 2BC2A8D5144C433D00D5EF79 /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,6 +67,7 @@ 089C167CFE841241C02AAC07 /* Resources */, 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, 19C28FB6FE9D52B211CA2CBB /* Products */, + 8A0E9E893022106C005CEB36 /* Frameworks */, ); name = RenderingPlugin; sourceTree = ""; @@ -79,7 +76,6 @@ isa = PBXGroup; children = ( 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */, - 2BC2A8D4144C433D00D5EF79 /* OpenGL.framework */, ); name = "External Frameworks and Libraries"; sourceTree = ""; @@ -97,10 +93,7 @@ children = ( 2B6899BC1CF8398200C4BA4F /* Unity */, 2B6899AB1CF8396700C4BA4F /* PlatformBase.h */, - 2B6899AD1CF8396700C4BA4F /* RenderAPI_D3D11.cpp */, - 2B6899AE1CF8396700C4BA4F /* RenderAPI_D3D12.cpp */, 2B6899CA1CF8409A00C4BA4F /* RenderAPI_Metal.mm */, - 2B6899B01CF8396700C4BA4F /* RenderAPI_OpenGLCoreES.cpp */, 2B6899B11CF8396700C4BA4F /* RenderAPI.cpp */, 2B6899B21CF8396700C4BA4F /* RenderAPI.h */, 2B6899B31CF8396700C4BA4F /* RenderingPlugin.cpp */, @@ -129,6 +122,14 @@ name = Unity; sourceTree = ""; }; + 8A0E9E893022106C005CEB36 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8A0E9E8A3022106C005CEB36 /* Metal.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -194,7 +195,6 @@ buildActionMask = 2147483647; files = ( 2B6899BA1CF8396700C4BA4F /* RenderingPlugin.cpp in Sources */, - 2B6899B81CF8396700C4BA4F /* RenderAPI_OpenGLCoreES.cpp in Sources */, 2B6899B91CF8396700C4BA4F /* RenderAPI.cpp in Sources */, 2B6899CB1CF8409A00C4BA4F /* RenderAPI_Metal.mm in Sources */, ); @@ -214,9 +214,10 @@ HEADER_SEARCH_PATHS = ../; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; + MACOSX_DEPLOYMENT_TARGET = 13.0; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}"; PRODUCT_NAME = RenderingPlugin; - VALID_ARCHS = x86_64; WRAPPER_EXTENSION = bundle; }; name = Debug; @@ -231,9 +232,10 @@ HEADER_SEARCH_PATHS = ../; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; + MACOSX_DEPLOYMENT_TARGET = 13.0; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}"; PRODUCT_NAME = RenderingPlugin; - VALID_ARCHS = x86_64; WRAPPER_EXTENSION = bundle; }; name = Release; @@ -245,7 +247,7 @@ ENABLE_TESTABILITY = YES; GCC_OPTIMIZATION_LEVEL = 0; MACOSX_DEPLOYMENT_TARGET = 10.11; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; SYMROOT = ../../build; }; @@ -258,6 +260,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.11; SDKROOT = macosx; SYMROOT = ../../build; + ONLY_ACTIVE_ARCH = NO; }; name = Release; }; diff --git a/PluginSource/source/PlatformBase.h b/PluginSource/source/PlatformBase.h index f24cd366..c9d4e8b3 100644 --- a/PluginSource/source/PlatformBase.h +++ b/PluginSource/source/PlatformBase.h @@ -51,7 +51,7 @@ #define SUPPORT_OPENGL_UNIFIED 1 #define SUPPORT_OPENGL_CORE 1 #define SUPPORT_VULKAN 0 // Requires Vulkan SDK to be installed -#elif UNITY_IOS || UNITY_TVOS || UNITY_ANDROID || UNITY_WEBGL +#elif UNITY_ANDROID || UNITY_WEBGL #ifndef SUPPORT_OPENGL_ES #define SUPPORT_OPENGL_ES 1 #endif @@ -59,7 +59,7 @@ #ifndef SUPPORT_VULKAN #define SUPPORT_VULKAN 0 #endif -#elif UNITY_OSX || UNITY_LINUX +#elif UNITY_LINUX #define SUPPORT_OPENGL_UNIFIED 1 #define SUPPORT_OPENGL_CORE 1 #elif UNITY_EMBEDDED_LINUX diff --git a/PluginSource/source/RenderAPI_Metal.mm b/PluginSource/source/RenderAPI_Metal.mm index f7abf0f7..dd1cc9c5 100644 --- a/PluginSource/source/RenderAPI_Metal.mm +++ b/PluginSource/source/RenderAPI_Metal.mm @@ -142,7 +142,6 @@ pipeDesc.depthAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8; pipeDesc.stencilAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8; - pipeDesc.sampleCount = 1; pipeDesc.colorAttachments[0].blendingEnabled = NO; pipeDesc.vertexFunction = vertexFunction; @@ -199,8 +198,10 @@ ::memcpy(m_ConstantBuffer.contents, worldMatrix, cbSize); #if UNITY_OSX - [m_VertexBuffer didModifyRange:NSMakeRange(0, vbSize)]; - [m_ConstantBuffer didModifyRange:NSMakeRange(0, cbSize)]; + if (m_VertexBuffer.storageMode == MTLStorageModeManaged) + [m_VertexBuffer didModifyRange:NSMakeRange(0, vbSize)]; + if (m_ConstantBuffer.storageMode == MTLStorageModeManaged) + [m_ConstantBuffer didModifyRange:NSMakeRange(0, cbSize)]; #endif id cmd = (id)m_MetalGraphics->CurrentCommandEncoder(); @@ -250,7 +251,8 @@ { # if UNITY_OSX id buf = (__bridge id)bufferHandle; - [buf didModifyRange:NSMakeRange(0, buf.length)]; + if (buf.storageMode == MTLStorageModeManaged) + [buf didModifyRange:NSMakeRange(0, buf.length)]; # endif // if UNITY_OSX } diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents.meta b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents.meta deleted file mode 100644 index 74ed6185..00000000 --- a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f755e08657c4d45a2964c48ee8fe540d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist index 8eed89a2..905d9e17 100644 --- a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist +++ b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 18G87 + 25F84 CFBundleDevelopmentRegion English CFBundleExecutable @@ -47,16 +47,20 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 10G8 + 25F70 + DTPlatformName + macosx DTPlatformVersion - GM + 26.5 DTSDKBuild - 18G74 + 25F70 DTSDKName - macosx10.14 + macosx26.5 DTXcode - 1030 + 2660 DTXcodeBuild - 10G8 + 17F113 + LSMinimumSystemVersion + 13.0 diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist.meta b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist.meta deleted file mode 100644 index 0476b6af..00000000 --- a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/Info.plist.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8aa00d77c9d59498d8afc6cc966ccedf -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS.meta b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS.meta deleted file mode 100644 index 4d9bf1d4..00000000 --- a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ea416e3a931c44c7dab7be3ff85af5da -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin index ffed025a..590c51c5 100755 Binary files a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin and b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin differ diff --git a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin.meta b/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin.meta deleted file mode 100644 index 488164d4..00000000 --- a/UnityProject/Assets/Plugins/RenderingPlugin.bundle/Contents/MacOS/RenderingPlugin.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f0b092cc71f8b465cbb5a657186a3267 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: