diff --git a/webrender/src/device/gl.rs b/webrender/src/device/gl.rs index c17a16a757..5e9d0b4460 100644 --- a/webrender/src/device/gl.rs +++ b/webrender/src/device/gl.rs @@ -4113,6 +4113,12 @@ impl Device { read: gl::RG, pixel_type: gl::UNSIGNED_SHORT, }, + ImageFormat::RGBAF16 => FormatDesc { + internal: gl::RGBA16F, + external: gl::RGBA, + read: gl::RGBA, + pixel_type: gl::HALF_FLOAT, + }, } } @@ -4754,6 +4760,7 @@ impl<'a> TextureUploader<'a> { ImageFormat::RG16 => (gl::RG, 4, gl::UNSIGNED_SHORT), ImageFormat::RGBAF32 => (gl::RGBA, 16, gl::FLOAT), ImageFormat::RGBAI32 => (gl::RGBA_INTEGER, 16, gl::INT), + ImageFormat::RGBAF16 => (gl::RGBA, 8, gl::HALF_FLOAT), }; let row_length = match chunk.stride { diff --git a/webrender_api/src/image.rs b/webrender_api/src/image.rs index 903b127782..0840b7ad8a 100644 --- a/webrender_api/src/image.rs +++ b/webrender_api/src/image.rs @@ -171,6 +171,9 @@ pub enum ImageFormat { RGBAI32 = 7, /// Four channels, byte storage. RGBA8 = 8, + + /// Four channels, float16 storage. + RGBAF16 = 9, } impl ImageFormat { @@ -185,6 +188,7 @@ impl ImageFormat { ImageFormat::RG16 => 4, ImageFormat::RGBAI32 => 16, ImageFormat::RGBA8 => 4, + ImageFormat::RGBAF16 => 8, } } } diff --git a/wrench/src/yaml_frame_reader.rs b/wrench/src/yaml_frame_reader.rs index 0afe3968ee..3fccb6968b 100644 --- a/wrench/src/yaml_frame_reader.rs +++ b/wrench/src/yaml_frame_reader.rs @@ -304,6 +304,7 @@ fn is_image_opaque(format: ImageFormat, bytes: &[u8]) -> bool { ImageFormat::RG16 => true, ImageFormat::R8 => false, ImageFormat::R16 => false, + ImageFormat::RGBAF16 | ImageFormat::RGBAF32 | ImageFormat::RGBAI32 => unreachable!(), }