From 71504c770086797ef8cf0a57f89565ec3e574ee3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 8 Apr 2009 21:13:57 +0100 Subject: [PATCH] python/retrace: Try to cope with failures creating textures. --- .../state_trackers/python/retrace/interpreter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.30.2