mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 12:21:31 +11:00
fmt
This commit is contained in:
parent
a532eacf7b
commit
87803cc8a6
|
@ -3,7 +3,6 @@ mod compile;
|
||||||
#[path = "src/types.rs"]
|
#[path = "src/types.rs"]
|
||||||
mod types;
|
mod types;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -35,10 +34,7 @@ fn main() {
|
||||||
println!("cargo:rerun-if-changed=../shader");
|
println!("cargo:rerun-if-changed=../shader");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_types(
|
fn write_types(buf: &mut String, shaders: &[(String, ShaderInfo)]) -> Result<(), std::fmt::Error> {
|
||||||
buf: &mut String,
|
|
||||||
shaders: &[(String, ShaderInfo)],
|
|
||||||
) -> Result<(), std::fmt::Error> {
|
|
||||||
writeln!(buf, "pub struct Shaders<'a> {{")?;
|
writeln!(buf, "pub struct Shaders<'a> {{")?;
|
||||||
for (name, _) in shaders {
|
for (name, _) in shaders {
|
||||||
writeln!(buf, " pub {name}: ComputeShader<'a>,")?;
|
writeln!(buf, " pub {name}: ComputeShader<'a>,")?;
|
||||||
|
|
|
@ -65,8 +65,8 @@ impl ShaderInfo {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let Some(binding) = &var.binding else {
|
let Some(binding) = &var.binding else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
let mut resource = BindingInfo {
|
let mut resource = BindingInfo {
|
||||||
name: var.name.clone(),
|
name: var.name.clone(),
|
||||||
location: (binding.group, binding.binding),
|
location: (binding.group, binding.binding),
|
||||||
|
|
Loading…
Reference in a new issue