diff options
author | José Fonseca <[email protected]> | 2009-02-20 15:23:33 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-02-20 15:23:33 +0000 |
commit | 059d7f3103395917217d376365def36641a51602 (patch) | |
tree | fab890feaf34e7eb16fe25396bdcf08bf73eba75 /src/gallium/state_trackers/python | |
parent | e92f3310fa552b06a17d4f52177fc71e9ad54257 (diff) |
python/interpreter: Don't do unnecessary updates.
Diffstat (limited to 'src/gallium/state_trackers/python')
-rwxr-xr-x | src/gallium/state_trackers/python/retrace/interpreter.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index 72dafab9929..2a75ee82d5d 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -306,6 +306,7 @@ class Context(Object): self.zsbuf = None self.vbufs = [] self.velems = [] + self.dirty = False def destroy(self): pass @@ -509,6 +510,8 @@ class Context(Object): self.dump_vertices(start, count) self.real.draw_arrays(mode, start, count) + + self.dirty = True def draw_elements(self, indexBuffer, indexSize, mode, start, count): if verbose >= 2: @@ -516,6 +519,8 @@ class Context(Object): self.dump_vertices(minindex, maxindex - minindex) self.real.draw_elements(indexBuffer, indexSize, mode, start, count) + + self.dirty = True def draw_range_elements(self, indexBuffer, indexSize, minIndex, maxIndex, mode, start, count): if verbose >= 2: @@ -525,11 +530,15 @@ class Context(Object): self.dump_vertices(minindex, maxindex - minindex) self.real.draw_range_elements(indexBuffer, indexSize, minIndex, maxIndex, mode, start, count) + + self.dirty = True def flush(self, flags): self.real.flush(flags) - if flags & gallium.PIPE_FLUSH_FRAME: - self._update() + if self.dirty: + if flags & gallium.PIPE_FLUSH_FRAME: + self._update() + self.dirty = False return None def clear(self, surface, value): |