Bug 1729445 - Don't batch texture uploads for large-ish items. r=jnicol

In other words, don't batch items if we don't expect to be able to fit other items in the staging texture. The batched upload path has a cost on Windows (an extra copy) that is easily recovered when batching a lot of small items (typically works very well with glyphs), but we get diminishing returns and even slowdowns for larger items.

Differential Revision: https://phabricator.services.mozilla.com/D124791
This commit is contained in:
Nicolas Silva 2021-09-08 12:41:51 +00:00
Родитель 0afcd4879b
Коммит 9a1997f275
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -134,7 +134,8 @@ pub fn upload_to_texture_cache(
let use_batch_upload = renderer.device.use_batched_texture_uploads() &&
texture.flags().contains(TextureFlags::IS_SHARED_TEXTURE_CACHE) &&
rect.width() <= BATCH_UPLOAD_TEXTURE_SIZE.width &&
rect.height() <= BATCH_UPLOAD_TEXTURE_SIZE.height;
rect.height() <= BATCH_UPLOAD_TEXTURE_SIZE.height &&
rect.area() <= BATCH_UPLOAD_TEXTURE_SIZE.area() / 2;
if use_batch_upload {
copy_into_staging_buffer(