Skip to content

Documentation / device / PBReflection

Class: PBReflection

Defined in: libs/device/src/builder/reflection.ts:16

Reflection interface for program builder

Constructors

Constructor

new PBReflection(builder): PBReflection

Defined in: libs/device/src/builder/reflection.ts:23

Parameters

builder

ProgramBuilder

Returns

PBReflection

Accessors

vertexAttributes

Get Signature

get vertexAttributes(): number[]

Defined in: libs/device/src/builder/reflection.ts:29

Gets all the vertex attributes that was used by the program

Returns

number[]

Methods

hasVertexAttribute()

hasVertexAttribute(attrib): boolean

Defined in: libs/device/src/builder/reflection.ts:36

Check if specified vertex attribute was used by the program

Parameters

attrib

number

The vertex attribute to check

Returns

boolean


clear()

clear(): void

Defined in: libs/device/src/builder/reflection.ts:42

Clear all contents

Returns

void


tag()

Call Signature

tag(name): PBShaderExp

Defined in: libs/device/src/builder/reflection.ts:50

Gets the variable that has tagged with given string

Parameters
name

string

The tag string

Returns

PBShaderExp

Call Signature

tag(name, getter): void

Defined in: libs/device/src/builder/reflection.ts:56

Creates a new tag by specifying a function to get the tagged variable

Parameters
name

string

The tag name

getter

PBReflectionTagGetter

The getter function

Returns

void

Call Signature

tag(values): void

Defined in: libs/device/src/builder/reflection.ts:61

Creates multiple tags from an object that contains the tag names and the getter functions

Parameters
values

Record<string, PBReflectionTagGetter>

The object that contains the tag names and the getter functions

Returns

void


attribute()

attribute(attrib): PBShaderExp

Defined in: libs/device/src/builder/reflection.ts:82

Gets the variable which is the vertex attribute of specified semantic

Parameters

attrib

VertexSemantic

The vertex semantic

Returns

PBShaderExp

Released under the MIT License.