summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-04-08 21:13:57 +0100
committerJosé Fonseca <[email protected]>2009-04-08 21:41:04 +0100
commit71504c770086797ef8cf0a57f89565ec3e574ee3 (patch)
tree8fcd8476bf938ea6ea2e7279285811fdc4dadab6 /src
parentc89eba0f31623084bc754de724384c80a3e57c91 (diff)
python/retrace: Try to cope with failures creating textures.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gallium/state_trackers/python/retrace/interpreter.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py
index 0f1c56075af..5ea07724a50 100755
--- a/src/gallium/state_trackers/python/retrace/interpreter.py
+++ b/src/gallium/state_trackers/python/retrace/interpreter.py
@@ -286,6 +286,8 @@ class Screen(Object):
pass
def get_tex_surface(self, texture, face, level, zslice, usage):
+ if texture is None:
+ return None
return texture.get_surface(face, level, zslice)
def tex_surface_destroy(self, surface):
@@ -295,16 +297,22 @@ class Screen(Object):
pass
def surface_write(self, surface, data, stride, size):
+ if surface is None:
+ return
assert surface.nblocksy * stride == size
surface.put_tile_raw(0, 0, surface.width, surface.height, data, stride)
def get_tex_transfer(self, texture, face, level, zslice, usage, x, y, w, h):
+ if texture is None:
+ return None
return Transfer(texture.get_surface(face, level, zslice), x, y, w, h)
def tex_transfer_destroy(self, transfer):
self.interpreter.unregister_object(transfer)
def transfer_write(self, transfer, stride, data, size):
+ if transfer is None:
+ return
transfer.surface.put_tile_raw(transfer.x, transfer.y, transfer.w, transfer.h, data, stride)
def user_buffer_create(self, data, size):
@@ -650,6 +658,8 @@ class Interpreter(parser.TraceDumper):
ret = method(**dict(args))
if call.ret and isinstance(call.ret, model.Pointer):
+ if ret is None:
+ sys.stderr.write('warning: NULL returned\n')
self.register_object(call.ret.address, ret)
self.call_no = None