Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5afecc2c08
|
|||
|
5da5edf8aa
|
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
glslangValidator --spirv-val --spirv-dis -g0 -S frag --target-env vulkan1.3 --quiet src/trace.frag.glsl > src/trace.spv-dis
|
glslangValidator --spirv-val --spirv-dis -g0 -S frag --target-env vulkan1.3 --quiet src/trace.frag.glsl > src/trace.spv-dis
|
||||||
sed -i '/%11 =/,/OpFunctionEnd/d' src/trace.spv-dis
|
sed -i '/%11 =/,/OpFunctionEnd/d' src/trace.spv-dis
|
||||||
sed -i 's/%11\b/%1000/g' src/trace.spv-dis
|
sed -i 's/%11\b/%1000/g' src/trace.spv-dis
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
use std::{fs::read_dir, io::Write, process::Command};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
//let mut output = std::fs::File::create("output.txt").unwrap();
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
println!("cargo:rerun-if-changed=Cargo.lock");
|
||||||
|
let paths = read_dir("src").unwrap();
|
||||||
|
for path in paths {
|
||||||
|
if let Ok(path) = path {
|
||||||
|
if path
|
||||||
|
.path()
|
||||||
|
.extension()
|
||||||
|
.map(|ext| ext == "glsl")
|
||||||
|
.unwrap_or(false)
|
||||||
|
{
|
||||||
|
println!("cargo::rerun-if-changed={}", path.path().display());
|
||||||
|
//writeln!(output, "cargo::rerun-if-changed={}",
|
||||||
|
// path.path().display()).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Command::new("bash")
|
||||||
|
.arg("assemble_trace.sh")
|
||||||
|
.status()
|
||||||
|
.expect("Failed to assemble header shaders");
|
||||||
|
}
|
||||||
+38
-31
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
const DUMP_SPV_TO_FILE: bool = true;
|
const DUMP_SPV_TO_FILE: bool = true;
|
||||||
const PIPELINE_CACHING: bool = false;
|
const PIPELINE_CACHING: bool = false;
|
||||||
|
const IGNORE_STENCIL: bool = true;
|
||||||
|
|
||||||
const BYTECODE_IMITATES_GLSL: bool = false;
|
const BYTECODE_IMITATES_GLSL: bool = false;
|
||||||
|
|
||||||
@@ -333,37 +334,37 @@ impl App {
|
|||||||
physical_device.properties().device_type,
|
physical_device.properties().device_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
let depth_format = if physical_device
|
const DEPTH_FORMAT_ORDERING: [Format; 4] = [
|
||||||
.format_properties(Format::D24_UNORM_S8_UINT)
|
Format::D24_UNORM_S8_UINT,
|
||||||
.unwrap()
|
Format::X8_D24_UNORM_PACK32,
|
||||||
.optimal_tiling_features
|
Format::D32_SFLOAT_S8_UINT,
|
||||||
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
|
Format::D16_UNORM_S8_UINT,
|
||||||
{
|
];
|
||||||
Format::D24_UNORM_S8_UINT
|
|
||||||
} else if physical_device
|
const DEPTH_FORMAT_ORDERING_IGNORE_STENCIL: [Format; 6] = [
|
||||||
.format_properties(Format::X8_D24_UNORM_PACK32)
|
Format::D32_SFLOAT,
|
||||||
.unwrap()
|
Format::D24_UNORM_S8_UINT,
|
||||||
.optimal_tiling_features
|
Format::X8_D24_UNORM_PACK32,
|
||||||
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
|
Format::D32_SFLOAT_S8_UINT,
|
||||||
{
|
Format::D16_UNORM,
|
||||||
Format::X8_D24_UNORM_PACK32
|
Format::D16_UNORM_S8_UINT,
|
||||||
} else if physical_device
|
];
|
||||||
.format_properties(Format::D32_SFLOAT_S8_UINT)
|
|
||||||
.unwrap()
|
let depth_format = (if IGNORE_STENCIL {
|
||||||
.optimal_tiling_features
|
DEPTH_FORMAT_ORDERING_IGNORE_STENCIL.iter()
|
||||||
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
|
|
||||||
{
|
|
||||||
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!");
|
DEPTH_FORMAT_ORDERING.iter()
|
||||||
};
|
})
|
||||||
|
.filter(|format| {
|
||||||
|
physical_device
|
||||||
|
.format_properties(**format)
|
||||||
|
.unwrap()
|
||||||
|
.optimal_tiling_features
|
||||||
|
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
|
||||||
|
})
|
||||||
|
.next()
|
||||||
|
.expect("Could not find suitable depth format!")
|
||||||
|
.clone();
|
||||||
|
|
||||||
info!("Using depth format {:?}", depth_format);
|
info!("Using depth format {:?}", depth_format);
|
||||||
|
|
||||||
@@ -1583,6 +1584,12 @@ impl App {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
let depth_clear = if self.depth_format.numeric_format_stencil().is_some() {
|
||||||
|
Some((0.0, 0).into())
|
||||||
|
} else {
|
||||||
|
Some((0.0).into())
|
||||||
|
};
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.begin_render_pass(
|
.begin_render_pass(
|
||||||
RenderPassBeginInfo {
|
RenderPassBeginInfo {
|
||||||
@@ -1592,7 +1599,7 @@ impl App {
|
|||||||
Some([0.12, 0.1, 0.1, 1.0].into()),
|
Some([0.12, 0.1, 0.1, 1.0].into()),
|
||||||
Some([0.0, 0.0, 0.0, 1.0].into()),
|
Some([0.0, 0.0, 0.0, 1.0].into()),
|
||||||
Some([0.0, 0.0, 0.0, 1.0].into()),
|
Some([0.0, 0.0, 0.0, 1.0].into()),
|
||||||
Some((0.0, 0).into()),
|
depth_clear,
|
||||||
],
|
],
|
||||||
..RenderPassBeginInfo::framebuffer(rcx.framebuffers[image_index].clone())
|
..RenderPassBeginInfo::framebuffer(rcx.framebuffers[image_index].clone())
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user