mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
The backend now works in a similar way to the msl backend Should require less loops, allocations and backtracking Overall just better to work with it Added a build script which reads a file with the glsl keywords and generates a slice to be used in the Namer Added a way to build a call graph
68 lines
2.2 KiB
Rust
68 lines
2.2 KiB
Rust
//! Module processing functionality.
|
|
|
|
#[cfg(feature = "petgraph")]
|
|
mod call_graph;
|
|
mod interface;
|
|
mod namer;
|
|
mod typifier;
|
|
mod validator;
|
|
|
|
#[cfg(feature = "petgraph")]
|
|
pub use call_graph::{CallGraph, CallGraphBuilder};
|
|
pub use interface::{Interface, Visitor};
|
|
pub use namer::{EntryPointIndex, NameKey, Namer};
|
|
pub use typifier::{check_constant_type, ResolveContext, ResolveError, Typifier};
|
|
pub use validator::{ValidationError, Validator};
|
|
|
|
impl From<super::StorageFormat> for super::ScalarKind {
|
|
fn from(format: super::StorageFormat) -> Self {
|
|
use super::{ScalarKind as Sk, StorageFormat as Sf};
|
|
match format {
|
|
Sf::R8Unorm => Sk::Float,
|
|
Sf::R8Snorm => Sk::Float,
|
|
Sf::R8Uint => Sk::Uint,
|
|
Sf::R8Sint => Sk::Sint,
|
|
Sf::R16Uint => Sk::Uint,
|
|
Sf::R16Sint => Sk::Sint,
|
|
Sf::R16Float => Sk::Float,
|
|
Sf::Rg8Unorm => Sk::Float,
|
|
Sf::Rg8Snorm => Sk::Float,
|
|
Sf::Rg8Uint => Sk::Uint,
|
|
Sf::Rg8Sint => Sk::Sint,
|
|
Sf::R32Uint => Sk::Uint,
|
|
Sf::R32Sint => Sk::Sint,
|
|
Sf::R32Float => Sk::Float,
|
|
Sf::Rg16Uint => Sk::Uint,
|
|
Sf::Rg16Sint => Sk::Sint,
|
|
Sf::Rg16Float => Sk::Float,
|
|
Sf::Rgba8Unorm => Sk::Float,
|
|
Sf::Rgba8Snorm => Sk::Float,
|
|
Sf::Rgba8Uint => Sk::Uint,
|
|
Sf::Rgba8Sint => Sk::Sint,
|
|
Sf::Rgb10a2Unorm => Sk::Float,
|
|
Sf::Rg11b10Float => Sk::Float,
|
|
Sf::Rg32Uint => Sk::Uint,
|
|
Sf::Rg32Sint => Sk::Sint,
|
|
Sf::Rg32Float => Sk::Float,
|
|
Sf::Rgba16Uint => Sk::Uint,
|
|
Sf::Rgba16Sint => Sk::Sint,
|
|
Sf::Rgba16Float => Sk::Float,
|
|
Sf::Rgba32Uint => Sk::Uint,
|
|
Sf::Rgba32Sint => Sk::Sint,
|
|
Sf::Rgba32Float => Sk::Float,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl crate::TypeInner {
|
|
pub fn scalar_kind(&self) -> Option<super::ScalarKind> {
|
|
match *self {
|
|
super::TypeInner::Scalar { kind, .. } | super::TypeInner::Vector { kind, .. } => {
|
|
Some(kind)
|
|
}
|
|
super::TypeInner::Matrix { .. } => Some(super::ScalarKind::Float),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|