Skip to content

Commit

Permalink
subgroup: doc comments for subgroup Statements and Expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
exrook committed Oct 21, 2023
1 parent ef0bd1c commit 62c9cb0
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,9 +1446,7 @@ pub enum Expression {
///
/// For [`TypeInner::Atomic`] the result is a corresponding scalar.
/// For other types behind the `pointer<T>`, the result is `T`.
Load {
pointer: Handle<Expression>,
},
Load { pointer: Handle<Expression> },
/// Sample a point from a sampled or a depth image.
ImageSample {
image: Handle<Expression>,
Expand Down Expand Up @@ -1588,10 +1586,7 @@ pub enum Expression {
/// Result of calling another function.
CallResult(Handle<Function>),
/// Result of an atomic operation.
AtomicResult {
ty: Handle<Type>,
comparison: bool,
},
AtomicResult { ty: Handle<Type>, comparison: bool },
/// Result of a [`WorkGroupUniformLoad`] statement.
///
/// [`WorkGroupUniformLoad`]: Statement::WorkGroupUniformLoad
Expand Down Expand Up @@ -1619,10 +1614,15 @@ pub enum Expression {
query: Handle<Expression>,
committed: bool,
},
/// Result of a [`SubgroupBallot`] statement.
///
/// [`SubgroupBallot`]: Statement::SubgroupBallot
SubgroupBallotResult,
SubgroupOperationResult {
ty: Handle<Type>,
},
/// Result of a [`SubgroupCollectiveOperation`] or [`SubgroupGather`] statement.
///
/// [`SubgroupCollectiveOperation`]: Statement::SubgroupCollectiveOperation
/// [`SubgroupGather`]: Statement::SubgroupGather
SubgroupOperationResult { ty: Handle<Type> },
}

pub use block::Block;
Expand Down Expand Up @@ -1895,7 +1895,7 @@ pub enum Statement {
/// The specific operation we're performing on `query`.
fun: RayQueryFunction,
},
// subgroupBallot(bool) -> vec4<u32>
/// Calculate a bitmask using a boolean from each active thread in the subgroup
SubgroupBallot {
/// The [`SubgroupBallotResult`] expression representing this load's result.
///
Expand All @@ -1904,7 +1904,7 @@ pub enum Statement {
/// The value from this thread to store in the ballot
predicate: Option<Handle<Expression>>,
},

/// Gather a value from another active thread in the subgroup
SubgroupGather {
/// Specifies which thread to gather from
mode: GatherMode,
Expand All @@ -1915,8 +1915,7 @@ pub enum Statement {
/// [`SubgroupOperationResult`]: Expression::SubgroupOperationResult
result: Handle<Expression>,
},

/// Compute a collective operation across all active threads in th subgroup
/// Compute a collective operation across all active threads in the subgroup
SubgroupCollectiveOperation {
/// What operation to compute
op: SubgroupOperation,
Expand Down

0 comments on commit 62c9cb0

Please sign in to comment.