mirror of
https://github.com/italicsjenga/portability.git
synced 2025-02-23 17:47:43 +11:00
Add support for more formats
This commit is contained in:
parent
30f55be936
commit
7d45552cbc
1 changed files with 19 additions and 4 deletions
23
src/conv.rs
23
src/conv.rs
|
@ -9,19 +9,34 @@ pub fn format_from_hal(format: format::Format) -> VkFormat {
|
||||||
use hal::format::SurfaceType::*;
|
use hal::format::SurfaceType::*;
|
||||||
|
|
||||||
match format.0 {
|
match format.0 {
|
||||||
|
R5_G6_B5 => match format.1 {
|
||||||
|
Unorm => VK_FORMAT_R5G6B5_UNORM_PACK16,
|
||||||
|
_ => unreachable!(),
|
||||||
|
},
|
||||||
|
R4_G4_B4_A4 => match format.1 {
|
||||||
|
Unorm => VK_FORMAT_R4G4B4A4_UNORM_PACK16,
|
||||||
|
_ => unreachable!(),
|
||||||
|
},
|
||||||
R8_G8_B8_A8 => match format.1 {
|
R8_G8_B8_A8 => match format.1 {
|
||||||
Unorm => VK_FORMAT_R8G8B8A8_UNORM,
|
Unorm => VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
|
Inorm => VK_FORMAT_R8G8B8A8_SNORM,
|
||||||
Srgb => VK_FORMAT_R8G8B8A8_SRGB,
|
Srgb => VK_FORMAT_R8G8B8A8_SRGB,
|
||||||
_ => unimplemented!()
|
_ => panic!("format {:?}", format),
|
||||||
},
|
},
|
||||||
B8_G8_R8_A8 => match format.1 {
|
B8_G8_R8_A8 => match format.1 {
|
||||||
Unorm => VK_FORMAT_B8G8R8A8_UNORM,
|
Unorm => VK_FORMAT_B8G8R8A8_UNORM,
|
||||||
|
Inorm => VK_FORMAT_B8G8R8A8_SNORM,
|
||||||
Srgb => VK_FORMAT_B8G8R8A8_SRGB,
|
Srgb => VK_FORMAT_B8G8R8A8_SRGB,
|
||||||
_ => unimplemented!()
|
_ => panic!("format {:?}", format),
|
||||||
|
},
|
||||||
|
R16_G16_B16_A16 => match format.1 {
|
||||||
|
Unorm => VK_FORMAT_R16G16B16A16_UNORM,
|
||||||
|
Inorm => VK_FORMAT_R16G16B16A16_SNORM,
|
||||||
|
Float => VK_FORMAT_R16G16B16A16_SFLOAT,
|
||||||
|
_ => panic!("format {:?}", format),
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
println!("\tformat {:?}", format);
|
panic!("format {:?}", format);
|
||||||
unimplemented!()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue