sltype

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

README

sltype

Package sltype provides type definitions for standard WGSL types, using aliases to the equivalent math32 types where possible, but including other type names not defined there.

These types will be converted to their equivalent WGSL types automatically by gosl, as will the corresponding math32 type names.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Uint32Mul64

func Uint32Mul64(a, b uint32) uint64

Uint32Mul64 multiplies two uint32 numbers into a uint64.

func Uint32ToFloat32

func Uint32ToFloat32(val uint32) float32

Uint32ToFloat32 converts a uint32 integer into a float32 in the (0,1) interval (i.e., exclusive of 1). This differs from the Go standard by excluding 0, which is handy for passing directly to Log function, and from the reference Philox code by excluding 1 which is in the Go standard and most other standard RNGs.

func Uint32ToFloat32Range11

func Uint32ToFloat32Range11(val uint32) float32

Uint32ToFloat32Range11 converts a uint32 integer into a float32 in the [-1..1] interval (inclusive of -1 and 1, never identically == 0).

func Uint64Add32

func Uint64Add32(a uint64, b uint32) uint64

Uint64Add32 adds given uint32 number to given uint64.

func Uint64FromLoHi

func Uint64FromLoHi(a Uint32Vec2) uint64

Uint64FromLoHi combines lo and hi uint32 components into a uint64 value.

func Uint64Incr

func Uint64Incr(a uint64) uint64

Uint64Incr returns increment of the given uint64.

Types

type Float32Vec2

type Float32Vec2 = math32.Vector2

Float32Vec2 is a length 2 vector of float32

func Uint32ToFloat32Range11Vec2

func Uint32ToFloat32Range11Vec2(val Uint32Vec2) Float32Vec2

Uint32ToFloat32Range11Vec2 converts two uint32 integers into two float32 in the [-1,1] interval (inclusive of -1 and 1, never identically == 0)

func Uint32ToFloat32Vec2

func Uint32ToFloat32Vec2(val Uint32Vec2) Float32Vec2

Uint32ToFloat32Vec2 converts two uint32 bit integers into two corresponding 32 bit f32 values in the (0,1) interval (i.e., exclusive of 1).

type Float32Vec3

type Float32Vec3 = math32.Vector3

Float32Vec3 is a length 3 vector of float32

type Float32Vec4

type Float32Vec4 = math32.Vector4

Float32Vec4 is a length 4 vector of float32

type Int32Vec2

type Int32Vec2 = math32.Vector2i

Int32Vec2 is a length 2 vector of int32

type Int32Vec4

type Int32Vec4 struct {
	X int32
	Y int32
	Z int32
	W int32
}

Int32Vec4 is a length 4 vector of int32

type IntVec3

type IntVec3 = math32.Vector3i

Int32Vec3 is a length 3 vector of int32

type Uint32Vec2

type Uint32Vec2 struct {
	X uint32
	Y uint32
}

Uint32Vec2 is a length 2 vector of uint32

func Uint64ToLoHi

func Uint64ToLoHi(a uint64) Uint32Vec2

Uint64ToLoHi splits a uint64 number into lo and hi uint32 components.

type Uint32Vec3

type Uint32Vec3 struct {
	X uint32
	Y uint32
	Z uint32
}

Uint32Vec3 is a length 3 vector of uint32

type Uint32Vec4

type Uint32Vec4 struct {
	X uint32
	Y uint32
	Z uint32
	W uint32
}

Uint32Vec4 is a length 4 vector of uint32

func (*Uint32Vec4) SetFromVec2

func (u *Uint32Vec4) SetFromVec2(u2 Uint32Vec2)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL