1
0
Fork 0
forked from wry/wry

render: fix vulkan formats for pre-multiplied alpha

This commit is contained in:
Julian Orth 2024-02-15 01:01:29 +01:00
parent 30fb0f087f
commit 1a024babdf
3 changed files with 7 additions and 7 deletions

View file

@ -85,11 +85,11 @@ impl Color {
[to_u8(self.r), to_u8(self.g), to_u8(self.b), to_u8(self.a)]
}
#[allow(dead_code)]
pub fn to_array_srgb(self) -> [f32; 4] {
[self.r, self.g, self.b, self.a]
}
#[allow(dead_code)]
pub fn to_array_linear(self) -> [f32; 4] {
fn to_linear(srgb: f32) -> f32 {
if srgb <= 0.04045 {