diff options
Diffstat (limited to 'client/src/ui.rs')
-rw-r--r-- | client/src/ui.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/ui.rs b/client/src/ui.rs index 92de3c8..78ca29d 100644 --- a/client/src/ui.rs +++ b/client/src/ui.rs @@ -75,7 +75,9 @@ pub enum UiEvent { impl UiRenderer { pub fn new(device: Arc<Device>, queue: Arc<Queue>, format: TextureFormat) -> Self { - let module = device.create_shader_module(include_wgsl!("ui.wgsl")); + let frag_shader = device.create_shader_module(include_wgsl!("shaders/fragment_ui.wgsl")); + let vert_shader = device.create_shader_module(include_wgsl!("shaders/vertex_ui.wgsl")); + let bind_group_layout = device.create_bind_group_layout(&BindGroupLayoutDescriptor { entries: &[ BindGroupLayoutEntry { @@ -109,8 +111,8 @@ impl UiRenderer { label: None, layout: Some(&pipeline_layout), fragment: Some(FragmentState { - module: &module, - entry_point: Some("fs_main"), + module: &frag_shader, + entry_point: Some("main"), targets: &[Some(ColorTargetState { blend: Some(BlendState::PREMULTIPLIED_ALPHA_BLENDING), format, @@ -119,8 +121,8 @@ impl UiRenderer { compilation_options: PipelineCompilationOptions::default(), }), vertex: VertexState { - module: &module, - entry_point: Some("vs_main"), + module: &vert_shader, + entry_point: Some("main"), buffers: &[VertexBufferLayout { array_stride: size_of::<Vertex>() as u64, step_mode: VertexStepMode::Vertex, |