Skip to content

Commit 6b956d1

Browse files
committed
derivative: fix unused warnings on CPU
1 parent ad56bf2 commit 6b956d1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::sealed::Sealed;
22
use glam::{Vec2, Vec3, Vec3A, Vec4};
33

4+
#[cfg(target_arch = "spirv")]
45
macro_rules! cap_deriv_control {
56
() => {
67
// unsafe {
@@ -9,6 +10,7 @@ macro_rules! cap_deriv_control {
910
};
1011
}
1112

13+
#[cfg(target_arch = "spirv")]
1214
macro_rules! deriv_fn {
1315
($inst:ident, $param:expr) => {
1416
unsafe {

tests/ui/arch/derivative.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpLabel
3-
OpLine %5 41 8
3+
OpLine %5 43 8
44
%6 = OpDPdx %7 %8
5-
OpLine %5 85 8
5+
OpLine %5 87 8
66
%9 = OpDPdy %7 %8
7-
OpLine %5 127 8
7+
OpLine %5 129 8
88
%10 = OpFwidth %7 %8
99
OpNoLine
1010
OpReturn

tests/ui/arch/derivative_control.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
%1 = OpFunction %2 None %3
22
%4 = OpLabel
3-
OpLine %5 55 8
3+
OpLine %5 57 8
44
%6 = OpDPdxFine %7 %8
5-
OpLine %5 99 8
5+
OpLine %5 101 8
66
%9 = OpDPdyFine %7 %8
7-
OpLine %5 140 8
7+
OpLine %5 142 8
88
%10 = OpFwidthFine %7 %8
9-
OpLine %5 71 8
9+
OpLine %5 73 8
1010
%11 = OpDPdxCoarse %7 %8
11-
OpLine %5 115 8
11+
OpLine %5 117 8
1212
%12 = OpDPdyCoarse %7 %8
13-
OpLine %5 153 8
13+
OpLine %5 155 8
1414
%13 = OpFwidthCoarse %7 %8
1515
OpNoLine
1616
OpReturn

0 commit comments

Comments
 (0)