Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels

This commit is contained in:
Anthony Ramine 2018-09-09 12:10:12 +02:00
parent f726f18291
commit d8b7394fa3
2 changed files with 3 additions and 8 deletions

View file

@ -645,8 +645,9 @@ impl WebGLRenderingContext {
},
(TexFormat::RGBA, TexDataType::UnsignedShort5551) => {
for rgba in pixels.chunks_mut(2) {
let pix = NativeEndian::read_u16(rgba);
NativeEndian::write_u16(rgba, if pix & (1 << 15) != 0 { pix } else { 0 });
if NativeEndian::read_u16(rgba) & 1 == 0 {
NativeEndian::write_u16(rgba, 0);
}
}
},
(TexFormat::RGBA, TexDataType::UnsignedShort4444) => {