@@ -21,14 +21,16 @@ macro_rules! deriv_fn {
2121/// Types that can be derived by partial derivatives
2222///
2323/// # 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.
24+ /// Result Type must be a scalar or vector of floating-point type using the IEEE 754 encoding. The
25+ /// component width must be 32 bits.
2526pub unsafe trait Derivative : Sealed + Default {
26- /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses local differencing
27- /// based on the value of `Self`. Same result as either [`Self::dfdx_fine`] or [`Self::dfdx_coarse`] on `Self`. Selection of which
28- /// one is based on external factors.
27+ /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses
28+ /// local differencing based on the value of `Self`. Same result as either [`Self::dfdx_fine`]
29+ /// or [`Self::dfdx_coarse`] on `Self`. Selection of which one is based on external factors.
2930 ///
30- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
31- /// derivative group have executed all dynamic instances that are program-ordered before X'.
31+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
32+ /// invocations in its derivative group have executed all dynamic instances that are
33+ /// program-ordered before X'.
3234 ///
3335 /// This instruction is only valid in the Fragment Execution Model.
3436 #[ crate :: macros:: gpu_only]
@@ -37,11 +39,13 @@ pub unsafe trait Derivative: Sealed + Default {
3739 deriv_fn ! ( OpDPdx , self )
3840 }
3941
40- /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses local differencing
41- /// based on the value of `Self` for the current fragment and its immediate neighbor(s).
42+ /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses
43+ /// local differencing based on the value of `Self` for the current fragment and its immediate
44+ /// neighbor(s).
4245 ///
43- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
44- /// derivative group have executed all dynamic instances that are program-ordered before X'.
46+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
47+ /// invocations in its derivative group have executed all dynamic instances that are
48+ /// program-ordered before X'.
4549 ///
4650 /// This instruction is only valid in the Fragment Execution Model.
4751 #[ crate :: macros:: gpu_only]
@@ -50,13 +54,15 @@ pub unsafe trait Derivative: Sealed + Default {
5054 deriv_fn ! ( OpDPdxFine , self )
5155 }
5256
53- /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses local differencing
54- /// based on the value of `Self` for the current fragment’s neighbors, and possibly, but not necessarily, includes
55- /// the value of `Self` for the current fragment. That is, over a given area, the implementation can compute x
56- /// derivatives in fewer unique locations than would be allowed for [`Self::dfdx_fine`].
57+ /// Result is the partial derivative of `Self` with respect to the window x coordinate. Uses
58+ /// local differencing based on the value of `Self` for the current fragment’s neighbors, and
59+ /// possibly, but not necessarily, includes the value of `Self` for the current fragment. That
60+ /// is, over a given area, the implementation can compute x derivatives in fewer unique
61+ /// locations than would be allowed for [`Self::dfdx_fine`].
5762 ///
58- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
59- /// derivative group have executed all dynamic instances that are program-ordered before X'.
63+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
64+ /// invocations in its derivative group have executed all dynamic instances that are
65+ /// program-ordered before X'.
6066 ///
6167 /// This instruction is only valid in the Fragment Execution Model.
6268 #[ crate :: macros:: gpu_only]
@@ -65,12 +71,13 @@ pub unsafe trait Derivative: Sealed + Default {
6571 deriv_fn ! ( OpDPdxCoarse , self )
6672 }
6773
68- /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses local differencing
69- /// based on the value of `Self`. Same result as either [`Self::dfdy_fine`] or [`Self::dfdy_coarse`] on `Self`. Selection of which
70- /// one is based on external factors.
74+ /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses
75+ /// local differencing based on the value of `Self`. Same result as either [`Self::dfdy_fine`]
76+ /// or [`Self::dfdy_coarse`] on `Self`. Selection of which one is based on external factors.
7177 ///
72- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
73- /// derivative group have executed all dynamic instances that are program-ordered before X'.
78+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
79+ /// invocations in its derivative group have executed all dynamic instances that are
80+ /// program-ordered before X'.
7481 ///
7582 /// This instruction is only valid in the Fragment Execution Model.
7683 #[ crate :: macros:: gpu_only]
@@ -79,11 +86,13 @@ pub unsafe trait Derivative: Sealed + Default {
7986 deriv_fn ! ( OpDPdy , self )
8087 }
8188
82- /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses local differencing
83- /// based on the value of `Self` for the current fragment and its immediate neighbor(s).
89+ /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses
90+ /// local differencing based on the value of `Self` for the current fragment and its immediate
91+ /// neighbor(s).
8492 ///
85- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
86- /// derivative group have executed all dynamic instances that are program-ordered before X'.
93+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
94+ /// invocations in its derivative group have executed all dynamic instances that are
95+ /// program-ordered before X'.
8796 ///
8897 /// This instruction is only valid in the Fragment Execution Model.
8998 #[ crate :: macros:: gpu_only]
@@ -92,13 +101,15 @@ pub unsafe trait Derivative: Sealed + Default {
92101 deriv_fn ! ( OpDPdyFine , self )
93102 }
94103
95- /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses local differencing
96- /// based on the value of `Self` for the current fragment’s neighbors, and possibly, but not necessarily, includes
97- /// the value of `Self` for the current fragment. That is, over a given area, the implementation can compute y
98- /// derivatives in fewer unique locations than would be allowed for [`Self::dfdy_fine`].
104+ /// Result is the partial derivative of `Self` with respect to the window y coordinate. Uses
105+ /// local differencing based on the value of `Self` for the current fragment’s neighbors, and
106+ /// possibly, but not necessarily, includes the value of `Self` for the current fragment. That
107+ /// is, over a given area, the implementation can compute y derivatives in fewer unique
108+ /// locations than would be allowed for [`Self::dfdy_fine`].
99109 ///
100- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
101- /// derivative group have executed all dynamic instances that are program-ordered before X'.
110+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
111+ /// invocations in its derivative group have executed all dynamic instances that are
112+ /// program-ordered before X'.
102113 ///
103114 /// This instruction is only valid in the Fragment Execution Model.
104115 #[ crate :: macros:: gpu_only]
@@ -107,10 +118,12 @@ pub unsafe trait Derivative: Sealed + Default {
107118 deriv_fn ! ( OpDPdyCoarse , self )
108119 }
109120
110- /// Result is the same as computing the sum of the absolute values of [`Self::dfdx`] and [`Self::dfdy`] on P.
121+ /// Result is the same as computing the sum of the absolute values of [`Self::dfdx`] and
122+ /// [`Self::dfdy`] on P.
111123 ///
112- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
113- /// derivative group have executed all dynamic instances that are program-ordered before X'.
124+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
125+ /// invocations in its derivative group have executed all dynamic instances that are
126+ /// program-ordered before X'.
114127 ///
115128 /// This instruction is only valid in the Fragment Execution Model.
116129 #[ crate :: macros:: gpu_only]
@@ -119,10 +132,12 @@ pub unsafe trait Derivative: Sealed + Default {
119132 deriv_fn ! ( OpFwidth , self )
120133 }
121134
122- /// Result is the same as computing the sum of the absolute values of [`Self::dfdx_fine`] and [`Self::dfdy_fine`] on P.
135+ /// Result is the same as computing the sum of the absolute values of [`Self::dfdx_fine`] and
136+ /// [`Self::dfdy_fine`] on P.
123137 ///
124- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
125- /// derivative group have executed all dynamic instances that are program-ordered before X'.
138+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
139+ /// invocations in its derivative group have executed all dynamic instances that are
140+ /// program-ordered before X'.
126141 ///
127142 /// This instruction is only valid in the Fragment Execution Model.
128143 #[ crate :: macros:: gpu_only]
@@ -131,10 +146,12 @@ pub unsafe trait Derivative: Sealed + Default {
131146 deriv_fn ! ( OpFwidthFine , self )
132147 }
133148
134- /// Result is the same as computing the sum of the absolute values of [`Self::dfdx_coarse`] and [`Self::dfdy_coarse`] on P.
149+ /// Result is the same as computing the sum of the absolute values of [`Self::dfdx_coarse`] and
150+ /// [`Self::dfdy_coarse`] on P.
135151 ///
136- /// An invocation will not execute a dynamic instance of this instruction (X') until all invocations in its
137- /// derivative group have executed all dynamic instances that are program-ordered before X'.
152+ /// An invocation will not execute a dynamic instance of this instruction (X') until all
153+ /// invocations in its derivative group have executed all dynamic instances that are
154+ /// program-ordered before X'.
138155 ///
139156 /// This instruction is only valid in the Fragment Execution Model.
140157 #[ crate :: macros:: gpu_only]
0 commit comments