James Benton [Thu, 9 Aug 2012 13:23:44 +0000 (14:23 +0100)]
Create glretrace specific context.
This allows us to store per context variables whilst retracing.
Altered the various glretrace window system implementations to use this new context.
Updated the "activeProgram" tracking for profiling to use this.
Huang Dongsung [Sat, 23 Jun 2012 07:03:26 +0000 (16:03 +0900)]
Recreate egl surface when glViewport for watching framebuffer in qapitrace's surface tab.
It is quirk of mesa egl 1.4 with Nvidia-dri. It is ok with intel-dri.
After resizing XWindow, mesa egl does not know new size of the surface.
If you call eglQuerySurface(currentDisplay, currentSurface, EGL_WIDTH, width),
width is the width at the time to create the egl surface, not current width.
However, glx can know what the size of window well.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Carl Worth [Mon, 30 Jul 2012 22:01:15 +0000 (15:01 -0700)]
Avoid inserting 'inf' and friends into the json output.
The JSON-generating code was previously carefult to avoid emitting NaN
into its output, but it would still write "inf" for an infinite value,
(which is invalid JSON).
Fix by calling writeNull for any value for which std::isfinite returns
false, (rather than the previous test for merely (n != n)).
James Benton [Thu, 2 Aug 2012 10:37:44 +0000 (11:37 +0100)]
Removed arbitary limit on active queries.
This previously existed due to a suspected limit on queries on nvidia drivers,
however that bug was actually due to context switching which has now been fixed.
Imre Deak [Mon, 4 Jun 2012 11:14:24 +0000 (14:14 +0300)]
egl: EGL image trace support
Getting the dimension / format of EGL images is not straitghforward.
One way to get these would be through glGetTexLevelParameter, but it's
not supported by GLES. Another way is to attach the EGL image to a
renderbuffer and call glGetRenderbufferParameter on it, but at least
mesa doesn't support attaching images in RGBA_REV format. And that
format happens to be an important one in applications we care about
(like the Android browser). We could also check the parameters of the
underlying native buffer, but these are not exposed through any API (for
either Xpixmaps or Android native buffers)
So the only way I found is to try a non-destructive glCopyTexSubImage2D
with sizes starting from GL_MAX_TEXTURE_SIZE down to 1 and determine the
correct size based on whether this returns an error or not.
James Benton [Wed, 25 Jul 2012 12:48:20 +0000 (13:48 +0100)]
Improved profiling capabilities.
Logs which shader is active to allow per shader profiling.
Merged cpu profiling code from retrace to trace_profiler.
Allow choice of profiling for gpu / cpu / pixels drawn.
Imre Deak [Fri, 30 Mar 2012 12:46:26 +0000 (15:46 +0300)]
Android: add support for dynamically enable/disable tracing
To trace applications started by the Dalvik VM we have to wrap the main
Dalvik process zygote (or app_process) which is started at boot time and
never stopped afterwards. We would still want to restrict tracing to a
single process which will be forked by zygote.
To achieve this we'll use the fact that the forked process image is
contained in the same file as zygote, pointed to by /proc/self/exe. So
if this is 'app_process' we know it's a zygote process. To distinguish
between zygote processes we'll check /proc/self/cmdline which will in
turn be set to a unique application specific string (for example
com.android.settings). The user has to set the debug.apitrace.procname
to this string in order to enable tracing.
For non-zygote processes tracing will be always enabled.
Editing shaders was broken because we were adding extra values to
the arguments array. This fixes it, meaning that if you right click
on glShaderSource you can edit the shader source and the rest of the
trace will properly catch the changes. An incredibly useful feature.
Carl Worth [Mon, 4 Jun 2012 21:47:33 +0000 (14:47 -0700)]
Avoid walking off array if given a negative value for array size.
Obviously, a negative size is bogus, but we want apitrace to be robust
enough to capture even bogus usage of the API, (so that the user can
investigate and fix the bogosity in the application).
In this case, if the user specifies a negative size for an array,
simply don't write anything out for the array content.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Imre Deak [Mon, 7 May 2012 06:10:26 +0000 (09:10 +0300)]
mt trace: add helper to track GL contexts on a per-thread basis
This is needed for muti-threaded tracing to work properly.
Tracing multi-threaded GL apps requires that we track the lifetime of
the GL context objects and store thread specific state like the currently
active GL context on thread-local memory area.
Also add 'retain_count' to the context needed by the CGL retain/release
context calls.
Imre Deak [Thu, 3 May 2012 14:33:13 +0000 (17:33 +0300)]
mt trace: create gltrace_state.cpp, move getContext into it
There is no need to keep this function in a python script and the
following patches will extend the functionality around this code, so
move the function to a .cpp file.
Gregory Hainaut [Fri, 11 May 2012 13:49:10 +0000 (14:49 +0100)]
Try active shader program before current program.
With separate shader program, one can't query anymore current program
with glGetIntegerv(GL_CURRENT_PROGRAM, &program), so glUniform* fails to
store the correct location during retracing.
Technically glActiveShaderProgram must be used to set the active program
for Uniform. But on my system (AMD) it works without it, I don't know if
it is valid or not.
This change uses the active shader (would be 0 if the users don't call
glActiveShaderProgram) instead of current program (0 in pipeline mode)
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>