I HAVE AQUIRED GPUTRACE
This commit is contained in:
@@ -94,17 +94,6 @@ Window::~Window() { glfwDestroyWindow(static_cast<GLFWwindow*>(windowHandle)); }
|
||||
void Window::pollInput() { glfwPollEvents(); }
|
||||
|
||||
void Window::beginFrame() {
|
||||
auto captureManager = MTL::CaptureManager::sharedCaptureManager();
|
||||
capture = MTL::CaptureDescriptor::alloc()->init();
|
||||
capture->setCaptureObject((__bridge id<MTLDevice>)graphics->getDevice());
|
||||
capture->setDestination(MTL::CaptureDestinationDeveloperTools);
|
||||
capture->setOutputURL(NS::URL::fileURLWithPath(NS::String::string(fmt::format("frame{0}.trace", Gfx::getCurrentFrameIndex()).c_str(), NS::ASCIIStringEncoding)));
|
||||
NS::Error* error;
|
||||
captureManager->startCapture(capture, &error);
|
||||
if(error)
|
||||
{
|
||||
std::cout << error->localizedDescription()->cString(NS::ASCIIStringEncoding) << std::endl;
|
||||
}
|
||||
drawable = (__bridge CA::MetalDrawable*)[metalLayer nextDrawable];
|
||||
createBackBuffer();
|
||||
}
|
||||
@@ -112,7 +101,6 @@ void Window::beginFrame() {
|
||||
void Window::endFrame() {
|
||||
graphics->getQueue()->getCommands()->present(drawable);
|
||||
graphics->getQueue()->submitCommands();
|
||||
MTL::CaptureManager::sharedCaptureManager()->stopCapture();
|
||||
currentFrameIndex++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user