This patch adds a new mode of gpu capture (env var CYCLES_DEBUG_METAL_CAPTURE_SAMPLES) to capture a block of dispatches between "reset" calls. It also fixes member data naming inconsistencies and adds some missing OS version checks.
Screenshot showing .gputrace capture in Xcode 14.0 beta (using CYCLES_DEBUG_METAL_CAPTURE_SAMPLES="1" and CYCLES_DEBUG_METAL_CAPTURE_LIMIT="10"):
