Skip to content

Documentation / device / PBBuiltinScope

Class: PBBuiltinScope

Defined in: libs/device/src/builder/programbuilder.ts:3206

The builtin scope of a shader

Extends

Indexable

[props: string]: any

Constructors

Constructor

new PBBuiltinScope(): PBBuiltinScope

Defined in: libs/device/src/builder/programbuilder.ts:3232

Returns

PBBuiltinScope

Properties

position

position: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3207


pointSize

pointSize: number | PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3208


fragDepth

fragDepth: number | PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3209


fragCoord

readonly fragCoord: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3210


frontFacing

readonly frontFacing: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3211


vertexIndex

readonly vertexIndex: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3212


instanceIndex

readonly instanceIndex: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3213


localInvocationId

readonly localInvocationId: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3214


globalInvocationId

readonly globalInvocationId: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3215


workGroupId

readonly workGroupId: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3216


numWorkGroups

readonly numWorkGroups: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3217


sampleMaskIn

readonly sampleMaskIn: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3218


sampleMaskOut

sampleMaskOut: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3219


sampleIndex

readonly sampleIndex: PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:3220

Accessors

$thisProxy

Get Signature

get $thisProxy(): T

Defined in: libs/device/src/builder/base.ts:133

Returns

T

Inherited from

PBScope.$thisProxy


$builder

Get Signature

get $builder(): ProgramBuilder

Defined in: libs/device/src/builder/programbuilder.ts:2772

Get the program builder

Returns

ProgramBuilder

Inherited from

PBScope.$builder


$builtins

Get Signature

get $builtins(): PBBuiltinScope

Defined in: libs/device/src/builder/programbuilder.ts:2776

Returns the scope of the builtin variables

Returns

PBBuiltinScope

Inherited from

PBScope.$builtins


$inputs

Get Signature

get $inputs(): PBInputScope

Defined in: libs/device/src/builder/programbuilder.ts:2780

Returns the scope of the input variables

Returns

PBInputScope

Inherited from

PBScope.$inputs


$outputs

Get Signature

get $outputs(): PBOutputScope

Defined in: libs/device/src/builder/programbuilder.ts:2784

Returns the scope of the output variables

Returns

PBOutputScope

Inherited from

PBScope.$outputs


$l

Get Signature

get $l(): PBLocalScope

Defined in: libs/device/src/builder/programbuilder.ts:2812

Get the current local scope

Returns

PBLocalScope

Inherited from

PBScope.$l


$g

Get Signature

get $g(): PBGlobalScope

Defined in: libs/device/src/builder/programbuilder.ts:2816

Get the global scope

Returns

PBGlobalScope

Inherited from

PBScope.$g

Methods

$getVertexAttrib()

$getVertexAttrib(semantic): PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:2808

Get the input vertex attribute by specified semantic

Parameters

semantic

VertexSemantic

The vertex semantic

Returns

PBShaderExp

The input vertex attribute or null if not exists

Remarks

Can only be called only in vertex shader

Inherited from

PBScope.$getVertexAttrib


$query()

$query(name): PBShaderExp

Defined in: libs/device/src/builder/programbuilder.ts:2834

Query the global variable by the name

Parameters

name

string

Name of the variable

Returns

PBShaderExp

The variable or null if not exists

Inherited from

PBScope.$query

Released under the MIT License.