From 2f9a3a0c44967c4391c2968b2bed0e39af9136e8 Mon Sep 17 00:00:00 2001 From: Diege Miere Date: Mon, 26 Nov 2018 18:30:47 -0200 Subject: [PATCH 1/4] Renderer CVMetalTextureCacheCreateTextureFromImage --- WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ WebARonARKit/WebARonARKit/Renderer.m | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj b/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj index 6bab875..a9d6dfd 100644 --- a/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj +++ b/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj @@ -314,7 +314,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = ETH8NG5FR9; + DEVELOPMENT_TEAM = 8BB88LDFV7; INFOPLIST_FILE = "$(SRCROOT)/WebARonARKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Google.AR.WebARonARKit; @@ -327,7 +327,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = ETH8NG5FR9; + DEVELOPMENT_TEAM = 8BB88LDFV7; INFOPLIST_FILE = "$(SRCROOT)/WebARonARKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Google.AR.WebARonARKit; diff --git a/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/WebARonARKit/WebARonARKit/Renderer.m b/WebARonARKit/WebARonARKit/Renderer.m index d1e4aec..6e01b05 100644 --- a/WebARonARKit/WebARonARKit/Renderer.m +++ b/WebARonARKit/WebARonARKit/Renderer.m @@ -63,7 +63,8 @@ @implementation Renderer { id _capturedImageTextureCbCr; // Captured image texture cache - CVMetalTextureCacheRef _capturedImageTextureCache; + CVMetalTextureCacheRef _capturedImageTextureCache; + // Metal vertex descriptor specifying how vertices will by laid out for input // into our @@ -275,7 +276,7 @@ - (void)_loadMetal { [_device newDepthStencilStateWithDescriptor:capturedImageDepthStateDescriptor]; // Create captured image texture cache - CVMetalTextureCacheCreate(NULL, NULL, _device, NULL, &_capturedImageTextureCache); + CVMetalTextureCacheCreate(kCFAllocatorDefault, NULL, _device, NULL, &_capturedImageTextureCache); id anchorGeometryVertexFunction = [defaultLibrary newFunctionWithName:@"anchorGeometryVertexTransform"]; From ba5d83453353bab129198302058c9a0a48112088 Mon Sep 17 00:00:00 2001 From: Diege Miere Date: Mon, 26 Nov 2018 18:46:23 -0200 Subject: [PATCH 2/4] Revert "Renderer CVMetalTextureCacheCreateTextureFromImage" This reverts commit 2f9a3a0c44967c4391c2968b2bed0e39af9136e8. --- WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -------- WebARonARKit/WebARonARKit/Renderer.m | 5 ++--- 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj b/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj index a9d6dfd..6bab875 100644 --- a/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj +++ b/WebARonARKit/WebARonARKit.xcodeproj/project.pbxproj @@ -314,7 +314,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 8BB88LDFV7; + DEVELOPMENT_TEAM = ETH8NG5FR9; INFOPLIST_FILE = "$(SRCROOT)/WebARonARKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Google.AR.WebARonARKit; @@ -327,7 +327,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 8BB88LDFV7; + DEVELOPMENT_TEAM = ETH8NG5FR9; INFOPLIST_FILE = "$(SRCROOT)/WebARonARKit/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = Google.AR.WebARonARKit; diff --git a/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/WebARonARKit/WebARonARKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/WebARonARKit/WebARonARKit/Renderer.m b/WebARonARKit/WebARonARKit/Renderer.m index 6e01b05..d1e4aec 100644 --- a/WebARonARKit/WebARonARKit/Renderer.m +++ b/WebARonARKit/WebARonARKit/Renderer.m @@ -63,8 +63,7 @@ @implementation Renderer { id _capturedImageTextureCbCr; // Captured image texture cache - CVMetalTextureCacheRef _capturedImageTextureCache; - + CVMetalTextureCacheRef _capturedImageTextureCache; // Metal vertex descriptor specifying how vertices will by laid out for input // into our @@ -276,7 +275,7 @@ - (void)_loadMetal { [_device newDepthStencilStateWithDescriptor:capturedImageDepthStateDescriptor]; // Create captured image texture cache - CVMetalTextureCacheCreate(kCFAllocatorDefault, NULL, _device, NULL, &_capturedImageTextureCache); + CVMetalTextureCacheCreate(NULL, NULL, _device, NULL, &_capturedImageTextureCache); id anchorGeometryVertexFunction = [defaultLibrary newFunctionWithName:@"anchorGeometryVertexTransform"]; From 65436b4ca8ab67c96bb5864e68ff1fb6d4ee3e1f Mon Sep 17 00:00:00 2001 From: Diege Miere Date: Mon, 26 Nov 2018 18:57:35 -0200 Subject: [PATCH 3/4] Renderer --- WebARonARKit/WebARonARKit/Renderer.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebARonARKit/WebARonARKit/Renderer.m b/WebARonARKit/WebARonARKit/Renderer.m index d1e4aec..b143a7a 100644 --- a/WebARonARKit/WebARonARKit/Renderer.m +++ b/WebARonARKit/WebARonARKit/Renderer.m @@ -522,7 +522,7 @@ - (void)_updateCapturedImageTexturesWithFrame:(ARFrame *)frame { if (status == kCVReturnSuccess) { mtlTexture = CVMetalTextureGetTexture(texture); CFRelease(texture); - } + } return mtlTexture; } From 2a7cdb5f31474125b5f74000bc3f4992ed530d43 Mon Sep 17 00:00:00 2001 From: Diege Miere Date: Mon, 26 Nov 2018 18:57:53 -0200 Subject: [PATCH 4/4] Renderer --- WebARonARKit/WebARonARKit/Renderer.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebARonARKit/WebARonARKit/Renderer.m b/WebARonARKit/WebARonARKit/Renderer.m index b143a7a..ccb9290 100644 --- a/WebARonARKit/WebARonARKit/Renderer.m +++ b/WebARonARKit/WebARonARKit/Renderer.m @@ -513,7 +513,7 @@ - (void)_updateCapturedImageTexturesWithFrame:(ARFrame *)frame { const size_t width = CVPixelBufferGetWidthOfPlane(pixelBuffer, planeIndex); const size_t height = CVPixelBufferGetHeightOfPlane(pixelBuffer, planeIndex); - + CVMetalTextureRef texture = NULL; CVReturn status = CVMetalTextureCacheCreateTextureFromImage( NULL, _capturedImageTextureCache, pixelBuffer, NULL, pixelFormat, width, height, planeIndex, @@ -522,7 +522,7 @@ - (void)_updateCapturedImageTexturesWithFrame:(ARFrame *)frame { if (status == kCVReturnSuccess) { mtlTexture = CVMetalTextureGetTexture(texture); CFRelease(texture); - } + } return mtlTexture; }