From 8e9f88faad048a8acbf38fb9fb592f7b2253de6e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 14 Nov 2018 07:55:03 -0800 Subject: [PATCH] Add some os_signposts to track terrain generation --- Terrain2/Algorithms.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Terrain2/Algorithms.swift b/Terrain2/Algorithms.swift index 3c44068..c489ca1 100644 --- a/Terrain2/Algorithms.swift +++ b/Terrain2/Algorithms.swift @@ -8,6 +8,9 @@ import Foundation import Metal +import os + +let Log = OSLog(subsystem: "me.erynwells.Terrain2.Algorithms", category: "DiamondSquare") enum KernelError: Error { case badFunction @@ -258,6 +261,8 @@ public class DiamondSquareGenerator: TerrainGenerator { } func queue_render() -> [Float] { + os_signpost(.begin, log: Log, name: "DiamondSquare.render") + var heightMap = [Float](repeating: 0, count: grid.size.w * grid.size.h) // 0. Set the corners to initial values if they haven't been set yet. @@ -288,6 +293,8 @@ public class DiamondSquareGenerator: TerrainGenerator { } } + os_signpost(.end, log: Log, name: "DiamondSquare.render") + return heightMap }