#include <string.h>
+#include "os_binary.hpp"
#include "os_string.hpp"
#include "os_time.hpp"
#include "image.hpp"
bool double_buffer = true;
bool insideGlBeginEnd = false;
-trace::Parser parser;
glws::Profile defaultProfile = glws::PROFILE_COMPAT;
glws::Visual *visual[glws::PROFILE_MAX];
glws::Drawable *drawable = NULL;
startTime = os::getTime();
trace::Call *call;
- while ((call = parser.parse_call())) {
+ while ((call = retrace::parser.parse_call())) {
bool swapRenderTarget = call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET;
bool doSnapshot =
snapshot_frequency.contains(*call) ||
long long endTime = os::getTime();
float timeInterval = (endTime - startTime) * (1.0 / os::timeFrequency);
- if (retrace::verbosity >= -1) {
+ if ((retrace::verbosity >= -1) || (retrace::profiling)) {
std::cout <<
"Rendered " << frame << " frames"
" in " << timeInterval << " secs,"
"Replay TRACE.\n"
"\n"
" -b benchmark mode (no error checking or warning messages)\n"
+ " -p profiling mode (run whole trace, dump profiling info)\n"
" -c PREFIX compare against snapshots\n"
" -C CALLSET calls to compare (default is every frame)\n"
" -core use core profile\n"
benchmark = true;
retrace::verbosity = -1;
glws::debug = false;
+ } else if (!strcmp(arg, "-p")) {
+ retrace::profiling = true;
+ retrace::verbosity = -1;
+ glws::debug = false;
} else if (!strcmp(arg, "-c")) {
compare_prefix = argv[++i];
if (compare_frequency.empty()) {
snapshot_frequency = trace::CallSet(trace::FREQUENCY_FRAME);
}
if (snapshot_prefix[0] == '-' && snapshot_prefix[1] == 0) {
+ os::setBinaryMode(stdout);
retrace::verbosity = -2;
}
} else if (!strcmp(arg, "-S")) {
visual[glws::PROFILE_ES2] = glws::createVisual(double_buffer, glws::PROFILE_ES2);
for ( ; i < argc; ++i) {
- if (!parser.open(argv[i])) {
+ if (!retrace::parser.open(argv[i])) {
std::cerr << "error: failed to open " << argv[i] << "\n";
return 1;
}
display();
- parser.close();
+ retrace::parser.close();
}
for (int n = 0; n < glws::PROFILE_MAX; n++) {