pub mod builder;
pub mod core;
pub mod multipass;
pub mod resource;
pub use builder::*;
pub use core::*;
pub use multipass::*;
pub use resource::*;
pub const COMPUTE_TEXTURE_FORMAT_RGBA16: wgpu::TextureFormat = wgpu::TextureFormat::Rgba16Float;
pub const COMPUTE_TEXTURE_FORMAT_RGBA8: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unorm;
use crate::Core;
impl ComputeShader {
pub fn builder() -> ComputeShaderBuilder {
ComputeShaderBuilder::new()
}
pub fn new(core: &Core, shader_source: &str) -> Self {
let config = ComputeShaderBuilder::new()
.with_label("Simple Compute Shader")
.build();
Self::from_builder(core, shader_source, config)
}
pub fn with_uniforms<T: crate::UniformProvider>(
core: &Core,
shader_source: &str,
label: &str,
) -> Self {
let config = ComputeShaderBuilder::new()
.with_custom_uniforms::<T>()
.with_label(label)
.build();
Self::from_builder(core, shader_source, config)
}
pub fn with_multi_pass(
core: &Core,
shader_source: &str,
passes: &[PassDescription],
label: &str,
) -> Self {
let config = ComputeShaderBuilder::new()
.with_multi_pass(passes)
.with_label(label)
.build();
Self::from_builder(core, shader_source, config)
}
}