yagl_range_list_add(&buffer->default_part.range_list, 0, buffer->size);
yagl_range_list_add(&buffer->fixed_part.range_list, 0, buffer->size);
yagl_range_list_add(&buffer->byte_part.range_list, 0, buffer->size);
+
+ buffer->cached_minmax_idx = false;
}
bool yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
yagl_range_list_add(&buffer->fixed_part.range_list, offset, size);
yagl_range_list_add(&buffer->byte_part.range_list, offset, size);
+ buffer->cached_minmax_idx = false;
+
return true;
}
return false;
}
+ if (buffer->cached_minmax_idx &&
+ (buffer->cached_type == type) &&
+ (buffer->cached_offset == offset) &&
+ (buffer->cached_count == count)) {
+ *min_idx = buffer->cached_min_idx;
+ *max_idx = buffer->cached_max_idx;
+ return true;
+ }
+
for (i = 0; i < count; ++i) {
/*
* We don't respect target endian here, but we don't care for now,
}
}
+ buffer->cached_minmax_idx = true;
+ buffer->cached_type = type;
+ buffer->cached_offset = offset;
+ buffer->cached_count = count;
+ buffer->cached_min_idx = *min_idx;
+ buffer->cached_max_idx = *max_idx;
+
return true;
}