Skip to content

Commit

Permalink
feat(shader)!: make ProgrammableStage::entry_point optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jul 23, 2024
1 parent 34d492a commit 0c2f01b
Show file tree
Hide file tree
Showing 50 changed files with 128 additions and 121 deletions.
4 changes: 2 additions & 2 deletions benches/benches/computepass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl ComputepassState {
label: Some("Compute Pipeline"),
layout: Some(&pipeline_layout),
module: &sm,
entry_point: "cs_main",
entry_point: Some("cs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
cache: None,
});
Expand Down Expand Up @@ -337,7 +337,7 @@ impl ComputepassState {
label: Some("Compute Pipeline bindless"),
layout: Some(&bindless_pipeline_layout),
module: &bindless_sm,
entry_point: "cs_main",
entry_point: Some("cs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
cache: None,
});
Expand Down
8 changes: 4 additions & 4 deletions benches/benches/renderpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl RenderpassState {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &sm,
entry_point: "vs_main",
entry_point: Some("vs_main"),
buffers: &vertex_buffer_layouts,
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
Expand All @@ -203,7 +203,7 @@ impl RenderpassState {
multisample: wgpu::MultisampleState::default(),
fragment: Some(wgpu::FragmentState {
module: &sm,
entry_point: "fs_main",
entry_point: Some("fs_main"),
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
blend: None,
Expand Down Expand Up @@ -284,7 +284,7 @@ impl RenderpassState {
layout: Some(&bindless_pipeline_layout),
vertex: wgpu::VertexState {
module: &bindless_shader_module,
entry_point: "vs_main",
entry_point: Some("vs_main"),
buffers: &vertex_buffer_layouts,
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
Expand All @@ -301,7 +301,7 @@ impl RenderpassState {
multisample: wgpu::MultisampleState::default(),
fragment: Some(wgpu::FragmentState {
module: &bindless_shader_module,
entry_point: "fs_main",
entry_point: Some("fs_main"),
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
blend: None,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/boids/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl crate::framework::Example for Example {
layout: Some(&render_pipeline_layout),
vertex: wgpu::VertexState {
module: &draw_shader,
entry_point: "main_vs",
entry_point: Some("main_vs"),
compilation_options: Default::default(),
buffers: &[
wgpu::VertexBufferLayout {
Expand All @@ -148,7 +148,7 @@ impl crate::framework::Example for Example {
},
fragment: Some(wgpu::FragmentState {
module: &draw_shader,
entry_point: "main_fs",
entry_point: Some("main_fs"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand All @@ -165,7 +165,7 @@ impl crate::framework::Example for Example {
label: Some("Compute pipeline"),
layout: Some(&compute_pipeline_layout),
module: &compute_shader,
entry_point: "main",
entry_point: Some("main"),
compilation_options: Default::default(),
cache: None,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bunnymark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: config.view_formats[0],
Expand Down
16 changes: 8 additions & 8 deletions examples/src/conservative_raster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout_empty),
vertex: wgpu::VertexState {
module: &shader_triangle_and_lines,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader_triangle_and_lines,
entry_point: "fs_main_red",
entry_point: Some("fs_main_red"),
compilation_options: Default::default(),
targets: &[Some(RENDER_TARGET_FORMAT.into())],
}),
Expand All @@ -122,13 +122,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout_empty),
vertex: wgpu::VertexState {
module: &shader_triangle_and_lines,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader_triangle_and_lines,
entry_point: "fs_main_blue",
entry_point: Some("fs_main_blue"),
compilation_options: Default::default(),
targets: &[Some(RENDER_TARGET_FORMAT.into())],
}),
Expand All @@ -149,13 +149,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout_empty),
vertex: wgpu::VertexState {
module: &shader_triangle_and_lines,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader_triangle_and_lines,
entry_point: "fs_main_white",
entry_point: Some("fs_main_white"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down Expand Up @@ -213,13 +213,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down
8 changes: 4 additions & 4 deletions examples/src/cube/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &vertex_buffers,
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand All @@ -272,13 +272,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &vertex_buffers,
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_wire",
entry_point: Some("fs_wire"),
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: config.view_formats[0],
Expand Down
2 changes: 1 addition & 1 deletion examples/src/hello_compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn execute_gpu_inner(
label: None,
layout: None,
module: &cs_module,
entry_point: "main",
entry_point: Some("main"),
compilation_options: Default::default(),
cache: None,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/hello_synchronization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ async fn execute(
label: None,
layout: Some(&pipeline_layout),
module: &shaders_module,
entry_point: "patient_main",
entry_point: Some("patient_main"),
compilation_options: Default::default(),
cache: None,
});
let hasty_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
label: None,
layout: Some(&pipeline_layout),
module: &shaders_module,
entry_point: "hasty_main",
entry_point: Some("hasty_main"),
compilation_options: Default::default(),
cache: None,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/hello_triangle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
buffers: &[],
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(swapchain_format.into())],
}),
Expand Down
2 changes: 1 addition & 1 deletion examples/src/hello_workgroups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async fn run() {
label: None,
layout: Some(&pipeline_layout),
module: &shader,
entry_point: "main",
entry_point: Some("main"),
compilation_options: Default::default(),
cache: None,
});
Expand Down
8 changes: 4 additions & 4 deletions examples/src/mipmap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ impl Example {
layout: None,
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(TEXTURE_FORMAT.into())],
}),
Expand Down Expand Up @@ -292,13 +292,13 @@ impl crate::framework::Example for Example {
layout: None,
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down
4 changes: 2 additions & 2 deletions examples/src/msaa_line/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Example {
layout: Some(pipeline_layout),
vertex: wgpu::VertexState {
module: shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[wgpu::VertexBufferLayout {
array_stride: std::mem::size_of::<Vertex>() as wgpu::BufferAddress,
Expand All @@ -63,7 +63,7 @@ impl Example {
},
fragment: Some(wgpu::FragmentState {
module: shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down
4 changes: 2 additions & 2 deletions examples/src/render_to_texture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ async fn run(_path: Option<String>) {
layout: None,
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(wgpu::TextureFormat::Rgba8UnormSrgb.into())],
}),
Expand Down
2 changes: 1 addition & 1 deletion examples/src/repeated_compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl WgpuContext {
label: None,
layout: Some(&pipeline_layout),
module: &shader,
entry_point: "main",
entry_point: Some("main"),
compilation_options: Default::default(),
cache: None,
});
Expand Down
8 changes: 4 additions & 4 deletions examples/src/shadow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_bake",
entry_point: Some("vs_bake"),
compilation_options: Default::default(),
buffers: &[vb_desc.clone()],
},
Expand Down Expand Up @@ -633,17 +633,17 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &[vb_desc],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: if supports_storage_resources {
entry_point: Some(if supports_storage_resources {
"fs_main"
} else {
"fs_main_without_storage"
},
}),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down
8 changes: 4 additions & 4 deletions examples/src/skybox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_sky",
entry_point: Some("vs_sky"),
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_sky",
entry_point: Some("fs_sky"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand All @@ -228,7 +228,7 @@ impl crate::framework::Example for Example {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_entity",
entry_point: Some("vs_entity"),
compilation_options: Default::default(),
buffers: &[wgpu::VertexBufferLayout {
array_stride: std::mem::size_of::<Vertex>() as wgpu::BufferAddress,
Expand All @@ -238,7 +238,7 @@ impl crate::framework::Example for Example {
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_entity",
entry_point: Some("fs_entity"),
compilation_options: Default::default(),
targets: &[Some(config.view_formats[0].into())],
}),
Expand Down
4 changes: 2 additions & 2 deletions examples/src/srgb_blend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ impl<const SRGB: bool> crate::framework::Example for Example<SRGB> {
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: Default::default(),
buffers: &vertex_buffers,
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: config.view_formats[0],
Expand Down
Loading

0 comments on commit 0c2f01b

Please sign in to comment.