embed the simple shader

This commit is contained in:
numzero 2025-11-23 13:29:24 +03:00
parent 96e5c78a59
commit 707bb6f66e
3 changed files with 3 additions and 2 deletions

View File

@ -57,10 +57,9 @@ impl Pipeline {
mapped_at_creation: false, mapped_at_creation: false,
}); });
let shader = std::fs::read_to_string("shaders/line.wgsl").unwrap();
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: None, label: None,
source: wgpu::ShaderSource::Wgsl(shader.into()), source: wgpu::ShaderSource::Wgsl(super::SIMPLE_SHADER.into()),
}); });
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: None, label: None,

View File

@ -1 +1,3 @@
pub mod lines; pub mod lines;
static SIMPLE_SHADER: &str = include_str!("simple.wgsl");