diff --git a/data/scripts/rendertime.py b/data/scripts/rendertime.py new file mode 100644 index 00000000..46f7012d --- /dev/null +++ b/data/scripts/rendertime.py @@ -0,0 +1,37 @@ +import subprocess, sys, re + +if len(sys.argv) == 1: + print('rendertime.py: Simple utility to extract the rendering time of an EXR file created using Mitsuba') + print('Syntax: rendertime.py ') + +for arg in sys.argv[1:]: + sys.stdout.write("%s: " % arg) + + p = subprocess.Popen(["exrheader", arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + matches = re.findall('Render time: ([^\n]*)', p.communicate()[0]) + if len(matches) != 1: + sys.stdout.write('error reading metadata!\n') + continue + + value = matches[0] + + units = [ + ['d', 60*60*24], + ['h', 60*60], + ['m', 60], + ['s', 1] + ]; + + for unit in units: + if value[-1] == unit[0]: + value = float(value[0:-1]) * unit[1] + break + + force = False + for unit in units: + if value > unit[1] or force: + amount = int(value / unit[1]) + value -= amount * unit[1] + force = True + sys.stdout.write('%i%s ' % (amount, unit[0])) + sys.stdout.write('\n') diff --git a/include/mitsuba/render/gkdtree.h b/include/mitsuba/render/gkdtree.h index 416caedb..53129d66 100644 --- a/include/mitsuba/render/gkdtree.h +++ b/include/mitsuba/render/gkdtree.h @@ -30,7 +30,7 @@ #endif /// Activate lots of extra checks -// #define MTS_KD_DEBUG 1 +#define MTS_KD_DEBUG 1 /** Compile-time KD-tree depth limit. Allows to put certain data structures on the stack */ @@ -2449,9 +2449,9 @@ protected: for (SizeType i=0; igetAABB(indices[i]); for (int axis=0; axis