[PATCH 0/3][RFC] Support for single frame capture
José Fonseca
jose.r.fonseca at gmail.com
Wed Mar 11 14:12:52 PDT 2015
This seems to be along the lines of
https://github.com/PeterLValve/apitrace/tree/start-stop-trace2
which sort of was a prototype for VOGL.
But it looks like VOGL is loosing steam [1], and instead their efforts are
being focused on Vulkan/Glave. I believe they got to a point where certain
class of GL apps would work, but getting this to work with all apps easily
becomes an herculian effort, no matter how many resources are put behind it.
With the VOGL experience I'm now convinced: the approach of trace
start/stop by dumping state on start (ie, start-stop-trace2/VOGL) can only
work with "concise" APIs like Direct3D (as proven by
PIX/VisualStudioGraphicsDebugger/RenderDoc) or Vulkan (as proved with
Glave), but it is unfeasible with OpenGL since it is _huge_, full of legacy
state, not well defined capability/feature levels, and a lot of state can't
be fetched with glGet* calls.
I know `apitrace trim` has issues, but I'm now convinced that the only way
we can ever have _robust_ single frame capture is indeed to record the
whole thing from start, annotate the trace when the hot-key is pressed,
then trim offline everything that's unnecessary for the desired frame.
The advantages of this is that:
- whereas with serializing current state any bug in the current state
serialization will yield a buggy trace, which needs to be retraced;
off-line triming preserves all information, so we can fix apitrace trimming
without needing to get another trace from the app
- serializing current state will also serialize bugs in dynamically
generated textures. For example, if a game generates textures at
initialization time, and there's a bug (in the app or openlg
implementation) at that time, if you just serialize that texture at the
begingging of that frame you will not capture the calls that actually
generated the error. Whereas with trimming all information should be
preserved.
Unfortunately I don't have much time to improve trimming (in fact I believe
we need a big refactor/rewrite so that it operates with a single pass.) but
in my mind that's the only way forward.
Jose
[1] https://twitter.com/g_truc/status/536988569597140993
On Mon, Mar 2, 2015 at 12:13 PM, Juha-Pekka Heikkila <
juhapekka.heikkila at gmail.com> wrote:
> This is a bit rfc'y set of what I've been toying with recently, for
> commenting
> round for now. Idea for single frame capture is coming from people claiming
> trimming of traces not working or being too slow.
>
> What this set does is allow glxtrace.so run in the background but not
> necessarily writing everything into trace file. Setting environment
> variable
> APITRACE_SINGLE_FRAME_CAPTURE_MODE to 1 causes alternative tracing mode to
> be active. Once number is written to /tmp/apitrace_capture_frame_now.txt
> glxtrace.so wakes up to writing everything into trace file, number written
> into the file indicate how many following frames will be recorded. What I
> am
> currently poking at to make better is gl state rebuilding code which can be
> seen at end of glxtrace.py. Currently glxgears works for me when enable
> tracing from the middle of glxgears execution.
>
> Anyhow, if someone see something funny, weird or just plain wrong I'll be
> happy
> to see the comments. Implementation for enable/disable writing of trace
> file
> in trace writer class is a bit hackish' but it was least amount of changes
> I
> thought of thus its the way it is. I had only glx in mind for now with
> highlighting places for changes needed for egl and adroid later.
>
> Simple steps to try this out would go as:
>
> APITRACE_SINGLE_FRAME_CAPTURE_MODE=1 LD_PRELOAD=./glxtrace.so glxgears &
> echo 3 > /tmp/apitrace_capture_frame_now.txt
>
> After closing glxgears one should see three frames written into
> glxgears.trace file.
>
> /Juha-Pekka
>
> Juha-Pekka Heikkila (3):
> Support single frame capture with glx
> Add support for display lists for single frame capture
> Add gl state rebuilding code for single frame capture
>
> common/trace_writer.cpp | 29 ++++++---
> common/trace_writer.hpp | 14 +++++
> common/trace_writer_local.cpp | 138
> ++++++++++++++++++++++++++++++++++++++++--
> common/trace_writer_local.hpp | 10 +++
> wrappers/egltrace.py | 8 +++
> wrappers/glxtrace.py | 124 +++++++++++++++++++++++++++++++++++++
> 6 files changed, 312 insertions(+), 11 deletions(-)
>
> --
> 1.8.5.1
>
> _______________________________________________
> apitrace mailing list
> apitrace at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/apitrace
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20150311/7875dac1/attachment.html>
More information about the apitrace
mailing list