-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subgroup: drop the
non_uniform
from all subgroup functions, matchin…
…g glsl
- Loading branch information
1 parent
96f3959
commit 2502eb1
Showing
23 changed files
with
161 additions
and
204 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot::subgroup_ballot | ||
|
||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_ballot(predicate: bool) -> bool { | ||
let ballot = spirv_std::arch::subgroup_ballot(predicate); | ||
spirv_std::arch::subgroup_inverse_ballot(ballot) | ||
} | ||
|
||
#[spirv(compute(threads(1, 1, 1)))] | ||
pub fn main() { | ||
unsafe { | ||
subgroup_ballot(true); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot_bit_count::subgroup_ballot_bit_count | ||
|
||
use spirv_std::arch::{GroupOperation, SubgroupMask}; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_ballot_bit_count(ballot: SubgroupMask) -> u32 { | ||
spirv_std::arch::subgroup_ballot_bit_count::<{ GroupOperation::Reduce as u32 }>(ballot) | ||
} | ||
|
||
#[spirv(compute(threads(1, 1, 1)))] | ||
pub fn main() { | ||
unsafe { | ||
subgroup_ballot_bit_count(spirv_std::arch::subgroup_ballot(true)); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_broadcast_first::subgroup_broadcast_first | ||
|
||
use glam::Vec3; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_broadcast_first(vec: Vec3) -> Vec3 { | ||
spirv_std::arch::subgroup_broadcast_first::<Vec3>(vec) | ||
} | ||
|
||
#[spirv(compute(threads(1, 1, 1)))] | ||
pub fn main() { | ||
unsafe { | ||
subgroup_broadcast_first(Vec3::new(1., 2., 3.)); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_elect::subgroup_elect | ||
|
||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_elect() -> bool { | ||
spirv_std::arch::subgroup_elect() | ||
} | ||
|
||
#[spirv(compute(threads(1, 1, 1)))] | ||
pub fn main() { | ||
unsafe { | ||
subgroup_elect(); | ||
} | ||
} |
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...p/subgroup_non_uniform_i_add_clustered.rs → ...arch/subgroup/subgroup_i_add_clustered.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_non_uniform_i_add_clustered::subgroup_non_uniform_i_add_clustered | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_clustered::subgroup_i_add_clustered | ||
|
||
use glam::UVec3; | ||
use spirv_std::arch::{GroupOperation, SubgroupMask}; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_non_uniform_i_add_clustered(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_non_uniform_i_add_clustered::<8, _>(value) | ||
unsafe fn subgroup_i_add_clustered(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_i_add_clustered::<8, _>(value) | ||
} | ||
|
||
#[spirv(compute(threads(32, 1, 1)))] | ||
pub fn main(#[spirv(local_invocation_id)] local_invocation_id: UVec3) { | ||
unsafe { | ||
subgroup_non_uniform_i_add_clustered(local_invocation_id.x); | ||
subgroup_i_add_clustered(local_invocation_id.x); | ||
} | ||
} |
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...roup/subgroup_non_uniform_i_add_reduce.rs → ...subgroup/subgroup_i_add_exclusive_scan.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_non_uniform_i_add_reduce::subgroup_non_uniform_i_add_reduce | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_exclusive_scan::subgroup_i_add_exclusive_scan | ||
|
||
use glam::UVec3; | ||
use spirv_std::arch::{GroupOperation, SubgroupMask}; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_non_uniform_i_add_reduce(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_non_uniform_i_add::<{ GroupOperation::Reduce as u32 }, _>(value) | ||
unsafe fn subgroup_i_add_exclusive_scan(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_i_add::<{ GroupOperation::ExclusiveScan as u32 }, _>(value) | ||
} | ||
|
||
#[spirv(compute(threads(32, 1, 1)))] | ||
pub fn main(#[spirv(local_invocation_id)] local_invocation_id: UVec3) { | ||
unsafe { | ||
subgroup_non_uniform_i_add_reduce(local_invocation_id.x); | ||
subgroup_i_add_exclusive_scan(local_invocation_id.x); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_inclusive_scan::subgroup_i_add_inclusive_scan | ||
|
||
use glam::UVec3; | ||
use spirv_std::arch::{GroupOperation, SubgroupMask}; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_i_add_inclusive_scan(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_i_add::<{ GroupOperation::InclusiveScan as u32 }, _>(value) | ||
} | ||
|
||
#[spirv(compute(threads(32, 1, 1)))] | ||
pub fn main(#[spirv(local_invocation_id)] local_invocation_id: UVec3) { | ||
unsafe { | ||
subgroup_i_add_inclusive_scan(local_invocation_id.x); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// build-pass | ||
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+ext:SPV_KHR_vulkan_memory_model | ||
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_i_add_reduce::subgroup_i_add_reduce | ||
|
||
use glam::UVec3; | ||
use spirv_std::arch::{GroupOperation, SubgroupMask}; | ||
use spirv_std::spirv; | ||
|
||
unsafe fn subgroup_i_add_reduce(value: u32) -> u32 { | ||
spirv_std::arch::subgroup_i_add::<{ GroupOperation::Reduce as u32 }, _>(value) | ||
} | ||
|
||
#[spirv(compute(threads(32, 1, 1)))] | ||
pub fn main(#[spirv(local_invocation_id)] local_invocation_id: UVec3) { | ||
unsafe { | ||
subgroup_i_add_reduce(local_invocation_id.x); | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
tests/ui/arch/subgroup/subgroup_non_uniform_ballot_bit_count.rs
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
tests/ui/arch/subgroup/subgroup_non_uniform_broadcast_first.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
tests/ui/arch/subgroup/subgroup_non_uniform_i_add_exclusive_scan.rs
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
tests/ui/arch/subgroup/subgroup_non_uniform_i_add_inclusive_scan.rs
This file was deleted.
Oops, something went wrong.