From db38c3b4ba1f9a452b7d16969cd2d3fac46aa45b Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Thu, 24 May 2018 16:51:38 +0100 Subject: trace: Fix parsing of recent traces. Reviewed-by: Roland Scheidegger --- src/gallium/tools/trace/dump_state.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'src/gallium/tools/trace/dump_state.py') diff --git a/src/gallium/tools/trace/dump_state.py b/src/gallium/tools/trace/dump_state.py index 4531843279e..2622d130bf8 100755 --- a/src/gallium/tools/trace/dump_state.py +++ b/src/gallium/tools/trace/dump_state.py @@ -137,6 +137,7 @@ class Translator(model.Visitor): def visit_struct(self, node): struct = Struct() for member_name, member_node in node.members: + member_name = member_name.replace('.', '_') member_value = self.visit(member_node) setattr(struct, member_name, member_value) self.result = struct @@ -185,7 +186,7 @@ class Screen(Dispatcher): def destroy(self): pass - def context_create(self): + def context_create(self, priv=None, flags=0): return Context(self.interpreter) def is_format_supported(self, format, target, sample_count, bind, geom_flags): @@ -498,10 +499,11 @@ class Context(Dispatcher): vertex = [] for velem in self._state.vertex_elements: vbuf = self._state.vertex_buffers[velem.vertex_buffer_index] - if vbuf.buffer is None: + resource = vbuf.buffer_resource + if resource is None: continue - data = vbuf.buffer.data + data = resource.data offset = vbuf.buffer_offset + velem.src_offset + vbuf.stride*index format = { @@ -523,7 +525,7 @@ class Context(Dispatcher): 'PIPE_FORMAT_R16G16B16_SNORM': '3h', }[velem.src_format] - data = vbuf.buffer.data + data = resource.data attribute = unpack_from(format, data, offset) vertex.append(attribute) @@ -551,7 +553,7 @@ class Context(Dispatcher): self._state.draw = info - if info.indexed: + if info.index_size != 0: min_index, max_index = self._merge_indices(info) else: min_index = info.start @@ -637,6 +639,25 @@ class Context(Dispatcher): def tex_transfer_destroy(self, transfer): self.interpreter.unregister_object(transfer) + def buffer_subdata(self, resource, usage, data, box=None, offset=None, size=None, level=None, stride=None, layer_stride=None): + if box is not None: + # XXX trace_context_transfer_unmap generates brokens buffer_subdata + assert offset is None + assert size is None + assert level == 0 + offset = box.x + size = box.width + box = None + + if resource is not None and resource.target == PIPE_BUFFER: + data = data.getValue() + assert len(data) >= size + assert offset + size <= len(resource.data) + resource.data[offset : offset + size] = data[:size] + + def texture_subdata(self, resource, level, usage, box, data, stride, layer_stride): + pass + def transfer_inline_write(self, resource, level, usage, box, stride, layer_stride, data): if resource is not None and resource.target == PIPE_BUFFER: data = data.getValue() -- cgit v1.2.3