gui: Fix crash on trigger actions without loaded trace-file.
gui/apitrace: findFrameStart(), findFrameEnd(): Do nothing, when passed frame is null-pointer.
Add accelerator (F) to Edit->Find.
Add accelerator (N) and shortcut (Ctrl+N) to File->New.
Rename "File->New" to "File->New..." to indicate, that dialog will be showed.
Carl Worth [Thu, 15 Nov 2012 18:51:01 +0000 (10:51 -0800)]
glretrace: Use GL_TIMESTAMP (if available) for CPU profiling.
The prior scheme of trying to continuously re-synchronize separate CPU
and GPU counters is doomed to always be unreliable. Instead, simply prefer
to use the GL_TIMESTAMP values for both GPU and for CPU profiling.
Carl Worth [Sun, 12 Aug 2012 23:49:09 +0000 (16:49 -0700)]
glretrace, dump-images: Accept --call-nos=no to get snapshots with call numbers
It is sometimes inconvenient to have call numbers encoded within the
snapshot filenames. For example, when doing tests of "apitrace trim"
in the test suite the call numbers frequently change even when the
image contents do not.
By accepting the --call-nos=no option, these programs will now
generate filenames with sequential numbers starting from 0 rather than
using call numbers in the filenames.
D3D8 and D3D9 have different definitions of the D3DPRESENT_PARAMETERS.
This happens with other types, so the only solution is to stop using
templates here.
Carl Worth [Wed, 29 Aug 2012 21:38:39 +0000 (14:38 -0700)]
trim: Avoid trimming textures when referenced by a framebuffer object
We aren't yet tracking FBOs as their own resource, but we do need to
notice when any texture is referenced by an FBO so that we don't omit
it while trimming. So, notice any textrure referenced by
glFramebufferTexture2D and make the render state depend on this
texture.
Carl Worth [Thu, 16 Aug 2012 18:33:45 +0000 (11:33 -0700)]
trim: Never trim any glBindTexture calls.
This shouldn't be necessary. I've got a case where trimming out the
glBindTexture of an unused texture changes the behavoir, which
shouldn't be the case.
While I'll still try to track down that bug, this patch provides
conservative behavior that hopefully won't break anything. (The only
real downside is the potential of an implementation getting confused
by a glBindTexture with a value that was not returned by
glGenTextures).
Carl Worth [Fri, 17 Aug 2012 03:32:32 +0000 (20:32 -0700)]
trim: Never trim any textures bound within a display list.
This is conservative. The more efficient approach would create a
resource link from the display list to the texture, but that will wait
for when we actually have display-list resources.
Carl Worth [Fri, 17 Aug 2012 01:29:43 +0000 (18:29 -0700)]
trim: Add support for display lists.
The calls specified between glNewList and glEndList need to have
special treatment. For now we do the simplest thing and
unconditionally include all such calls in the trim output.
Eventually we will want to track display-list resources similar to
textures and trim away unused display lists.
Carl Worth [Fri, 17 Aug 2012 15:09:19 +0000 (08:09 -0700)]
trim: Conservatively make shader programs depend on textures
Some shader programs sample textures, so if the shader is included in
the trimmed output the texture needs to be included as well.
We don't have support inside of "apitrace trim" to parse GLSL to find
names of samplers to find these dependencies. Instead, we provide here
a simple heuristic:
In order to sample a texture, the OpenGL program must associate the
name of a texture unit with a location in the shader by calling
glUniform1i (or glUniform1iv). So we can notice whenever texture-unit
names are being passed and create a dependency from the shader to all
texture targets for that unit.
This is conservative on two fronts:
1. The value being passed to glUniformi might only be coincidentally
the same as a texture-unit name and be actually unrelated to
texture sampling.
2. The shader likely doesn't depend on all texture targets, but
again we can't know which without looking inside the shader, so
we associate all of them.
Carl Worth [Fri, 17 Aug 2012 15:06:51 +0000 (08:06 -0700)]
trim: Perform correct state tracking for glActiveTexture
Not all glBindTexture calls are created equal. With calls to
glActiveTexture intervening, calls to glBindTexture are actually
operating on indenpendent texture units.
It's actually quite easy to simple insert the number of the currently
active texture unit into the name of the texture target resource.
Carl Worth [Wed, 15 Aug 2012 23:35:38 +0000 (16:35 -0700)]
trim: Add a new --print-callset option.
This is useful whenever one has a need to manually tweak the trim operation.
Simply run:
apitrace trim --print-callset --frames=<whatever> --calls=<whatever>
as desired. Then take the resulting callset that is printed and run:
apitrace trim --calls=<callset> --exact
This should yield an identical trimming operation. Then this operation
can be tweaked by appending call ranges to the --calls option,
deleting rangess from the --calls option, or by appending a new
--frames option.
Carl Worth [Wed, 15 Aug 2012 05:32:29 +0000 (22:32 -0700)]
trim: Add a --frames option for selecting frames to trim.
This accepts a "frame set" which has syntax identical to the "call
set" of the existing --calls option. So, one could trim to just the
drawing operations of the first 10 frames of a trace with
--frames=0-9/draw.