vulkano reeeeeeeeeeee

This commit is contained in:
2021-10-24 18:57:46 +02:00
parent 23e19bf9d0
commit 2834623ba7
12 changed files with 193 additions and 192 deletions

View File

@@ -1,7 +1,8 @@
use std::fs;
use std::{convert::TryInto, fs};
use serde_derive::{Deserialize, Serialize};
use toml;
use vulkano::image::SampleCount;
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
pub struct LogConfigInput {
@@ -33,4 +34,8 @@ impl RenderConfig {
pub fn from_file(path: &str) -> Self {
toml::from_slice(&fs::read(path).expect("Failed to read render config!")).expect("Failed to parse render config!")
}
pub fn get_msaa(&self) -> Option<SampleCount> {
if self.msaa_samples > 0 { self.msaa_samples.try_into().ok() } else { None }
}
}