Minor fixes

This commit is contained in:
2025-09-14 20:43:17 +01:00
parent 38303a8a36
commit a7e17f3777
3 changed files with 22 additions and 6 deletions
+5
View File
@@ -47,3 +47,8 @@ num_cpus = "1"
#vulkano-taskgraph = { git = "https://github.com/vulkano-rs/vulkano" } #vulkano-taskgraph = { git = "https://github.com/vulkano-rs/vulkano" }
#vulkano-util = { git = "https://github.com/vulkano-rs/vulkano" } #vulkano-util = { git = "https://github.com/vulkano-rs/vulkano" }
#egui_winit_vulkano = { git = "https://github.com/Molive-0/egui_winit_vulkano" } #egui_winit_vulkano = { git = "https://github.com/Molive-0/egui_winit_vulkano" }
[profile.release]
strip = true
lto = true
codegen-units = 1
+16 -5
View File
@@ -1,5 +1,5 @@
#![feature(variant_count)] #![feature(variant_count)]
#![feature(array_chunks)] #![feature(iter_array_chunks)]
#![feature(portable_simd)] #![feature(portable_simd)]
#![feature(mpmc_channel)] #![feature(mpmc_channel)]
@@ -341,12 +341,12 @@ impl App {
{ {
Format::D24_UNORM_S8_UINT Format::D24_UNORM_S8_UINT
} else if physical_device } else if physical_device
.format_properties(Format::D16_UNORM_S8_UINT) .format_properties(Format::X8_D24_UNORM_PACK32)
.unwrap() .unwrap()
.optimal_tiling_features .optimal_tiling_features
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT) .contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
{ {
Format::D16_UNORM_S8_UINT Format::X8_D24_UNORM_PACK32
} else if physical_device } else if physical_device
.format_properties(Format::D32_SFLOAT_S8_UINT) .format_properties(Format::D32_SFLOAT_S8_UINT)
.unwrap() .unwrap()
@@ -354,6 +354,13 @@ impl App {
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT) .contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
{ {
Format::D32_SFLOAT_S8_UINT Format::D32_SFLOAT_S8_UINT
} else if physical_device
.format_properties(Format::D16_UNORM_S8_UINT)
.unwrap()
.optimal_tiling_features
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
{
Format::D16_UNORM_S8_UINT
} else { } else {
panic!("Could not find suitable depth format!"); panic!("Could not find suitable depth format!");
}; };
@@ -483,7 +490,9 @@ impl App {
let trace_spv_code = include_bytes!("trace.recompiled.spv"); let trace_spv_code = include_bytes!("trace.recompiled.spv");
let trace_spv_code_u32 = trace_spv_code let trace_spv_code_u32 = trace_spv_code
.array_chunks::<4>() .as_chunks::<4>()
.0
.into_iter()
.map(|u| u32::from_le_bytes(*u)) .map(|u| u32::from_le_bytes(*u))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let mut loader = rspirv::dr::Loader::new(); let mut loader = rspirv::dr::Loader::new();
@@ -492,7 +501,9 @@ impl App {
let normals_spv_code = include_bytes!("normals.recompiled.spv"); let normals_spv_code = include_bytes!("normals.recompiled.spv");
let normals_spv_code_u32 = normals_spv_code let normals_spv_code_u32 = normals_spv_code
.array_chunks::<4>() .as_chunks::<4>()
.0
.into_iter()
.map(|u| u32::from_le_bytes(*u)) .map(|u| u32::from_le_bytes(*u))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let mut loader = rspirv::dr::Loader::new(); let mut loader = rspirv::dr::Loader::new();
+1 -1
View File
@@ -124,7 +124,7 @@ void main() {
vec3 n = getNormal(position); vec3 n = getNormal(position);
f_color = vec4(1.0); f_color = vec4(object_uniforms.colour, 1.0);
f_ao_r_m.y = object_uniforms.roughness; f_ao_r_m.y = object_uniforms.roughness;
f_ao_r_m.z = object_uniforms.metallic; f_ao_r_m.z = object_uniforms.metallic;