@@ -45,9 +45,8 @@ pub enum PassMode {
45
45
///
46
46
/// The argument has a layout abi of `ScalarPair`.
47
47
Pair ( ArgAttributes , ArgAttributes ) ,
48
- /// Pass the argument after casting it, to either a single uniform or a
49
- /// pair of registers. The bool indicates if a `Reg::i32()` dummy argument
50
- /// is emitted before the real argument.
48
+ /// Pass the argument after casting it. See the `CastTarget` docs for details. The bool
49
+ /// indicates if a `Reg::i32()` dummy argument is emitted before the real argument.
51
50
Cast ( Box < CastTarget > , bool ) ,
52
51
/// Pass the argument indirectly via a hidden pointer.
53
52
/// The `extra_attrs` value, if any, is for the extra data (vtable or length)
@@ -255,6 +254,13 @@ impl Uniform {
255
254
}
256
255
}
257
256
257
+ /// Describes the type used for `PassMode::Cast`.
258
+ ///
259
+ /// Passing arguments in this mode works as follows: the registers in the `prefix` (the ones that
260
+ /// are `Some`) get laid out one after the other (using `repr(C)` layout rules). Then the
261
+ /// `rest.unit` register type gets repeated often enough to cover `rest.size`. This describes the
262
+ /// actual type used for the call; the Rust type of the argument is then transmuted to this ABI type
263
+ /// (and all data in the padding between the registers is dropped).
258
264
#[ derive( Clone , PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
259
265
pub struct CastTarget {
260
266
pub prefix : [ Option < Reg > ; 8 ] ,
0 commit comments