perf: Add BLA rendering

This commit is contained in:
2026-09-30 18:25:27 +02:00
parent 2e35ba551d
commit 21f08eb3d9
9 changed files with 987 additions and 26 deletions
+26 -17
View File
@@ -77,7 +77,7 @@ fn mandelbrot_shader_is_valid() {
}
/// Every specialization renderer.rs can build (`PipelineKey`: kind × Julia ×
/// DE × morph × deep), for every fragment entry point.
/// DE × morph × deep × BLA), for every fragment entry point.
#[test]
fn mandelbrot_shader_specializations_compile() {
let (module, info) = validate("mandelbrot.wgsl", MANDELBROT_SRC);
@@ -86,22 +86,31 @@ fn mandelbrot_shader_specializations_compile() {
for de in [0.0, 1.0] {
for morph in [0.0, 1.0] {
for deep in [0.0, 1.0] {
let constants = [
("KIND", kind as f64),
("IS_JULIA", julia),
("DE", de),
("MORPH", morph),
("DEEP", deep),
];
for entry in ["fs_data", "fs_refine", "fs_color"] {
specialize(
"mandelbrot.wgsl",
&module,
&info,
naga::ShaderStage::Fragment,
entry,
&constants,
);
// BLA only exists for plain Mandelbrot (`bla::supported`).
let blas: &[f64] = if kind == 0 && morph == 0.0 {
&[0.0, 1.0]
} else {
&[0.0]
};
for &bla in blas {
let constants = [
("KIND", kind as f64),
("IS_JULIA", julia),
("DE", de),
("MORPH", morph),
("DEEP", deep),
("BLA", bla),
];
for entry in ["fs_data", "fs_refine", "fs_color"] {
specialize(
"mandelbrot.wgsl",
&module,
&info,
naga::ShaderStage::Fragment,
entry,
&constants,
);
}
}
}
}