summaryrefslogtreecommitdiffstats
path: root/gfx/wr/webrender/src/renderer
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 18:35:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 18:35:44 +0000
commitc0db95d3dda1865d4c6bf0666b0e7439b40b9bf2 (patch)
tree74359a4b4954f9380cb0fb23b59f0c53d9355f5d /gfx/wr/webrender/src/renderer
parentReleasing progress-linux version 115.9.1esr-1~deb12u1progress7u1. (diff)
downloadfirefox-esr-c0db95d3dda1865d4c6bf0666b0e7439b40b9bf2.tar.xz
firefox-esr-c0db95d3dda1865d4c6bf0666b0e7439b40b9bf2.zip
Merging upstream version 115.10.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/webrender/src/renderer')
-rw-r--r--gfx/wr/webrender/src/renderer/upload.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/gfx/wr/webrender/src/renderer/upload.rs b/gfx/wr/webrender/src/renderer/upload.rs
index 0ba053cd76..a1155ecef4 100644
--- a/gfx/wr/webrender/src/renderer/upload.rs
+++ b/gfx/wr/webrender/src/renderer/upload.rs
@@ -43,6 +43,7 @@ use crate::profiler;
use crate::render_api::MemoryReport;
pub const BATCH_UPLOAD_TEXTURE_SIZE: DeviceIntSize = DeviceIntSize::new(512, 512);
+const BATCH_UPLOAD_FORMAT_COUNT: usize = 4;
/// Upload a number of items to texture cache textures.
///
@@ -627,10 +628,10 @@ pub struct UploadTexturePool {
/// The textures in the pool associated with a last used frame index.
///
/// The outer array corresponds to each of teh three supported texture formats.
- textures: [VecDeque<(Texture, u64)>; 3],
+ textures: [VecDeque<(Texture, u64)>; BATCH_UPLOAD_FORMAT_COUNT],
// Frame at which to deallocate some textures if there are too many in the pool,
// for each format.
- delay_texture_deallocation: [u64; 3],
+ delay_texture_deallocation: [u64; BATCH_UPLOAD_FORMAT_COUNT],
current_frame: u64,
/// Temporary buffers that are used when using staging uploads + glTexImage2D.
@@ -646,8 +647,8 @@ pub struct UploadTexturePool {
impl UploadTexturePool {
pub fn new() -> Self {
UploadTexturePool {
- textures: [VecDeque::new(), VecDeque::new(), VecDeque::new()],
- delay_texture_deallocation: [0; 3],
+ textures: [VecDeque::new(), VecDeque::new(), VecDeque::new(), VecDeque::new()],
+ delay_texture_deallocation: [0; BATCH_UPLOAD_FORMAT_COUNT],
current_frame: 0,
temporary_buffers: Vec::new(),
min_temporary_buffers: 0,
@@ -660,6 +661,7 @@ impl UploadTexturePool {
ImageFormat::RGBA8 => 0,
ImageFormat::BGRA8 => 1,
ImageFormat::R8 => 2,
+ ImageFormat::R16 => 3,
_ => { panic!("unexpected format"); }
}
}