From 95fe543efc8648a4baa4355c9e10ea5f4ff746a9 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 19 Nov 2018 10:57:06 -0700 Subject: [PATCH] Fix progress accounting: make it out of 1 instead of out of 3 tasks --- Terrain2/Terrain.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Terrain2/Terrain.swift b/Terrain2/Terrain.swift index 4ca79f7..92b7a7b 100644 --- a/Terrain2/Terrain.swift +++ b/Terrain2/Terrain.swift @@ -113,7 +113,7 @@ class Terrain: NSObject { do { updateHeightsPipeline = try Terrain.computePipeline(withFunctionNamed: "updateGeometryHeights", device: device, library: library) updateSurfaceNormalsPipeline = try Terrain.computePipeline(withFunctionNamed: "updateGeometryNormals", device: device, library: library) - updateVertexNormalsPipeline = try Terrain.computePipeline(withFunctionNamed: "updateGeometryVertexNormals", device: device, library: library) +// updateVertexNormalsPipeline = try Terrain.computePipeline(withFunctionNamed: "updateGeometryVertexNormals", device: device, library: library) } catch { print("Unable to create compute pipelines for terrain geometry updates. Error: \(error)") return nil @@ -123,18 +123,16 @@ class Terrain: NSObject { } func generate(completion: @escaping () -> Void) -> Progress { - let progress = Progress(totalUnitCount: 3) + let progress = Progress(totalUnitCount: 1) generatorQueue.async { - progress.becomeCurrent(withPendingUnitCount: 3) + progress.becomeCurrent(withPendingUnitCount: 1) - let heights = self.generator.render(progress: progress) + let _ = self.generator.render(progress: progress) progress.completedUnitCount += 1 // TODO: Store heights - progress.completedUnitCount += 1 // TODO: Compute normals - progress.completedUnitCount += 1 progress.resignCurrent() completion()