summaryrefslogtreecommitdiff
path: root/client/src/ui.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-21 22:00:39 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-21 22:00:39 +0100
commit12bf2f3302efc9042f12ca17104928c35700c229 (patch)
tree7abf77d5b94308993c9d67f65413f8a8d698c685 /client/src/ui.rs
parent20d5d575ad84da3d37bd581425fc335016f33c82 (diff)
downloadweareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar
weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.bz2
weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.zst
split shaders to individual files
Diffstat (limited to 'client/src/ui.rs')
-rw-r--r--client/src/ui.rs12
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,