summaryrefslogtreecommitdiff
path: root/retrace/glretrace_main.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-06-19Clean up static maps after retrace.Mark Janes1-0/+2
retrace has a cleanup() routine which can be called to free resources after a retrace. However, it fails to free resources which are allocated in several static global data structures. Due to this shortcoming, a trace file cannot be traced twice in a single process. This directly affects gtests which need to execute a minimal trace file and check the results.
2017-03-21glretrace: Initialize MetricWriter only when needed.Alexander Trukhin1-9/+10
This object is only needed for profiling. Global initialization is unnecessary and it creates temporary file (with mmap_allocator.hpp), which can be avoided.
2017-03-13retrace: support for dumping multiple snapshots (v3)Rob Clark1-2/+10
Usually if an app is using MRT, we want to dump (and diff) *all* the render targets to track down where things are going wrong. Also dumps depth and stencil buffers. When the --mrt (or -m) argument is specified, all render targets plus depth and/or stencil are dumped, with the suffix -mrtN/-z/-s. Otherwise the behavior is as before, only mrt0 is dumped with no suffix. Only implemented for GLDumper, since I don't know anything about D3D.
2017-01-23glretrace: Try to enable automatic GPU switching on macOS.Jose Fonseca1-0/+5
Minimal testing.
2016-05-04glretrace: Cache current program/pipeline objects.Jose Fonseca1-2/+2
We were already using cached program on call lists. This changes generalizes to outside call lists and pipelines. This avoids glGetInteger calls on traces with lots of glUniform calls.
2016-04-14glretrace: Ensure sync commands are flushed before switching thread.Jose Fonseca1-0/+4
Thanks to Steinar Gunderson for catching this. https://github.com/apitrace/apitrace/issues/446#issuecomment-209673877
2016-04-09glretrace: Limit debug markers length to MAX_DEBUG_MESSAGE_LENGTH - 1.Jose Fonseca1-4/+4
Fixes https://github.com/apitrace/apitrace/issues/443
2016-04-04helpers: rename glprofile to glfeatures.Jose Fonseca1-6/+6
This module will have more than just description of OpenGL profiles, but actual features.
2016-03-05retrace: clang-modernize.Jose Fonseca1-5/+5
2016-01-23common: Introduce DUMP_FLAG_NO_MULTILINE.Jose Fonseca1-10/+5
To avoid the need of stripping newlines.
2016-01-23glretrace: Include call params in the marker.Jose Fonseca1-5/+22
2016-01-23glretrace: Use a ostringstream instead of asprintf.Jose Fonseca1-13/+14
As the latter is not portable.
2016-01-22glretrace: Use an unique ID for apitrace call no markers.Jose Fonseca1-2/+6
So that apitrace (and maybe the drivers) can distinguish these messages from others.
2016-01-22glretrace: Add an option to insert markers.Jose Fonseca1-1/+4
2016-01-22glretrace: Invoke glDebugMessageInsertKHR for ES contexts.Jose Fonseca1-5/+11
2016-01-22glretrace: Don't insert markers inside glBegin/End.Jose Fonseca1-0/+1
KHR_debug spec is not clear, but at leat Mesa doesn't seem to like it.
2016-01-22glretrace: Move call no markers away from dumper interface.Jose Fonseca1-17/+21
Dumper is only for dumping state to JSON.
2016-01-22glretrace: use KHR_debug to emit call no's.Rob Clark1-0/+18
If the extension is present, use it to log call numbers for draw commands, using GL_DEBUG_TYPE_MARKER. If supported by the driver, this embeds the draw call no's in the commandstream. Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-01-11Merge branch 'metric_abstraction'Jose Fonseca1-1/+165
2015-10-29glretrace: Limit the maximum number of glGetError warnings.Jose Fonseca1-43/+54
Just like we do for KHR_debug messages.
2015-08-26Add support for handling context switches in Metrics abstraction.Alexander Trukhin1-49/+72
In OpenGL, a context switch is executed by calling MakeCurrent. Two new functions in the MetricBackend interface: void pausePass() void continuePass() In glretrace these calls are added to MakeCurrent invocation. The pausePass() function should be called before the context switch while the continuePass() one should be called after. pausePass() ends all current queries, prepares for context switch. continuePass() is called in a new context, makes everything needed for profiling continuation (checks backends support, setups queries etc.) With this commit backends gain only basic support for context switches. Somewhere checks are missing, somewhere it should be made more clear what to do with interrupted queries.
2015-08-26retrace,glretrace: Option for getting profiling passes number.Alexander Trukhin1-0/+4
The option is "--gen-passes". For using with new "--pframes", "--pcalls", "--pdrawcalls".
2015-08-26retrace,glretrace: Option for metrics listing.Alexander Trukhin1-0/+5
The option is "--list-metrics". It outputs metrics and metric groups for each plugged backend. It also requires the trace file to be specified, as some backends can query metrics only after context is created. They can also possibly depend on the context version. Trace file is only replayed until the context is created.
2015-08-26retrace,glretrace: Add calls to output new metrics data.Alexander Trukhin1-0/+54
Make use of MetricWriter in glretrace to output new metrics in the last pass. Last pass is determined via method isLastPass() in glretrace. 3 tabular outputs are returned for each profiling option in the following order: 1) for frames 2) for calls 3) for draw calls
2015-08-26retrace,glretrace: Profiling options. Hook up the abstraction.Alexander Trukhin1-1/+79
New options: "glretrace --pframes=SELECTION_STRING", "glretrace --pdrawcalls=SELECTION_STRING", "glretrace --pcalls=SELECTION_STRING". Each option is for profiling corresponding boundary (frames, draw calls or all calls). Profiling is done with the backends in glretrace::metricBackends and metrics selected in them (via enableMetric() backend interface call). Selection strings are parsed in enableMetricsFromCLI(). Backends are used in series. For each backend required number of passes is evaluated. It does not work with old profiling options. Format for SELECTION_STRING: --pdrawcalls="backend1:metric1,metric2,metric3;backend2:metric1,metric2" Where metric1 is either [groupId, metricId] or metricName Example: --pframes="GL_AMD_performance_monitor: [0,4], [1,5], VS_INVOCATION_COUNT; GL_INTEL_performance_query: [1,2]"
2015-08-25glretrace: Use the returned context version when checking for occlusion query.Jose Fonseca1-4/+4
Instead of using the requested context version. This fixes occlusion query detection with all traces recorded on Windows, as wglCreateContext doesn't provide way to specify context version and can't be avoided. Fixes https://github.com/apitrace/apitrace/issues/358#issuecomment-131519038
2015-08-06glretrace: Track insideList and insideBeginEnd per-context.Jose Fonseca1-4/+2
2015-06-27glretrace: Remove dead variable.Jose Fonseca1-2/+1
2015-06-27glretrace: Use KHR_debug where available.Jose Fonseca1-6/+18
2015-06-27glretrace,glws: Move profile check into glws module.Jose Fonseca1-22/+1
2015-06-25glretrace: Workaround unusable GL_TIMESTAMP on Mac.Jose Fonseca1-0/+6
Fixes #359.
2015-06-25glretrace: Improve GL_ARB_timer_query support detection.Jose Fonseca1-1/+2
Was part of core in GL_ARB_timer_query.
2015-06-25glretrace: Fix occlusion query support detection.Jose Fonseca1-1/+1
GL_ARB_occlusion_query was made part of core OpenGL 1.5. Furthermore we don't use the *ARB entry-points, so we really rely on the core support. Futhermore, on Mac OS, core 3.2+ profiles do not list core extensions, so we were wrongly assuming it was missing. Fixes #358.
2015-05-01retrace: Put JSON writer behind an ABC.Jose Fonseca1-3/+6
So that we can later dump state in formats other than JSON.
2015-04-21glretrace: Fix GL_ARB_ES*_compatibility profile matching.Jose Fonseca1-3/+3
Had forgotten GL_ prefix in extension name.
2015-01-26glretrace: Cleanup debugOutputCallback.Jose Fonseca1-16/+18
2015-01-06glretrace: Don't warn about drawable size inference for pbuffers.José Fonseca1-2/+5
As these typically have size specified in the creation call. See in trace referred in issue #306.
2015-01-06glretrace: Drop deprecated glws::ProfileJosé Fonseca1-2/+2
2015-01-05glretrace: Just warn when context doesn't match but ARB_ES2/3_compatibility ↵José Fonseca1-3/+14
is supported.
2015-01-05glretrace: Ensure we get a matching context.José Fonseca1-1/+15
2015-01-05glretrace: Promote Profile from enum to full-fledged object.José Fonseca1-2/+2
2014-12-18glstate: Be more selective when disabling debug messages.José Fonseca1-10/+0
As these are quite useful to diagnose problems in glstate module itself.
2014-12-18glretrace: Silence glGetSynciv(GL_CONDITION_SATISFIED) bogus warnings.José Fonseca1-1/+5
2014-12-12glretrace: Handle GL_ARB_sync properly.José Fonseca1-0/+43
When replaying, glretrace must wait for all fences that were recorded as signalled in the trace, as subsequent calls might depend upon it.
2014-12-04glretrace: Make the "too many messages" warning look like the previous message.José Fonseca1-7/+10
So that it's obvious which message is being ignored.
2014-06-06glretrace: Don't call glDebugMessageControlARB unless it is supported.José Fonseca1-4/+8
2014-05-28glretrace: Add color to debugOutputCallback messages.José Fonseca1-3/+15
Message volume is often too much -- need some way to make important messages stand out.
2014-05-23glretrace: Ignore application messages while dumping state.José Fonseca1-1/+8
2014-05-15glretrace: Limit duplicate messages.José Fonseca1-9/+22
Of any kind, and not just
2014-05-15glretrace: Don't write double newline unless message doesn't terminate with one.José Fonseca1-1/+9