forked from apitrace/apitrace
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qapitrace: Add RENDER and STATE groups
Description ----------- This commit extends Zack Rusin's implementation of glPushDebugGroup/ glPopDebugGroup groups logic to encompass remaining calls into two additional blocks of calls consisting of 1) Render operations (blocks of calls terminated by a render operation, e.g., glClear, glDraw, glEnd, etc.) 2) State changes Details ------- The rule for processing the calls is that every "PushDebugGroup" starts a push down into a new level in the tree; every "PopDebugGroup" pops up one level. Using "group(s)" as an alias for "glPushDebugGroup(s)", then independent of the groups, every gl Call is collected into a block, or "chunk", of calls. If there is no current "chunk" for a call being processed (such as the beginning of the frame, or the first call of a group), then a new "chunk" is started. If a RENDER operation occurs, then it closes the current chunk and gives its name to it. Since this chunk is now closed, any subsequent call must create a new chunk. When pushing or popping a group, if there is an open chunk, then it will be implicitly closed with a name of "State changes". The fully expanded tree would expand to every gl call (possibly omitting the PushDebugGroup and PopDebugGroup; they must necessarily exist for every group but have no purpose other than to name those groups.) Comments -------- Below is a use case example of thinking how this would look. Although this implementation doesn't completely follow it due to limitations in utilizing the existing groups logic, it was an easier way to get something working for feedback without messing too much with the infrastructure. A more robust implementation would be to add a new class that would be layered as a list of intermediary objects between the Frame and its Calls. The intermediary objects would then have their lists of the Frame's Call objects. In this implementation, the group name displays when the branch is collapsed but on expansion displays the gl Call with the remaining grouped Calls branched below it. A couple other notes: * This is merged on top of pull request apitrace#242: qapitrace: merge duplicate logic in TraceLoader in order to work correctly for both fully loaded traces and on-demand Frame loading * Unpaired glPopDebugGroups will not be added to a group (left dangling) * If a group consists of only one item then a group name isn't used. Testing ------- Testing only done on debian linux Tested various traces given from past gui issues qapitrace crashes on glPopDebugGroup apitrace#218 Parser::adjust_call_flags crash when 'call' is NULL apitrace#117 and other available traces. Use case example ---------------- Example list of calls glXChooseVisual glXCreateContext glXMakeCurrent glClearColor glClear < RENDER operation glPushDebugGroup("Background)" glClearColor glClear < RENDER operation glShaderSource glCompileShader glLinkProgram glDrawElements < RENDER operation glPopDebugGroup glGetTexture glBindTexture glTexImage2D glPushDebugGroup("Foreground") glClearColor glClear < RENDER operation glEnable glUseProgram glDrawElements < RENDER operation glPushDebugGroup("Character") glClearColor glClear < RENDER operation glEnable glDrawElements glPushDebugGroup("Head") glClearColor glClear < RENDER operation glDisable glDrawElements < RENDER operation glPopDebugGroup glPushDebugGroup("Body") glClearColor glClear < RENDER operation glEnable glDrawElements < RENDER operation glPopDebugGroup glPopDebugGroup glPopDebugGroup In the above list of calls are several (including nested) groups and render operations (either glClear or glDrawElements); remaining calls will be grouped into State changes. The first frame would look like the following: Frame + Clear + "Background" group + State changes + "Foreground" group Clicking to expand "Foreground" would render: Frame + Clear + "Background" group + State changes "Foreground" group + Clear + DrawElements + "Character" group Then, expanding "Character" group Frame + State changes + Clear + "Background" group + State changes "Foreground" group + Clear + DrawElements "Character" group + Clear + DrawElements + "Head" group + "Body" group The fully expanded tree for above example would then look like Frame Clear . glXChooseVisual . glxCreateContext . glxMakeCurrent . glClearColor . glClear "Background" group Clear . glClearColor . glClear DrawElements . glShaderSource . glCompileShader . glLinkProgram . glDrawElements State changes . glGetTexture . glBindTexture . glTextImage2D "Foreground" group Clear . glClearColor . glClear DrawElements . glEnable . glUseProgram . glDrawElements "Character" group Clear . glClearColor . glClear DrawElements . glEnable . glDrawElements "Head" group Clear . glClearColor . glClear DrawElements . glDisable . glDrawElements "Body" group Clear . glClearColor . glClear DrawElements . glEnable . glDrawElements
- Loading branch information
Showing
11 changed files
with
326 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.