Skip to content

Commit a4fb29b

Browse files
committed
[fix] documentation.
1 parent 484b182 commit a4fb29b

File tree

17 files changed

+63
-63
lines changed

17 files changed

+63
-63
lines changed

crates/lambda-rs-args/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ pub struct ArgumentParser {
3636
is_subcommand: bool,
3737
}
3838

39-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
4039
/// Supported value types for an argument definition.
40+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
4141
pub enum ArgumentType {
4242
/// `true`/`false` (or implied by presence when compiled as a flag).
4343
Boolean,
@@ -61,8 +61,8 @@ pub enum ArgumentType {
6161
DoubleList,
6262
}
6363

64-
#[derive(Debug, Clone, PartialEq, PartialOrd)]
6564
/// Parsed value container used in results and defaults.
65+
#[derive(Debug, Clone, PartialEq, PartialOrd)]
6666
pub enum ArgumentValue {
6767
None,
6868
Boolean(bool),
@@ -112,8 +112,8 @@ impl Into<f64> for ArgumentValue {
112112
}
113113
}
114114

115-
#[derive(Debug)]
116115
/// Declarative definition for a single CLI argument or positional parameter.
116+
#[derive(Debug)]
117117
pub struct Argument {
118118
name: String,
119119
description: String,
@@ -222,8 +222,8 @@ impl Argument {
222222
}
223223
}
224224

225-
#[derive(Debug, Clone)]
226225
/// A single parsed argument result as `(name, value)`.
226+
#[derive(Debug, Clone)]
227227
pub struct ParsedArgument {
228228
name: String,
229229
value: ArgumentValue,
@@ -830,8 +830,8 @@ fn parse_value(arg: &Argument, raw: &str) -> Result<ArgumentValue, ArgsError> {
830830
}
831831
}
832832

833-
#[derive(Debug)]
834833
/// Errors that may occur during argument parsing.
834+
#[derive(Debug)]
835835
pub enum ArgsError {
836836
/// An unknown flag or option was encountered.
837837
UnknownArgument(String),

crates/lambda-rs-platform/src/wgpu/bind.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use crate::wgpu::{
1313
gpu::Gpu,
1414
};
1515

16-
#[derive(Debug)]
1716
/// Wrapper around `wgpu::BindGroupLayout` that preserves a label.
17+
#[derive(Debug)]
1818
pub struct BindGroupLayout {
1919
pub(crate) raw: wgpu::BindGroupLayout,
2020
pub(crate) label: Option<String>,
@@ -32,8 +32,8 @@ impl BindGroupLayout {
3232
}
3333
}
3434

35-
#[derive(Debug)]
3635
/// Wrapper around `wgpu::BindGroup` that preserves a label.
36+
#[derive(Debug)]
3737
pub struct BindGroup {
3838
pub(crate) raw: wgpu::BindGroup,
3939
pub(crate) label: Option<String>,
@@ -51,8 +51,8 @@ impl BindGroup {
5151
}
5252
}
5353

54-
#[derive(Clone, Copy, Debug)]
5554
/// Visibility of a binding across shader stages.
55+
#[derive(Clone, Copy, Debug)]
5656
pub enum Visibility {
5757
Vertex,
5858
Fragment,
@@ -99,8 +99,8 @@ mod tests {
9999
}
100100
}
101101

102-
#[derive(Default)]
103102
/// Builder for creating a `wgpu::BindGroupLayout`.
103+
#[derive(Default)]
104104
pub struct BindGroupLayoutBuilder {
105105
label: Option<String>,
106106
entries: Vec<wgpu::BindGroupLayoutEntry>,
@@ -171,8 +171,8 @@ impl BindGroupLayoutBuilder {
171171
}
172172
}
173173

174-
#[derive(Default)]
175174
/// Builder for creating a `wgpu::BindGroup`.
175+
#[derive(Default)]
176176
pub struct BindGroupBuilder<'a> {
177177
label: Option<String>,
178178
layout: Option<&'a wgpu::BindGroupLayout>,

crates/lambda-rs-platform/src/wgpu/buffer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use wgpu::{
1010

1111
use crate::wgpu::gpu::Gpu;
1212

13-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1413
/// Index format for indexed drawing.
14+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1515
pub enum IndexFormat {
1616
Uint16,
1717
Uint32,
@@ -26,8 +26,8 @@ impl IndexFormat {
2626
}
2727
}
2828

29-
#[derive(Clone, Copy, Debug)]
3029
/// Platform buffer usage flags.
30+
#[derive(Clone, Copy, Debug)]
3131
pub struct Usage(pub(crate) wgpu::BufferUsages);
3232

3333
impl Usage {
@@ -60,8 +60,8 @@ impl Default for Usage {
6060
}
6161
}
6262

63-
#[derive(Debug)]
6463
/// Wrapper around `wgpu::Buffer` with metadata.
64+
#[derive(Debug)]
6565
pub struct Buffer {
6666
pub(crate) raw: wgpu::Buffer,
6767
pub(crate) label: Option<String>,
@@ -96,8 +96,8 @@ impl Buffer {
9696
}
9797
}
9898

99-
#[derive(Default)]
10099
/// Builder for creating a `Buffer` with optional initial contents.
100+
#[derive(Default)]
101101
pub struct BufferBuilder {
102102
label: Option<String>,
103103
size: usize,

crates/lambda-rs-platform/src/wgpu/command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
55
use super::gpu;
66

7-
#[derive(Debug)]
87
/// Thin wrapper around `wgpu::CommandEncoder` with convenience helpers.
8+
#[derive(Debug)]
99
pub struct CommandEncoder {
1010
raw: wgpu::CommandEncoder,
1111
}
1212

13-
#[derive(Debug)]
1413
/// Wrapper around `wgpu::CommandBuffer` to avoid exposing raw types upstream.
14+
#[derive(Debug)]
1515
pub struct CommandBuffer {
1616
raw: wgpu::CommandBuffer,
1717
}

crates/lambda-rs-platform/src/wgpu/gpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ impl GpuBuilder {
165165
}
166166
}
167167

168-
#[derive(Debug)]
169168
/// Errors emitted while building a `Gpu`.
169+
#[derive(Debug)]
170170
pub enum GpuBuildError {
171171
/// No compatible adapter could be found.
172172
AdapterUnavailable,
@@ -185,9 +185,9 @@ impl From<wgpu::RequestDeviceError> for GpuBuildError {
185185
}
186186
}
187187

188-
#[derive(Debug)]
189188
/// Holds the chosen adapter along with its logical device and submission queue
190189
/// plus immutable copies of features and limits used to create the device.
190+
#[derive(Debug)]
191191
pub struct Gpu {
192192
adapter: wgpu::Adapter,
193193
device: wgpu::Device,

crates/lambda-rs-platform/src/wgpu/instance.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
use pollster::block_on;
66

7-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
87
/// Wrapper over `wgpu::Backends` as a bitset.
8+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99
pub struct Backends(wgpu::Backends);
1010

1111
impl Backends {
@@ -40,8 +40,8 @@ impl std::ops::BitOr for Backends {
4040
}
4141
}
4242

43-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
4443
/// Wrapper over `wgpu::InstanceFlags` as a bitset.
44+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
4545
pub struct InstanceFlags(wgpu::InstanceFlags);
4646

4747
impl InstanceFlags {
@@ -69,8 +69,8 @@ impl std::ops::BitOr for InstanceFlags {
6969
}
7070
}
7171

72-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7372
/// Which DX12 shader compiler to use on Windows platforms.
73+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7474
pub enum Dx12Compiler {
7575
Fxc,
7676
}
@@ -83,8 +83,8 @@ impl Dx12Compiler {
8383
}
8484
}
8585

86-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8786
/// OpenGL ES 3 minor version (used by GL/Web targets).
87+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8888
pub enum Gles3MinorVersion {
8989
Automatic,
9090
Version0,
@@ -103,8 +103,8 @@ impl Gles3MinorVersion {
103103
}
104104
}
105105

106-
#[derive(Debug, Clone)]
107106
/// Builder for creating a `wgpu::Instance` with consistent defaults.
107+
#[derive(Debug, Clone)]
108108
///
109109
/// Defaults to primary backends and no special flags. Options map to
110110
/// `wgpu::InstanceDescriptor` internally without leaking raw types.

crates/lambda-rs-platform/src/wgpu/pipeline.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::wgpu::{
1111
vertex::ColorFormat,
1212
};
1313

14-
#[derive(Clone, Copy, Debug)]
1514
/// Shader stage flags for push constants and visibility.
15+
#[derive(Clone, Copy, Debug)]
1616
///
1717
/// This wrapper avoids exposing `wgpu` directly to higher layers while still
1818
/// allowing flexible combinations when needed.
@@ -47,15 +47,15 @@ impl std::ops::BitOrAssign for PipelineStage {
4747
}
4848
}
4949

50-
#[derive(Clone, Debug)]
5150
/// Push constant declaration for a stage and byte range.
51+
#[derive(Clone, Debug)]
5252
pub struct PushConstantRange {
5353
pub stages: PipelineStage,
5454
pub range: Range<u32>,
5555
}
5656

57-
#[derive(Clone, Copy, Debug)]
5857
/// Face culling mode for graphics pipelines.
58+
#[derive(Clone, Copy, Debug)]
5959
pub enum CullingMode {
6060
None,
6161
Front,
@@ -72,16 +72,16 @@ impl CullingMode {
7272
}
7373
}
7474

75-
#[derive(Clone, Copy, Debug)]
7675
/// Description of a single vertex attribute used by a pipeline.
76+
#[derive(Clone, Copy, Debug)]
7777
pub struct VertexAttributeDesc {
7878
pub shader_location: u32,
7979
pub offset: u64,
8080
pub format: ColorFormat,
8181
}
8282

83-
#[derive(Debug)]
8483
/// Wrapper around `wgpu::ShaderModule` that preserves a label.
84+
#[derive(Debug)]
8585
pub struct ShaderModule {
8686
raw: wgpu::ShaderModule,
8787
label: Option<String>,
@@ -108,8 +108,8 @@ impl ShaderModule {
108108
}
109109
}
110110

111-
#[derive(Debug)]
112111
/// Wrapper around `wgpu::PipelineLayout`.
112+
#[derive(Debug)]
113113
pub struct PipelineLayout {
114114
raw: wgpu::PipelineLayout,
115115
label: Option<String>,
@@ -185,8 +185,8 @@ impl<'a> PipelineLayoutBuilder<'a> {
185185
}
186186
}
187187

188-
#[derive(Debug)]
189188
/// Wrapper around `wgpu::RenderPipeline`.
189+
#[derive(Debug)]
190190
pub struct RenderPipeline {
191191
raw: wgpu::RenderPipeline,
192192
label: Option<String>,

crates/lambda-rs-platform/src/wgpu/render_pass.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ use super::{
2020
surface,
2121
};
2222

23-
#[derive(Clone, Copy, Debug, PartialEq)]
2423
/// Color load operation for a render pass color attachment.
24+
#[derive(Clone, Copy, Debug, PartialEq)]
2525
pub enum ColorLoadOp {
2626
/// Load the existing contents of the attachment.
2727
Load,
2828
/// Clear the attachment to the provided RGBA color.
2929
Clear([f64; 4]),
3030
}
3131

32-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3332
/// Store operation for a render pass attachment.
33+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3434
pub enum StoreOp {
3535
/// Store the results to the attachment at the end of the pass.
3636
Store,
3737
/// Discard the results at the end of the pass when possible.
3838
Discard,
3939
}
4040

41-
#[derive(Clone, Copy, Debug)]
4241
/// Combined load and store operations for the color attachment.
42+
#[derive(Clone, Copy, Debug)]
4343
pub struct ColorOperations {
4444
pub load: ColorLoadOp,
4545
pub store: StoreOp,
@@ -54,16 +54,16 @@ impl Default for ColorOperations {
5454
}
5555
}
5656

57-
#[derive(Clone, Debug, Default)]
5857
/// Configuration for beginning a render pass.
58+
#[derive(Clone, Debug, Default)]
5959
pub struct RenderPassConfig {
6060
pub label: Option<String>,
6161
pub color_operations: ColorOperations,
6262
}
6363

64-
#[derive(Debug)]
6564
/// Wrapper around `wgpu::RenderPass<'_>` exposing the operations needed by the
6665
/// engine without leaking raw `wgpu` types at the call sites.
66+
#[derive(Debug)]
6767
pub struct RenderPass<'a> {
6868
pub(super) raw: wgpu::RenderPass<'a>,
6969
}
@@ -151,10 +151,10 @@ impl<'a> RenderPass<'a> {
151151
}
152152
}
153153

154-
#[derive(Debug, Default)]
155154
/// Wrapper for a variably sized list of color attachments passed into a render
156155
/// pass. The attachments borrow `TextureView` references for the duration of
157156
/// the pass.
157+
#[derive(Debug, Default)]
158158
pub struct RenderColorAttachments<'a> {
159159
attachments: Vec<Option<wgpu::RenderPassColorAttachment<'a>>>,
160160
}

0 commit comments

Comments
 (0)