pub struct RenderPassBuilder<'f, 'w> { /* private fields */ }Expand description
Builder for creating render passes with fluent API.
§Example
let mut pass = frame.render_pass()
.clear_color(Color::BLACK)
.clear_depth(0.0)
.label("main")
.build();
// Use pass.wgpu_pass() for renderingImplementations§
Source§impl<'f, 'w> RenderPassBuilder<'f, 'w>
impl<'f, 'w> RenderPassBuilder<'f, 'w>
Sourcepub fn target(self, target: RenderTarget<'f>) -> Self
pub fn target(self, target: RenderTarget<'f>) -> Self
Set the render target (for backwards compatibility).
Examples found in repository?
284 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
285 if window_id != self.window_id {
286 return;
287 }
288
289 // Handle window-specific resize events
290 events.dispatch(|event| {
291 if let astrelis_winit::event::Event::WindowResized(size) = event {
292 self.window.resized(*size);
293 astrelis_winit::event::HandleStatus::consumed()
294 } else {
295 astrelis_winit::event::HandleStatus::ignored()
296 }
297 });
298
299 let Some(frame) = self.window.begin_frame() else {
300 return; // Surface not available
301 };
302
303 // Pass 1: Render to offscreen framebuffer
304 {
305 let mut pass = frame
306 .render_pass()
307 .target(RenderTarget::Framebuffer(&self.offscreen_fb))
308 .clear_color(Color::rgb(0.2, 0.1, 0.3))
309 .label("offscreen_pass")
310 .build();
311 pass.set_pipeline(&self.pipeline);
312 pass.set_bind_group(0, &self.bind_group, &[]);
313 pass.set_vertex_buffer(0, self.vertex_buffer.slice(..));
314 pass.draw(0..6, 0..1);
315 }
316
317 // Pass 2: Blit framebuffer to surface
318 {
319 let mut pass = frame
320 .render_pass()
321 .clear_color(Color::rgb(0.1, 0.2, 0.3))
322 .label("blit_pass")
323 .build();
324 pass.set_pipeline(&self.blit_pipeline);
325 pass.set_bind_group(0, &self.blit_bind_group, &[]);
326 // Draw fullscreen triangle
327 pass.draw(0..3, 0..1);
328 }
329 // Frame auto-submits on drop
330 }Sourcepub fn to_surface(self) -> Self
pub fn to_surface(self) -> Self
Render to the window surface (default).
Sourcepub fn to_framebuffer(self, fb: &'f Framebuffer) -> Self
pub fn to_framebuffer(self, fb: &'f Framebuffer) -> Self
Render to a framebuffer.
Sourcepub fn to_texture(self, view: &'f TextureView) -> Self
pub fn to_texture(self, view: &'f TextureView) -> Self
Render to a custom texture view.
Sourcepub fn clear_color(self, color: impl Into<ColorOp>) -> Self
pub fn clear_color(self, color: impl Into<ColorOp>) -> Self
Clear the color target to the specified color.
Examples found in repository?
89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("camera_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }More examples
91 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
92 if window_id != self.window_id {
93 return;
94 }
95
96 events.dispatch(|event| {
97 if let astrelis_winit::event::Event::WindowResized(size) = event {
98 self.window.resized(*size);
99 astrelis_winit::event::HandleStatus::consumed()
100 } else {
101 astrelis_winit::event::HandleStatus::ignored()
102 }
103 });
104
105 let Some(frame) = self.window.begin_frame() else {
106 return; // Surface not available
107 };
108 {
109 let _pass = frame
110 .render_pass()
111 .clear_color(Color::from_rgb_u8(20, 30, 40))
112 .label("mesh_primitives_pass")
113 .build();
114 }
115 // Frame auto-submits on drop
116 }89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("render_graph_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }86 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
87 // Get the color for this window
88 let Some(&color) = self.window_colors.get(&window_id) else {
89 return;
90 };
91
92 // WindowManager automatically handles:
93 // 1. Window lookup (no manual HashMap.get_mut)
94 // 2. Resize events (automatic)
95 // 3. Event dispatching
96 self.window_manager
97 .render_window(window_id, events, |window, _events| {
98 // No need to manually handle resize events!
99 // WindowManager already did that for us
100
101 // Just render!
102 let Some(frame) = window.begin_frame() else {
103 return; // Surface not available
104 };
105
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(color)
110 .label("window_manager_pass")
111 .build();
112 // Additional rendering would go here
113 }
114 // Frame auto-submits on drop
115 });
116 }105 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
106 if window_id != self.window_id {
107 return;
108 }
109
110 // Handle resize
111 events.dispatch(|event| {
112 if let astrelis_winit::event::Event::WindowResized(size) = event {
113 self.window.resized(*size);
114 astrelis_winit::event::HandleStatus::consumed()
115 } else {
116 astrelis_winit::event::HandleStatus::ignored()
117 }
118 });
119
120 // In a real application, materials would be bound during rendering:
121 // material.bind(&mut render_pass);
122 // draw_mesh(&mesh);
123
124 // Begin frame
125 let Some(frame) = self.window.begin_frame() else {
126 return; // Surface not available
127 };
128
129 {
130 let _pass = frame
131 .render_pass()
132 .clear_color(Color::from_rgb_u8(20, 30, 40))
133 .label("material_system_pass")
134 .build();
135 // Materials would be applied here in actual rendering
136 // This is a conceptual demonstration
137 }
138 // Frame auto-submits on drop
139 }431 fn render(
432 &mut self,
433 _ctx: &mut astrelis_winit::app::AppCtx,
434 window_id: WindowId,
435 events: &mut astrelis_winit::event::EventBatch,
436 ) {
437 let Some(window) = self.windows.get_mut(&window_id) else {
438 return;
439 };
440
441 // Handle resize
442 events.dispatch(|event| {
443 if let astrelis_winit::event::Event::WindowResized(size) = event {
444 window.resized(*size);
445 astrelis_winit::event::HandleStatus::consumed()
446 } else {
447 astrelis_winit::event::HandleStatus::ignored()
448 }
449 });
450
451 let Some(frame) = window.begin_frame() else {
452 return; // Surface not available
453 };
454 {
455 let mut pass = frame
456 .render_pass()
457 .clear_color(Color::rgb(0.1, 0.1, 0.15))
458 .label("sprite_sheet_pass")
459 .build();
460 pass.set_pipeline(&self.pipeline);
461 pass.set_bind_group(0, &self.bind_group, &[]);
462 pass.set_vertex_buffer(0, self.vertex_buffer.slice(..));
463 pass.draw(0..6, 0..1);
464 }
465 // Frame auto-submits on drop
466 }Sourcepub fn load_color(self) -> Self
pub fn load_color(self) -> Self
Load existing color contents (default).
Sourcepub fn depth_attachment(self, view: &'f TextureView) -> Self
pub fn depth_attachment(self, view: &'f TextureView) -> Self
Set the depth attachment.
Examples found in repository?
370 fn render(
371 &mut self,
372 _ctx: &mut astrelis_winit::app::AppCtx,
373 window_id: WindowId,
374 events: &mut astrelis_winit::event::EventBatch,
375 ) {
376 // Handle resize and get dimensions (scoped to release window borrow)
377 let (phys_width, phys_height) = {
378 let Some(window) = self.windows.get_mut(&window_id) else {
379 return;
380 };
381
382 events.dispatch(|event| {
383 if let astrelis_winit::event::Event::WindowResized(size) = event {
384 window.resized(*size);
385 astrelis_winit::event::HandleStatus::consumed()
386 } else {
387 astrelis_winit::event::HandleStatus::ignored()
388 }
389 });
390
391 let phys = window.physical_size();
392 (phys.width, phys.height)
393 };
394
395 let width = phys_width as f32;
396 let height = phys_height as f32;
397
398 if width < 1.0 || height < 1.0 {
399 return;
400 }
401
402 // Ensure depth buffer matches viewport
403 self.ensure_depth_buffer(phys_width, phys_height);
404
405 // Build instances and prepare GPU data
406 let instances = self.build_instances(width, height);
407 let batch = DrawBatch2D {
408 instances,
409 textures: vec![],
410 projection: Self::ortho_projection(width, height),
411 };
412 self.renderer.prepare(&batch);
413
414 let stats = self.renderer.stats();
415 if self.frame_count % 120 == 0 {
416 tracing::info!(
417 "Frame {}: {} instances ({} opaque, {} transparent), {} draw calls",
418 self.frame_count,
419 stats.instance_count,
420 stats.opaque_count,
421 stats.transparent_count,
422 stats.draw_calls,
423 );
424 }
425
426 // Re-borrow window for rendering
427 let window = self.windows.get_mut(&window_id).unwrap();
428 let Some(frame) = window.begin_frame() else {
429 return; // Surface not available
430 };
431
432 // Create render pass with depth stencil attachment
433 {
434 let mut pass = frame
435 .render_pass()
436 .clear_color(Color::rgba(0.08, 0.08, 0.1, 1.0))
437 .depth_attachment(&self.depth_view)
438 .clear_depth(0.0) // 0.0 = far with GreaterEqual
439 .label("batched_example_pass")
440 .build();
441 self.renderer.render(pass.wgpu_pass());
442 }
443 // Frame auto-submits on drop
444 }Sourcepub fn with_window_depth(self) -> Self
pub fn with_window_depth(self) -> Self
Use the window’s depth buffer automatically.
§Panics
Panics if the window doesn’t have a depth buffer.
Sourcepub fn with_window_depth_if_available(self) -> Self
pub fn with_window_depth_if_available(self) -> Self
Use the window’s depth buffer if available.
Sourcepub fn clear_depth(self, value: f32) -> Self
pub fn clear_depth(self, value: f32) -> Self
Clear the depth buffer to the specified value.
Examples found in repository?
370 fn render(
371 &mut self,
372 _ctx: &mut astrelis_winit::app::AppCtx,
373 window_id: WindowId,
374 events: &mut astrelis_winit::event::EventBatch,
375 ) {
376 // Handle resize and get dimensions (scoped to release window borrow)
377 let (phys_width, phys_height) = {
378 let Some(window) = self.windows.get_mut(&window_id) else {
379 return;
380 };
381
382 events.dispatch(|event| {
383 if let astrelis_winit::event::Event::WindowResized(size) = event {
384 window.resized(*size);
385 astrelis_winit::event::HandleStatus::consumed()
386 } else {
387 astrelis_winit::event::HandleStatus::ignored()
388 }
389 });
390
391 let phys = window.physical_size();
392 (phys.width, phys.height)
393 };
394
395 let width = phys_width as f32;
396 let height = phys_height as f32;
397
398 if width < 1.0 || height < 1.0 {
399 return;
400 }
401
402 // Ensure depth buffer matches viewport
403 self.ensure_depth_buffer(phys_width, phys_height);
404
405 // Build instances and prepare GPU data
406 let instances = self.build_instances(width, height);
407 let batch = DrawBatch2D {
408 instances,
409 textures: vec![],
410 projection: Self::ortho_projection(width, height),
411 };
412 self.renderer.prepare(&batch);
413
414 let stats = self.renderer.stats();
415 if self.frame_count % 120 == 0 {
416 tracing::info!(
417 "Frame {}: {} instances ({} opaque, {} transparent), {} draw calls",
418 self.frame_count,
419 stats.instance_count,
420 stats.opaque_count,
421 stats.transparent_count,
422 stats.draw_calls,
423 );
424 }
425
426 // Re-borrow window for rendering
427 let window = self.windows.get_mut(&window_id).unwrap();
428 let Some(frame) = window.begin_frame() else {
429 return; // Surface not available
430 };
431
432 // Create render pass with depth stencil attachment
433 {
434 let mut pass = frame
435 .render_pass()
436 .clear_color(Color::rgba(0.08, 0.08, 0.1, 1.0))
437 .depth_attachment(&self.depth_view)
438 .clear_depth(0.0) // 0.0 = far with GreaterEqual
439 .label("batched_example_pass")
440 .build();
441 self.renderer.render(pass.wgpu_pass());
442 }
443 // Frame auto-submits on drop
444 }Sourcepub fn load_depth(self) -> Self
pub fn load_depth(self) -> Self
Load existing depth values.
Sourcepub fn depth_readonly(self) -> Self
pub fn depth_readonly(self) -> Self
Use depth in read-only mode (no writes).
Sourcepub fn label(self, name: impl Into<String>) -> Self
pub fn label(self, name: impl Into<String>) -> Self
Set a debug label for the render pass.
Examples found in repository?
89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("camera_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }More examples
91 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
92 if window_id != self.window_id {
93 return;
94 }
95
96 events.dispatch(|event| {
97 if let astrelis_winit::event::Event::WindowResized(size) = event {
98 self.window.resized(*size);
99 astrelis_winit::event::HandleStatus::consumed()
100 } else {
101 astrelis_winit::event::HandleStatus::ignored()
102 }
103 });
104
105 let Some(frame) = self.window.begin_frame() else {
106 return; // Surface not available
107 };
108 {
109 let _pass = frame
110 .render_pass()
111 .clear_color(Color::from_rgb_u8(20, 30, 40))
112 .label("mesh_primitives_pass")
113 .build();
114 }
115 // Frame auto-submits on drop
116 }89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("render_graph_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }86 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
87 // Get the color for this window
88 let Some(&color) = self.window_colors.get(&window_id) else {
89 return;
90 };
91
92 // WindowManager automatically handles:
93 // 1. Window lookup (no manual HashMap.get_mut)
94 // 2. Resize events (automatic)
95 // 3. Event dispatching
96 self.window_manager
97 .render_window(window_id, events, |window, _events| {
98 // No need to manually handle resize events!
99 // WindowManager already did that for us
100
101 // Just render!
102 let Some(frame) = window.begin_frame() else {
103 return; // Surface not available
104 };
105
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(color)
110 .label("window_manager_pass")
111 .build();
112 // Additional rendering would go here
113 }
114 // Frame auto-submits on drop
115 });
116 }105 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
106 if window_id != self.window_id {
107 return;
108 }
109
110 // Handle resize
111 events.dispatch(|event| {
112 if let astrelis_winit::event::Event::WindowResized(size) = event {
113 self.window.resized(*size);
114 astrelis_winit::event::HandleStatus::consumed()
115 } else {
116 astrelis_winit::event::HandleStatus::ignored()
117 }
118 });
119
120 // In a real application, materials would be bound during rendering:
121 // material.bind(&mut render_pass);
122 // draw_mesh(&mesh);
123
124 // Begin frame
125 let Some(frame) = self.window.begin_frame() else {
126 return; // Surface not available
127 };
128
129 {
130 let _pass = frame
131 .render_pass()
132 .clear_color(Color::from_rgb_u8(20, 30, 40))
133 .label("material_system_pass")
134 .build();
135 // Materials would be applied here in actual rendering
136 // This is a conceptual demonstration
137 }
138 // Frame auto-submits on drop
139 }431 fn render(
432 &mut self,
433 _ctx: &mut astrelis_winit::app::AppCtx,
434 window_id: WindowId,
435 events: &mut astrelis_winit::event::EventBatch,
436 ) {
437 let Some(window) = self.windows.get_mut(&window_id) else {
438 return;
439 };
440
441 // Handle resize
442 events.dispatch(|event| {
443 if let astrelis_winit::event::Event::WindowResized(size) = event {
444 window.resized(*size);
445 astrelis_winit::event::HandleStatus::consumed()
446 } else {
447 astrelis_winit::event::HandleStatus::ignored()
448 }
449 });
450
451 let Some(frame) = window.begin_frame() else {
452 return; // Surface not available
453 };
454 {
455 let mut pass = frame
456 .render_pass()
457 .clear_color(Color::rgb(0.1, 0.1, 0.15))
458 .label("sprite_sheet_pass")
459 .build();
460 pass.set_pipeline(&self.pipeline);
461 pass.set_bind_group(0, &self.bind_group, &[]);
462 pass.set_vertex_buffer(0, self.vertex_buffer.slice(..));
463 pass.draw(0..6, 0..1);
464 }
465 // Frame auto-submits on drop
466 }Sourcepub fn build(self) -> RenderPass<'f>
pub fn build(self) -> RenderPass<'f>
Build and return the render pass.
The pass owns its encoder. When dropped, it ends the pass, finishes the encoder, and adds the command buffer to the frame.
Examples found in repository?
89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("camera_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }More examples
91 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
92 if window_id != self.window_id {
93 return;
94 }
95
96 events.dispatch(|event| {
97 if let astrelis_winit::event::Event::WindowResized(size) = event {
98 self.window.resized(*size);
99 astrelis_winit::event::HandleStatus::consumed()
100 } else {
101 astrelis_winit::event::HandleStatus::ignored()
102 }
103 });
104
105 let Some(frame) = self.window.begin_frame() else {
106 return; // Surface not available
107 };
108 {
109 let _pass = frame
110 .render_pass()
111 .clear_color(Color::from_rgb_u8(20, 30, 40))
112 .label("mesh_primitives_pass")
113 .build();
114 }
115 // Frame auto-submits on drop
116 }89 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
90 if window_id != self.window_id {
91 return;
92 }
93
94 events.dispatch(|event| {
95 if let astrelis_winit::event::Event::WindowResized(size) = event {
96 self.window.resized(*size);
97 astrelis_winit::event::HandleStatus::consumed()
98 } else {
99 astrelis_winit::event::HandleStatus::ignored()
100 }
101 });
102
103 let Some(frame) = self.window.begin_frame() else {
104 return; // Surface not available
105 };
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(Color::from_rgb_u8(20, 30, 40))
110 .label("render_graph_demo_pass")
111 .build();
112 }
113 // Frame auto-submits on drop
114 }86 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
87 // Get the color for this window
88 let Some(&color) = self.window_colors.get(&window_id) else {
89 return;
90 };
91
92 // WindowManager automatically handles:
93 // 1. Window lookup (no manual HashMap.get_mut)
94 // 2. Resize events (automatic)
95 // 3. Event dispatching
96 self.window_manager
97 .render_window(window_id, events, |window, _events| {
98 // No need to manually handle resize events!
99 // WindowManager already did that for us
100
101 // Just render!
102 let Some(frame) = window.begin_frame() else {
103 return; // Surface not available
104 };
105
106 {
107 let _pass = frame
108 .render_pass()
109 .clear_color(color)
110 .label("window_manager_pass")
111 .build();
112 // Additional rendering would go here
113 }
114 // Frame auto-submits on drop
115 });
116 }105 fn render(&mut self, _ctx: &mut AppCtx, window_id: WindowId, events: &mut EventBatch) {
106 if window_id != self.window_id {
107 return;
108 }
109
110 // Handle resize
111 events.dispatch(|event| {
112 if let astrelis_winit::event::Event::WindowResized(size) = event {
113 self.window.resized(*size);
114 astrelis_winit::event::HandleStatus::consumed()
115 } else {
116 astrelis_winit::event::HandleStatus::ignored()
117 }
118 });
119
120 // In a real application, materials would be bound during rendering:
121 // material.bind(&mut render_pass);
122 // draw_mesh(&mesh);
123
124 // Begin frame
125 let Some(frame) = self.window.begin_frame() else {
126 return; // Surface not available
127 };
128
129 {
130 let _pass = frame
131 .render_pass()
132 .clear_color(Color::from_rgb_u8(20, 30, 40))
133 .label("material_system_pass")
134 .build();
135 // Materials would be applied here in actual rendering
136 // This is a conceptual demonstration
137 }
138 // Frame auto-submits on drop
139 }431 fn render(
432 &mut self,
433 _ctx: &mut astrelis_winit::app::AppCtx,
434 window_id: WindowId,
435 events: &mut astrelis_winit::event::EventBatch,
436 ) {
437 let Some(window) = self.windows.get_mut(&window_id) else {
438 return;
439 };
440
441 // Handle resize
442 events.dispatch(|event| {
443 if let astrelis_winit::event::Event::WindowResized(size) = event {
444 window.resized(*size);
445 astrelis_winit::event::HandleStatus::consumed()
446 } else {
447 astrelis_winit::event::HandleStatus::ignored()
448 }
449 });
450
451 let Some(frame) = window.begin_frame() else {
452 return; // Surface not available
453 };
454 {
455 let mut pass = frame
456 .render_pass()
457 .clear_color(Color::rgb(0.1, 0.1, 0.15))
458 .label("sprite_sheet_pass")
459 .build();
460 pass.set_pipeline(&self.pipeline);
461 pass.set_bind_group(0, &self.bind_group, &[]);
462 pass.set_vertex_buffer(0, self.vertex_buffer.slice(..));
463 pass.draw(0..6, 0..1);
464 }
465 // Frame auto-submits on drop
466 }Auto Trait Implementations§
impl<'f, 'w> Freeze for RenderPassBuilder<'f, 'w>
impl<'f, 'w> !RefUnwindSafe for RenderPassBuilder<'f, 'w>
impl<'f, 'w> !Send for RenderPassBuilder<'f, 'w>
impl<'f, 'w> !Sync for RenderPassBuilder<'f, 'w>
impl<'f, 'w> Unpin for RenderPassBuilder<'f, 'w>
impl<'f, 'w> !UnwindSafe for RenderPassBuilder<'f, 'w>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more