summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-03-25 14:02:49 +0000
committerJosé Fonseca <[email protected]>2009-03-25 21:03:44 +0000
commit710bcc8050848766a85420d0425e51008943fc78 (patch)
tree0827241265e72e2ad38e890ca2b4a21bedd6e23b
parentecfa99ece1743769bbdb4371cf57229481993e91 (diff)
python/retrace: Use the call no when dumping images.
To make it easy associate images with the calls.
-rwxr-xr-xsrc/gallium/state_trackers/python/retrace/interpreter.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py
index 23038c5c1c0..6aaea2d65da 100755
--- a/src/gallium/state_trackers/python/retrace/interpreter.py
+++ b/src/gallium/state_trackers/python/retrace/interpreter.py
@@ -555,7 +555,7 @@ class Interpreter(parser.TraceDumper):
self.objects = {}
self.result = None
self.globl = Global(self, None)
- self.image_no = 0
+ self.call_no = None
def register_object(self, address, object):
self.objects[address] = object
@@ -576,6 +576,8 @@ class Interpreter(parser.TraceDumper):
if (call.klass, call.method) in self.ignore_calls:
return
+ self.call_no = call.no
+
if self.verbosity(1):
parser.TraceDumper.handle_call(self, call)
@@ -593,6 +595,8 @@ class Interpreter(parser.TraceDumper):
if call.ret and isinstance(call.ret, model.Pointer):
self.register_object(call.ret.address, ret)
+ self.call_no = None
+
def interpret_arg(self, node):
translator = Translator(self)
return translator.visit(node)
@@ -602,8 +606,7 @@ class Interpreter(parser.TraceDumper):
def present(self, surface, description):
if self.options.images:
- self.image_no += 1
- filename = '%s_%04u.png' % (description, self.image_no)
+ filename = '%s_%04u.png' % (description, self.call_no)
save_image(filename, surface)
else:
show_image(surface)