use std::borrow::Cow;
use wgpu::PipelineCompilationOptions;
pub struct IndicatrixRaytracerPipeline {
pub compute_pipeline: wgpu::ComputePipeline,
}
impl IndicatrixRaytracerPipeline {
#[must_use]
pub fn new(device: &wgpu::Device) -> Self {
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("Indicatrix Raytracer Shader"),
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!("shaders/raytracer.wgsl"))),
});
let compute_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
label: Some("Indicatrix Raytracer Compute Pipeline"),
layout: None,
module: &shader,
entry_point: Some("main"),
compilation_options: PipelineCompilationOptions::default(),
cache: None,
});
Self { compute_pipeline }
}
}