Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The frameretrace branch of Apitrace is an effort to create a frame-analysis UI based on Apitrace. Limiting retrace to a single frame or group of frames allows the user to repeatedly and rapidly play the frame's calls without retracing the whole trace file.
The existing qapitrace tool provides access to many aspects of a trace file. Unfortunately, the command-line interface to the retrace tool limits the usability of qapitrace. Accessing details for a frame or api call results in a full playback of the trace, which can be time consuming. The process of debugging or optimizing a trace often requires exploration of the trace file, which is hampered by the slow retrace.
The frameretrace UI works with a server process, which exposes a socket to the UI. This process is either created by the frametrace UI (local operation) or can be spawned manually by the user. The server process accepts retrace commands over the socket, and provides the results back to the UI. When the server process is instructed over the socket, it opens the trace file and retraces all commands up to the specified frame. As the communication is socket based, the frameretrace UI can be on a different machine to the server process, which is useful for work with embedded systems or when working with many systems on a network.
The UI commands the server process to retrace from the beginning of the frame to a specified draw call and provide results (framebuffer images, bound state, etc) back to the UI. This is generally safe to do because of the repeatable nature of GL commands within a frame boundary.
The workflow for frameretrace is intended to be similar to GPA Frame Analyzer for DirectX, a widely used frame debug/optimization tool. Some descriptions of Frame Analyzer features can be seen here:
I've made an effort to list out the main use cases for a fully-featured frame analysis tool. The core workflow is:
Explore renders, shaders, state, and textures in a frame. Use GPU metrics to identify which renders consume the most time.
Alter shaders, state, uniforms, and texture settings for renders, and see the result in updated metrics and framebuffer images.
Analyze a single frame on both windows and linux, to identify and root cause performance deltas between platforms.
The feature backlog for FrameRetrace is tracked here: https://www.pivotaltracker.com/n/projects/1471332