Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring whether workgroup memory is zero initialised #5508

Merged
merged 19 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add safety comment
  • Loading branch information
DJMcNab committed Apr 8, 2024
commit 30884dd732ce10bb97e3eef9c16670752d8a6042
10 changes: 7 additions & 3 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6166,11 +6166,15 @@ impl ZeroInitializeWorkgroupMemory {
Self(ZeroInitializeWorkgroupMemoryInner::Always)
}

/// Don't zero out workgroup memory (without explicit initializers)
/// (unless required by the underlying device)
/// Don't zero out workgroup memory (without explicit initializers),
/// unless this is required by the underlying device.
///
/// This will be ignored when running under WebGPU
///
/// # Safety
///
/// Using this requires that the corresponding shader will not read from
/// an address in workgroup memory before writing to it
/// uninitialised workgroup memory
pub const unsafe fn never() -> Self {
Self(ZeroInitializeWorkgroupMemoryInner::Never)
}
Expand Down
Loading