Skip to content

Conversation

@vmarcella
Copy link
Member

No description provided.

@vmarcella vmarcella requested a review from Copilot November 2, 2025 00:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors render pipeline creation by introducing builder patterns in the platform layer. The changes extract shader module creation, pipeline layout construction, and render pipeline building from the application layer into reusable platform-layer builders.

  • Adds new builder types (ShaderModule, PipelineLayoutBuilder, RenderPipelineBuilder) to the platform layer
  • Migrates render pipeline construction from verbose wgpu descriptor creation to a cleaner builder-based API
  • Simplifies the application-layer pipeline code by delegating low-level wgpu details to the platform layer

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
crates/lambda-rs-platform/src/wgpu/pipeline.rs New platform-layer module providing builders for shader modules, pipeline layouts, and render pipelines
crates/lambda-rs-platform/src/wgpu/mod.rs Adds the new pipeline module to the platform layer's public API
crates/lambda-rs/src/render/pipeline.rs Refactored to use the new platform-layer builders, removing direct wgpu descriptor construction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 5 to 7
#[derive(Debug)]
/// Wrapper around `wgpu::ShaderModule` that preserves a label.
pub struct ShaderModule {
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment should appear before the derive attribute, not between it and the struct declaration. Move the doc comment above line 5.

Copilot uses AI. Check for mistakes.
Comment on lines 35 to 36
#[derive(Debug)]
/// Wrapper around `wgpu::PipelineLayout`.
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment should appear before the derive attribute, not between it and the struct declaration. Move the doc comment above line 35.

Suggested change
#[derive(Debug)]
/// Wrapper around `wgpu::PipelineLayout`.
/// Wrapper around `wgpu::PipelineLayout`.
#[derive(Debug)]

Copilot uses AI. Check for mistakes.
Comment on lines +56 to +58
impl<'a> PipelineLayoutBuilder<'a> {
/// New builder with no layouts or push constants.
pub fn new() -> Self {
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The builder implements new() but doesn't implement the Default trait. Either implement Default for PipelineLayoutBuilder or add #[allow(clippy::new_without_default)] to suppress the clippy warning.

Copilot uses AI. Check for mistakes.
@vmarcella vmarcella requested a review from Copilot November 3, 2025 23:53
@vmarcella vmarcella changed the title Add render pipeline abstractions Refactor rendering API Nov 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

#[derive(Clone, Debug)]
/// Public, engine-facing surface configuration that avoids exposing `wgpu`.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent hyphenation: 'engine-facing' should be 'engine‑facing' to match the endash style used elsewhere in the PR.

Suggested change
/// Public, engine-facing surface configuration that avoids exposing `wgpu`.
/// Public, enginefacing surface configuration that avoids exposing `wgpu`.

Copilot uses AI. Check for mistakes.
}

#[derive(Clone, Copy, Debug)]
/// Public, engine-facing subset of device limits.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent hyphenation: 'engine-facing' should be 'engine‑facing' to match the endash style used elsewhere in the PR.

Suggested change
/// Public, engine-facing subset of device limits.
/// Public, enginefacing subset of device limits.

Copilot uses AI. Check for mistakes.
Comment on lines +201 to +215
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn adapter(&self) -> &wgpu::Adapter {
&self.adapter
}

/// Borrow the logical device for resource creation.
///
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn device(&self) -> &wgpu::Device {
&self.device
}

/// Borrow the submission queue for command submission.
///
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent hyphenation: 'Crate-visible' should be 'Crate‑visible' to match the endash style used elsewhere in the PR.

Suggested change
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn adapter(&self) -> &wgpu::Adapter {
&self.adapter
}
/// Borrow the logical device for resource creation.
///
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn device(&self) -> &wgpu::Device {
&self.device
}
/// Borrow the submission queue for command submission.
///
/// Crate-visible to avoid exposing raw `wgpu` to higher layers.
/// Cratevisible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn adapter(&self) -> &wgpu::Adapter {
&self.adapter
}
/// Borrow the logical device for resource creation.
///
/// Cratevisible to avoid exposing raw `wgpu` to higher layers.
pub(crate) fn device(&self) -> &wgpu::Device {
&self.device
}
/// Borrow the submission queue for command submission.
///
/// Cratevisible to avoid exposing raw `wgpu` to higher layers.

Copilot uses AI. Check for mistakes.
@vmarcella vmarcella merged commit 07e221a into main Nov 7, 2025
5 checks passed
@vmarcella vmarcella deleted the vmarcella/refactor-render-pipeline branch November 7, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants