fancy text

This commit is contained in:
2021-08-16 02:27:00 +02:00
parent fb045f210a
commit 00d6d1c5f8
13 changed files with 52 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
use std::{convert::TryInto, io::Read};
use vulkano::{format::Format, sampler::Filter};
use vulkano::{format::Format, sampler::{Filter, SamplerAddressMode}};
use super::VulkanRenderer;
@@ -26,14 +26,14 @@ pub fn upload_texture_from_file(path: &str, renderer: &mut VulkanRenderer) -> Re
if is_dxt1
{
renderer.upload_texture(&tex_bytes[128..], tex_width, tex_height, Format::BC1_RGBUnormBlock, Filter::Linear, renderer.device.clone());
renderer.upload_texture(&tex_bytes[128..], tex_width, tex_height, Format::BC1_RGBUnormBlock, Filter::Linear, SamplerAddressMode::Repeat, renderer.device.clone());
}
if is_dx10
{
let dxgi_type = u32::from_ne_bytes(tex_bytes[128..132].try_into()?);
assert!(dxgi_type == 83); // BC5 Unorm Typeless
renderer.upload_texture(&tex_bytes[128+20..], tex_width, tex_height, Format::BC5UnormBlock, Filter::Linear, renderer.device.clone());
renderer.upload_texture(&tex_bytes[128+20..], tex_width, tex_height, Format::BC5UnormBlock, Filter::Linear, SamplerAddressMode::Repeat, renderer.device.clone());
}
Ok(())