Skip to content

Commit 2487403

Browse files
committed
derivative: rename derivative functions to match GLSL
1 parent 6b956d1 commit 2487403

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub unsafe trait Derivative: Sealed + Default {
3939
/// This instruction is only valid in the Fragment Execution Model.
4040
#[crate::macros::gpu_only]
4141
#[inline]
42-
fn ddx(self) -> Self {
42+
fn dfdx(self) -> Self {
4343
deriv_fn!(OpDPdx, self)
4444
}
4545

@@ -52,7 +52,7 @@ pub unsafe trait Derivative: Sealed + Default {
5252
/// This instruction is only valid in the Fragment Execution Model.
5353
#[crate::macros::gpu_only]
5454
#[inline]
55-
fn ddx_fine(self) -> Self {
55+
fn dfdx_fine(self) -> Self {
5656
cap_deriv_control!();
5757
deriv_fn!(OpDPdxFine, self)
5858
}
@@ -68,7 +68,7 @@ pub unsafe trait Derivative: Sealed + Default {
6868
/// This instruction is only valid in the Fragment Execution Model.
6969
#[crate::macros::gpu_only]
7070
#[inline]
71-
fn ddx_coarse(self) -> Self {
71+
fn dfdx_coarse(self) -> Self {
7272
cap_deriv_control!();
7373
deriv_fn!(OpDPdxCoarse, self)
7474
}
@@ -83,7 +83,7 @@ pub unsafe trait Derivative: Sealed + Default {
8383
/// This instruction is only valid in the Fragment Execution Model.
8484
#[crate::macros::gpu_only]
8585
#[inline]
86-
fn ddy(self) -> Self {
86+
fn dfdy(self) -> Self {
8787
deriv_fn!(OpDPdy, self)
8888
}
8989

@@ -96,7 +96,7 @@ pub unsafe trait Derivative: Sealed + Default {
9696
/// This instruction is only valid in the Fragment Execution Model.
9797
#[crate::macros::gpu_only]
9898
#[inline]
99-
fn ddy_fine(self) -> Self {
99+
fn dfdy_fine(self) -> Self {
100100
cap_deriv_control!();
101101
deriv_fn!(OpDPdyFine, self)
102102
}
@@ -112,7 +112,7 @@ pub unsafe trait Derivative: Sealed + Default {
112112
/// This instruction is only valid in the Fragment Execution Model.
113113
#[crate::macros::gpu_only]
114114
#[inline]
115-
fn ddy_coarse(self) -> Self {
115+
fn dfdy_coarse(self) -> Self {
116116
cap_deriv_control!();
117117
deriv_fn!(OpDPdyCoarse, self)
118118
}

tests/ui/arch/derivative.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn main() {
1010
}
1111

1212
pub fn derivative() {
13-
Derivative::ddx(0.);
14-
Derivative::ddy(0.);
13+
Derivative::dfdx(0.);
14+
Derivative::dfdy(0.);
1515
Derivative::fwidth(0.);
1616
}

tests/ui/arch/derivative_control.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ pub fn main() {
1111
}
1212

1313
pub fn derivative() {
14-
Derivative::ddx_fine(0.);
15-
Derivative::ddy_fine(0.);
14+
Derivative::dfdx_fine(0.);
15+
Derivative::dfdy_fine(0.);
1616
Derivative::fwidth_fine(0.);
1717

18-
Derivative::ddx_coarse(0.);
19-
Derivative::ddy_coarse(0.);
18+
Derivative::dfdx_coarse(0.);
19+
Derivative::dfdy_coarse(0.);
2020
Derivative::fwidth_coarse(0.);
2121
}

0 commit comments

Comments
 (0)