1+ ---
2+ title : " Lambda RS: Immediate Feature Ideas and Example APIs"
3+ document_id : " feature-roadmap-snippets-2025-09-24"
4+ status : " living"
5+ created : " 2025-09-24T00:00:00Z"
6+ last_updated : " 2025-12-15T00:00:00Z"
7+ version : " 0.2.0"
8+ engine_workspace_version : " 2023.1.30"
9+ wgpu_version : " 26.0.1"
10+ shader_backend_default : " naga"
11+ winit_version : " 0.29.10"
12+ repo_commit : " 71256389b9efe247a59aabffe9de58147b30669d"
13+ owners : ["lambda-sh"]
14+ reviewers : ["engine", "rendering"]
15+ tags : ["roadmap", "features", "api-design", "rendering"]
16+ ---
17+
118# Lambda RS: Immediate Feature Ideas + Example APIs
219
320This document proposes high‑impact features to add next to the Lambda RS
@@ -23,27 +40,34 @@ use lambda::render::{
2340// Layout: set(0) has a uniform buffer at binding(0)
2441let layout = BindGroupLayoutBuilder :: new ()
2542 . with_uniform (binding = 0 , visibility = PipelineStage :: VERTEX )
26- . build (& mut rc );
43+ . build (rc . gpu () );
2744
2845// Create and upload a uniform buffer
2946let ubo = BufferBuilder :: new ()
3047 . with_length (std :: mem :: size_of :: <Globals >())
3148 . with_usage (Usage :: UNIFORM )
3249 . with_properties (Properties :: CPU_VISIBLE )
3350 . with_label (" globals" )
34- . build (& mut rc , vec! [initial_globals ])? ;
51+ . build (rc . gpu () , vec! [initial_globals ])? ;
3552
3653// Bind group that points the layout(0)@binding(0) to our UBO
3754let group0 = BindGroupBuilder :: new ()
3855 . with_layout (& layout )
3956 . with_uniform (binding = 0 , & ubo )
40- . build (& mut rc );
57+ . build (rc . gpu () );
4158
4259// Pipeline accepts optional bind group layouts
4360let pipe = RenderPipelineBuilder :: new ()
4461 . with_layouts (& [& layout ])
4562 . with_buffer (vbo , attributes )
46- . build (& mut rc , & pass , & vs , Some (& fs ));
63+ . build (
64+ rc . gpu (),
65+ rc . surface_format (),
66+ rc . depth_format (),
67+ & pass ,
68+ & vs ,
69+ Some (& fs ),
70+ );
4771
4872// Commands inside a render pass
4973RC :: SetPipeline { pipeline : pipe_id },
@@ -64,25 +88,25 @@ let texture = TextureBuilder::new_2d(TextureFormat::Rgba8UnormSrgb)
6488 . with_size (512 , 512 )
6589 . with_data (& pixels )
6690 . with_label (" albedo" )
67- . build (& mut rc );
91+ . build (rc . gpu () );
6892
6993let sampler = SamplerBuilder :: new ()
7094 . linear_clamp ()
71- . build (& mut rc );
95+ . build (rc . gpu () );
7296
7397// Layout: binding(0) uniform buffer, binding(1) sampled texture, binding(2) sampler
7498let layout = BindGroupLayoutBuilder :: new ()
7599 . with_uniform (0 , PipelineStage :: VERTEX | PipelineStage :: FRAGMENT )
76100 . with_sampled_texture (1 )
77101 . with_sampler (2 )
78- . build (& mut rc );
102+ . build (rc . gpu () );
79103
80104let group = BindGroupBuilder :: new ()
81105 . with_layout (& layout )
82106 . with_uniform (0 , & ubo )
83107 . with_texture (1 , & texture )
84108 . with_sampler (2 , & sampler )
85- . build (& mut rc );
109+ . build (rc . gpu () );
86110
87111RC :: BindGroup { set : 0 , group : group_id , offsets : & [] },
88112```
@@ -105,12 +129,23 @@ let pass = RenderPassBuilder::new()
105129 depth_compare = wgpu :: CompareFunction :: Less ,
106130 )
107131 . with_msaa (samples = 4 )
108- . build (& rc );
132+ . build (
133+ rc . gpu (),
134+ rc . surface_format (),
135+ rc . depth_format (),
136+ );
109137
110138let pipe = RenderPipelineBuilder :: new ()
111139 . with_msaa (samples = 4 )
112140 . with_depth_format (wgpu :: TextureFormat :: Depth32Float )
113- . build (& mut rc , & pass , & vs , Some (& fs ));
141+ . build (
142+ rc . gpu (),
143+ rc . surface_format (),
144+ rc . depth_format (),
145+ & pass ,
146+ & vs ,
147+ Some (& fs ),
148+ );
114149```
115150
116151## 4) Indexed Draw + Multiple Vertex Buffers
@@ -140,13 +175,21 @@ let offscreen = RenderTargetBuilder::new()
140175 . with_color (TextureFormat :: Rgba8UnormSrgb , width , height )
141176 . with_depth (TextureFormat :: Depth32Float )
142177 . with_label (" offscreen" )
143- . build (& mut rc );
178+ . build (rc . gpu () );
144179
145180// Pass 1: draw scene into `offscreen`
146- let p1 = RenderPassBuilder :: new (). with_target (& offscreen ). build (& rc );
181+ let p1 = RenderPassBuilder :: new (). with_target (& offscreen ). build (
182+ rc . gpu (),
183+ rc . surface_format (),
184+ rc . depth_format (),
185+ );
147186
148187// Pass 2: sample offscreen color into swapchain
149- let p2 = RenderPassBuilder :: new (). build (& rc );
188+ let p2 = RenderPassBuilder :: new (). build (
189+ rc . gpu (),
190+ rc . surface_format (),
191+ rc . depth_format (),
192+ );
150193
151194// Commands
152195RC :: BeginRenderPass { render_pass : p1_id , viewport },
@@ -246,4 +289,3 @@ These proposals aim to keep Lambda’s surface area small while unlocking common
246289workflows (texturing, uniforms, depth/MSAA, compute, multipass). I can begin
247290implementing any of them next; uniform buffers/bind groups and depth/MSAA are
248291usually the quickest wins for examples and demos.
249-
0 commit comments