Fix the LUMINANCE_ALPHA case of rgba8_image_to_tex_image_data

The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE_ALPHA format.
This commit is contained in:
Anthony Ramine 2018-09-08 19:24:24 +02:00
parent 9c1c58a498
commit 9a362391d5
5 changed files with 19 additions and 1233 deletions

View file

@ -4048,7 +4048,7 @@ fn rgba8_image_to_tex_image_data(
for i in 0..pixel_count {
let (lum, a) = {
let rgba = &pixels[i * 4..i * 4 + 4];
(luminance(rgba[0], rgba[1], rgba[2]), rgba[3])
(rgba[0], rgba[3])
};
pixels[i * 2] = lum;
pixels[i * 2 + 1] = a;