mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-25 00:04:11 +00:00
Unbreak CI (fix control_barrier and memory_barrier tests).
This commit is contained in:
parent
dd60da0be6
commit
2b15e20f2f
@ -65,13 +65,14 @@ pub unsafe fn control_barrier<
|
||||
#[spirv_std_macros::gpu_only]
|
||||
#[doc(alias = "OpMemoryBarrier")]
|
||||
#[inline]
|
||||
pub unsafe fn memory_barrier<const MEMORY: Scope, const SEMANTICS: Semantics>() {
|
||||
// FIXME(eddyb) use a `bitflags!` `Semantics` for `SEMANTICS`.
|
||||
pub unsafe fn memory_barrier<const MEMORY: Scope, const SEMANTICS: u32>() {
|
||||
asm! {
|
||||
"%u32 = OpTypeInt 32 0",
|
||||
"%memory = OpConstant %u32 {memory}",
|
||||
"%semantics = OpConstant %u32 {semantics}",
|
||||
"OpMemoryBarrier %memory %semantics",
|
||||
memory = const MEMORY as u8,
|
||||
semantics = const SEMANTICS as u8,
|
||||
semantics = const SEMANTICS,
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ pub enum Scope {
|
||||
QueueFamily = 5,
|
||||
}
|
||||
|
||||
// FIXME(eddyb) use `bitflags!` for this.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum Semantics {
|
||||
/// No memory semantics.
|
||||
|
@ -9,8 +9,8 @@ use spirv_std::memory::{Scope, Semantics};
|
||||
pub fn main() {
|
||||
unsafe {
|
||||
spirv_std::arch::control_barrier::<
|
||||
{ Scope::Workgroup },
|
||||
{ Scope::Workgroup },
|
||||
{ Scope::Subgroup },
|
||||
{ Scope::Subgroup },
|
||||
{ Semantics::None },
|
||||
>();
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ use spirv_std::memory::{Scope, Semantics};
|
||||
pub fn main() {
|
||||
unsafe {
|
||||
spirv_std::arch::memory_barrier::<
|
||||
{ Scope::Workgroup },
|
||||
{ Semantics::None },
|
||||
{ Scope::Subgroup },
|
||||
{ (Semantics::AcquireRelease as u32) | (Semantics::UniformMemory as u32) },
|
||||
>();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user