Skip to content

Commit d9c3022

Browse files
committed
derivative: fix missing safety doc
1 parent c09807c commit d9c3022

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/spirv-std/src/arch/derivative.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ macro_rules! deriv_fn {
1919
}
2020

2121
/// Types that can be derived by partial derivatives
22+
///
23+
/// # Safety
24+
/// Result Type must be a scalar or vector of floating-point type using the IEEE 754 encoding. The component width must be 32 bits.
2225
pub unsafe trait Derivative: Sealed + Default {
2326
/// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses local differencing
2427
/// based on the value of `Self`. Same result as either [`Self::dfdx_fine`] or [`Self::dfdx_coarse`] on `Self`. Selection of which

0 commit comments

Comments
 (0)