Skip to content

Commit

Permalink
vogleditor: Add for additional nest operations
Browse files Browse the repository at this point in the history
Add glPush/PopDebugGroup as nesting delimiters along with existing
glBegin/End. Use same method as for other "vogl_is_xxx_entrypoint"
operations.

Comments:
If this glPush/PopDebugGroup addition is (and/or possibly others are)
accepted for nesting, another method would be to add a flag attribute
to packets to identify apicall types that can be logically AND'd rather
than using a switch statement (as done in apitrace).

Alternatively, create a "nest" object to encapsulate this information,
initializing it with a set of nested pairs (statically or via some
preference) and provide an interface(s) to return needed information.

Signed-off-by: Lawrence L Love <lawrencex.l.love@intel.com>
  • Loading branch information
lawlove committed Apr 25, 2014
1 parent 7ea354d commit 817685d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
30 changes: 30 additions & 0 deletions src/voglcommon/vogl_gl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,36 @@ bool vogl_is_clear_entrypoint(gl_entrypoint_id_t id)
return false;
}

//------------------------------------------------------------------------------
// vogl_is_start_nested_entrypoint
//------------------------------------------------------------------------------
bool vogl_is_start_nested_entrypoint(gl_entrypoint_id_t id)
{
switch (id) {
case VOGL_ENTRYPOINT_glBegin:
case VOGL_ENTRYPOINT_glPushDebugGroup:
return true;
default:
break;
}
return false;
}

//------------------------------------------------------------------------------
// vogl_is_end_nested_entrypoint
//------------------------------------------------------------------------------
bool vogl_is_end_nested_entrypoint(gl_entrypoint_id_t id)
{
switch (id) {
case VOGL_ENTRYPOINT_glEnd:
case VOGL_ENTRYPOINT_glPopDebugGroup:
return true;
default:
break;
}
return false;
}

//----------------------------------------------------------------------------------------------------------------------
// vogl_get_json_value_as_enum
//----------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions src/voglcommon/vogl_gl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ inline bool vogl_is_swap_buffers_entrypoint(gl_entrypoint_id_t id)

bool vogl_is_draw_entrypoint(gl_entrypoint_id_t id);
bool vogl_is_clear_entrypoint(gl_entrypoint_id_t id);
bool vogl_is_start_nested_entrypoint(gl_entrypoint_id_t id);
bool vogl_is_end_nested_entrypoint(gl_entrypoint_id_t id);

//----------------------------------------------------------------------------------------------------------------------
// Error helpers
Expand Down
9 changes: 5 additions & 4 deletions src/vogleditor/vogleditor_qapicalltreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,16 @@ void vogleditor_QApiCallTreeModel::setupModelData(vogl_trace_file_reader* pTrace
// reset the CurFrame so that a new frame node will be created on the next api call
pCurFrame = NULL;
}
else if (entrypoint_id == VOGL_ENTRYPOINT_glBegin)
else if (vogl_is_start_nested_entrypoint(entrypoint_id))
{
// items in the glBegin/glEnd block will be nested, including the glEnd
// Nest logically paired blocks of gl calls including terminating
// nest call
pCurParent = item;
}
else if (entrypoint_id == VOGL_ENTRYPOINT_glEnd)
else if (vogl_is_end_nested_entrypoint(entrypoint_id))
{
// move the parent back one level of the hierarchy, to its own parent
// (but not past Frame parent [e.g., unpaired "glEnd" operation])
// (but not past Frame parent [e.g., unpaired "end" operation])
if (pCurParent->parent() != parent)
pCurParent = pCurParent->parent();
}
Expand Down

0 comments on commit 817685d

Please sign in to comment.