I HAVE AQUIRED GPUTRACE

This commit is contained in:
Dynamitos
2024-04-19 22:44:00 +02:00
parent 194a0e8b91
commit a27e280ab8
26 changed files with 169 additions and 182 deletions
-12
View File
@@ -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++;
}