summaryrefslogtreecommitdiffstats
path: root/third_party/rust/naga/src/back/dot/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/naga/src/back/dot/mod.rs')
-rw-r--r--third_party/rust/naga/src/back/dot/mod.rs91
1 files changed, 91 insertions, 0 deletions
diff --git a/third_party/rust/naga/src/back/dot/mod.rs b/third_party/rust/naga/src/back/dot/mod.rs
index 1556371df1..9a7702b3f6 100644
--- a/third_party/rust/naga/src/back/dot/mod.rs
+++ b/third_party/rust/naga/src/back/dot/mod.rs
@@ -279,6 +279,94 @@ impl StatementGraph {
crate::RayQueryFunction::Terminate => "RayQueryTerminate",
}
}
+ S::SubgroupBallot { result, predicate } => {
+ if let Some(predicate) = predicate {
+ self.dependencies.push((id, predicate, "predicate"));
+ }
+ self.emits.push((id, result));
+ "SubgroupBallot"
+ }
+ S::SubgroupCollectiveOperation {
+ op,
+ collective_op,
+ argument,
+ result,
+ } => {
+ self.dependencies.push((id, argument, "arg"));
+ self.emits.push((id, result));
+ match (collective_op, op) {
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::All) => {
+ "SubgroupAll"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Any) => {
+ "SubgroupAny"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Add) => {
+ "SubgroupAdd"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Mul) => {
+ "SubgroupMul"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Max) => {
+ "SubgroupMax"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Min) => {
+ "SubgroupMin"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::And) => {
+ "SubgroupAnd"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Or) => {
+ "SubgroupOr"
+ }
+ (crate::CollectiveOperation::Reduce, crate::SubgroupOperation::Xor) => {
+ "SubgroupXor"
+ }
+ (
+ crate::CollectiveOperation::ExclusiveScan,
+ crate::SubgroupOperation::Add,
+ ) => "SubgroupExclusiveAdd",
+ (
+ crate::CollectiveOperation::ExclusiveScan,
+ crate::SubgroupOperation::Mul,
+ ) => "SubgroupExclusiveMul",
+ (
+ crate::CollectiveOperation::InclusiveScan,
+ crate::SubgroupOperation::Add,
+ ) => "SubgroupInclusiveAdd",
+ (
+ crate::CollectiveOperation::InclusiveScan,
+ crate::SubgroupOperation::Mul,
+ ) => "SubgroupInclusiveMul",
+ _ => unimplemented!(),
+ }
+ }
+ S::SubgroupGather {
+ mode,
+ argument,
+ result,
+ } => {
+ match mode {
+ crate::GatherMode::BroadcastFirst => {}
+ crate::GatherMode::Broadcast(index)
+ | crate::GatherMode::Shuffle(index)
+ | crate::GatherMode::ShuffleDown(index)
+ | crate::GatherMode::ShuffleUp(index)
+ | crate::GatherMode::ShuffleXor(index) => {
+ self.dependencies.push((id, index, "index"))
+ }
+ }
+ self.dependencies.push((id, argument, "arg"));
+ self.emits.push((id, result));
+ match mode {
+ crate::GatherMode::BroadcastFirst => "SubgroupBroadcastFirst",
+ crate::GatherMode::Broadcast(_) => "SubgroupBroadcast",
+ crate::GatherMode::Shuffle(_) => "SubgroupShuffle",
+ crate::GatherMode::ShuffleDown(_) => "SubgroupShuffleDown",
+ crate::GatherMode::ShuffleUp(_) => "SubgroupShuffleUp",
+ crate::GatherMode::ShuffleXor(_) => "SubgroupShuffleXor",
+ }
+ }
};
// Set the last node to the merge node
last_node = merge_id;
@@ -404,6 +492,7 @@ fn write_function_expressions(
let (label, color_id) = match *expression {
E::Literal(_) => ("Literal".into(), 2),
E::Constant(_) => ("Constant".into(), 2),
+ E::Override(_) => ("Override".into(), 2),
E::ZeroValue(_) => ("ZeroValue".into(), 2),
E::Compose { ref components, .. } => {
payload = Some(Payload::Arguments(components));
@@ -586,6 +675,8 @@ fn write_function_expressions(
let ty = if committed { "Committed" } else { "Candidate" };
(format!("rayQueryGet{}Intersection", ty).into(), 4)
}
+ E::SubgroupBallotResult => ("SubgroupBallotResult".into(), 4),
+ E::SubgroupOperationResult { .. } => ("SubgroupOperationResult".into(), 4),
};
// give uniform expressions an outline