Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Structures

Uint64

#

We cannot rely on native 64-bit integers, so we define our own 64-bit integer type as two 32-bit integers.

struct Uint64 {
low: u32 ,
high: u32 ,
}

Uint96

#

96-bit unsigned integer type.

struct Uint96 {
low: u32 ,
mid: u32 ,
high: u32 ,
}

Functions

truncate_u96_to_u64

#

Truncates a 96-bit number to a 64-bit number by discarding the upper 32 bits.

fn truncate_u96_to_u64 (
x: Uint96
) -> Uint64

low

#

Returns the lower 16 bits of a 32-bit integer.

fn low (
a: u32
) -> u32

high

#

Returns the upper 16 bits of a 32-bit integer.

fn high (
a: u32
) -> u32

u32_from_u16s

#

The high 16 bits of each argument are discarded.

fn u32_from_u16s (
w1: u32
, 
w0: u32
) -> u32

u64_mul_u32

#

The number of digits (bits) needed to represent the result of a multiplication is the sum of the number of input digits (bits). Since we are multiplying a 64-bit number by a 32-bit number, we need 96 bits to represent the result.

fn u64_mul_u32 (
a: Uint64
, 
b: u32
) -> Uint96

shift_right_96

#

The shift is in the range [0, 32].

fn shift_right_96 (
x: Uint96
, 
shift: u32
) -> Uint96
Contents