Skip to content

Documentation / device / PBPrimitiveTypeInfo

Class: PBPrimitiveTypeInfo

Defined in: libs/device/src/builder/types.ts:732

The primitive type info

Extends

Constructors

Constructor

new PBPrimitiveTypeInfo(type): PBPrimitiveTypeInfo

Defined in: libs/device/src/builder/types.ts:739

Parameters

type

PBPrimitiveType

Returns

PBPrimitiveTypeInfo

Overrides

PBTypeInfo<PrimitiveTypeDetail>.constructor

Accessors

typeId

Get Signature

get typeId(): string

Defined in: libs/device/src/builder/types.ts:585

Get unique id for this type

Returns

string

Inherited from

PBTypeInfo.typeId


primitiveType

Get Signature

get primitiveType(): PBPrimitiveType

Defined in: libs/device/src/builder/types.ts:848

Get the primitive type

Returns

PBPrimitiveType


scalarType

Get Signature

get scalarType(): PBPrimitiveType

Defined in: libs/device/src/builder/types.ts:864

Get the scalar type

Returns

PBPrimitiveType


rows

Get Signature

get rows(): number

Defined in: libs/device/src/builder/types.ts:868

Get number of rows

Returns

number


cols

Get Signature

get cols(): number

Defined in: libs/device/src/builder/types.ts:872

Get number of columns

Returns

number


normalized

Get Signature

get normalized(): boolean

Defined in: libs/device/src/builder/types.ts:876

Get if this is a normalized primitive type

Returns

boolean

Methods

isVoidType()

isVoidType(): this is PBVoidTypeInfo

Defined in: libs/device/src/builder/types.ts:592

returns true if this is a void type

Returns

this is PBVoidTypeInfo

Inherited from

PBTypeInfo.isVoidType


isAnyType()

isAnyType(): this is PBAnyTypeInfo

Defined in: libs/device/src/builder/types.ts:596

returns true if this is an any type

Returns

this is PBAnyTypeInfo

Inherited from

PBTypeInfo.isAnyType


haveAtomicMembers()

haveAtomicMembers(): boolean

Defined in: libs/device/src/builder/types.ts:604

Wether this type have atomic members

Returns

boolean

Inherited from

PBTypeInfo.haveAtomicMembers


isStructType()

isStructType(): this is PBStructTypeInfo

Defined in: libs/device/src/builder/types.ts:608

returns true if this is a struct type

Returns

this is PBStructTypeInfo

Inherited from

PBTypeInfo.isStructType


isArrayType()

isArrayType(): this is PBArrayTypeInfo

Defined in: libs/device/src/builder/types.ts:612

returns true if this is an array type

Returns

this is PBArrayTypeInfo

Inherited from

PBTypeInfo.isArrayType


isPointerType()

isPointerType(): this is PBPointerTypeInfo

Defined in: libs/device/src/builder/types.ts:616

returns true if this is a pointer type

Returns

this is PBPointerTypeInfo

Inherited from

PBTypeInfo.isPointerType


isAtomicI32()

isAtomicI32(): this is PBAtomicI32TypeInfo

Defined in: libs/device/src/builder/types.ts:620

returns true if this is an atomic int type

Returns

this is PBAtomicI32TypeInfo

Inherited from

PBTypeInfo.isAtomicI32


isAtomicU32()

isAtomicU32(): this is PBAtomicU32TypeInfo

Defined in: libs/device/src/builder/types.ts:624

returns true if this is an atomic uint type

Returns

this is PBAtomicU32TypeInfo

Inherited from

PBTypeInfo.isAtomicU32


isSamplerType()

isSamplerType(): this is PBSamplerTypeInfo

Defined in: libs/device/src/builder/types.ts:628

returns true if this is a sampler type

Returns

this is PBSamplerTypeInfo

Inherited from

PBTypeInfo.isSamplerType


isTextureType()

isTextureType(): this is PBTextureTypeInfo

Defined in: libs/device/src/builder/types.ts:632

returns true if this is a texture type

Returns

this is PBTextureTypeInfo

Inherited from

PBTypeInfo.isTextureType


isCompatibleType()

isCompatibleType(other): boolean

Defined in: libs/device/src/builder/types.ts:656

Check whether a given type is compatible with this type

Parameters

other

PBTypeInfo

The type to be checked

Returns

boolean

true if the given type is compatible with this type, othewise false

Inherited from

PBTypeInfo.isCompatibleType


getCachedTypeInfo()

static getCachedTypeInfo(primitiveType): PBPrimitiveTypeInfo

Defined in: libs/device/src/builder/types.ts:743

Get or create a PBPrimitiveTypeInfo instance for a given prmitive type

Parameters

primitiveType

PBPrimitiveType

Returns

PBPrimitiveTypeInfo


isInteger()

isInteger(): boolean

Defined in: libs/device/src/builder/types.ts:852

Whether the type is signed or unsigned integer scalar or vector

Returns

boolean


resizeType()

resizeType(rows, cols): PBPrimitiveType

Defined in: libs/device/src/builder/types.ts:918

Creates a new primitive type info by changing row and column of this type

Parameters

rows

number

The new value of row

cols

number

The new value of column

Returns

PBPrimitiveType

The new primitive type


isScalarType()

isScalarType(): boolean

Defined in: libs/device/src/builder/types.ts:922

Returns true if this is a scalar type

Returns

boolean


isVectorType()

isVectorType(): boolean

Defined in: libs/device/src/builder/types.ts:926

Returns true if this is a vector type

Returns

boolean


isMatrixType()

isMatrixType(): boolean

Defined in: libs/device/src/builder/types.ts:930

Returns true if this is a matrix type

Returns

boolean


isPrimitiveType()

isPrimitiveType(): this is PBPrimitiveTypeInfo

Defined in: libs/device/src/builder/types.ts:934

returns true if this is a primitive type

Returns

this is PBPrimitiveTypeInfo

Overrides

PBTypeInfo.isPrimitiveType


toBufferLayout()

toBufferLayout(_offset): any

Defined in: libs/device/src/builder/types.ts:964

Creates a buffer layout from this type

Parameters

_offset

number

Byte offset of the layout

Returns

any

The created buffer layout

Overrides

PBTypeInfo.toBufferLayout

Released under the MIT License.