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
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):
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 = {
'PIPE_FORMAT_R16G16B16_SNORM': '3h',
}[velem.src_format]
- data = vbuf.buffer.data
+ data = resource.data
attribute = unpack_from(format, data, offset)
vertex.append(attribute)
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
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()