MetalByTutorials/23-debugging-and-profiling
daemyung jang bd43ba6465
Summerize Chapter 23: Debugging & Profiling
2022-04-15 09:39:47 +09:00
..
final/Debugging Copy source code from the official website 2021-04-15 11:39:00 +09:00
starter/Debugging Copy source code from the official website 2021-04-15 11:39:00 +09:00
README.md Summerize Chapter 23: Debugging & Profiling 2022-04-15 09:39:47 +09:00

README.md

Chapter 23: Debugging & Profiling

As I read this book, I summarize what I think is wrong. If you think my comments are wrong then please let me know. We can dicuss more and update your opinion.

GPU frame capture

Maybe you can't find Capture GPU Frame from the Action drop-down. Capture GPU Frame is renamed to Capture GPU Workload.

This book mentions that you can capture GPU frame programmatically but the code isn't given.

In Renderer.swift, in draw(in view:), add this at the top of this function:

let captureManager = MTLCaptureManager.shared()
let captureDescriptor = MTLCaptureDescriptor()
captureDescriptor.captureObject = Renderer.device
do {
    try captureManager.startCapture(with: captureDescriptor)
} catch {
    fatalError("error when trying to capture: \(error)")
}

Add this at the bottom of this function:

captureManager.stopCapture()

If you want to know more, you can get more detail at here.