Skip to content

Documentation / device / PBStructTypeInfo

Class: PBStructTypeInfo ​

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

The struct type info

Extends ​

Constructors ​

Constructor ​

new PBStructTypeInfo(name, layout, members): PBStructTypeInfo

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

Parameters ​

name ​

string

layout ​

PBStructLayout

members ​

object[]

Returns ​

PBStructTypeInfo

Overrides ​

PBTypeInfo<StructTypeDetail>.constructor

Accessors ​

typeId ​

Get Signature ​

get typeId(): string

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

Get unique id for this type

Returns ​

string

Inherited from ​

PBTypeInfo.typeId


layout ​

Get Signature ​

get layout(): PBStructLayout

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

Get the layout type

Returns ​

PBStructLayout


structName ​

Get Signature ​

get structName(): string

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

Get name of the struct type

Returns ​

string

Set Signature ​

set structName(val): void

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

Parameters ​
val ​

string

Returns ​

void


structMembers ​

Get Signature ​

get structMembers(): object[]

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

Get member types of the struct type

Returns ​

Methods ​

isVoidType() ​

isVoidType(): this is PBVoidTypeInfo

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

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:600

returns true if this is an any type

Returns ​

this is PBAnyTypeInfo

Inherited from ​

PBTypeInfo.isAnyType


isPrimitiveType() ​

isPrimitiveType(): this is PBPrimitiveTypeInfo

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

returns true if this is a primitive type

Returns ​

this is PBPrimitiveTypeInfo

Inherited from ​

PBTypeInfo.isPrimitiveType


isArrayType() ​

isArrayType(): this is PBArrayTypeInfo

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

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:624

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:628

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:632

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:636

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:640

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:664

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


haveAtomicMembers() ​

haveAtomicMembers(): boolean

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

Whether this struct has atomic members

Returns ​

boolean

Overrides ​

PBTypeInfo.haveAtomicMembers


haveF16Members() ​

haveF16Members(): boolean

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

Whether this type contains f16 scalar or vector types

Returns ​

boolean

Overrides ​

PBTypeInfo.haveF16Members


extends() ​

extends(name, members): PBStructTypeInfo

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

Creates a new struct type by extending this type

Parameters ​

name ​

string

Name of the new struct type

members ​

object[]

additional struct members

Returns ​

PBStructTypeInfo

The new struct type


isStructType() ​

isStructType(): this is PBStructTypeInfo

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

returns true if this is a struct type

Returns ​

this is PBStructTypeInfo

Overrides ​

PBTypeInfo.isStructType


toBufferLayout() ​

toBufferLayout(offset, layout): UniformBufferLayout

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

Creates a buffer layout from this type

Parameters ​

offset ​

number

Byte offset of the layout

layout ​

PBStructLayout

Type of the layout

Returns ​

UniformBufferLayout

The created buffer layout

Overrides ​

PBTypeInfo.toBufferLayout

Released under the MIT License.