return NULL;
}
- /* Match old screen->buffer_map_range() behaviour, return pointer
- * to where the beginning of the buffer would be:
- */
- return (void *)((char *)map - offset);
+ return map;
}
&src_transfer);
if (map)
- memcpy(data, map + offset, size);
+ memcpy(data, map, size);
pipe_buffer_unmap(pipe, src_transfer);
}
*ptr = NULL;
return PIPE_ERROR_OUT_OF_MEMORY;
}
+
+ upload->map -= offset;
}
assert(offset < upload->buffer->width0);
ret = u_upload_data( upload,
min_out_offset,
size,
- map + offset,
+ map,
out_offset,
outbuf, flushed );
util_format_get_blocksize(vel->src_format),
PIPE_TRANSFER_READ,
&transfer);
+ mapped_buffer = (uint8_t*)mapped_buffer - vel->src_offset;
translate->set_buffer(translate, vel->vertex_buffer_index,
mapped_buffer,
offset, length,
flags,
&st_obj->transfer);
- if (obj->Pointer) {
- obj->Pointer = (ubyte *) obj->Pointer + offset;
- }
-
if (obj->Pointer) {
obj->Offset = offset;
obj->Length = length;
start * ibuffer->index_size, /* start */
count * ibuffer->index_size, /* length */
PIPE_TRANSFER_READ, &transfer);
+ if (!ptr)
+ return;
+
+ ptr = (uint8_t*)ptr + (ibuffer->offset - start * ibuffer->index_size);
}
else {
ptr = ib->ptr;
+ if (!ptr)
+ return;
}
- if (!ptr)
- return;
-
- ptr = ADD_POINTERS(ptr, ibuffer->offset);
-
sub_prims = find_sub_primitives(ptr, ibuffer->index_size,
0, count, orig_info->restart_index,
&num_sub_prims);