Documentation / device / PBInsideFunctionScope
Class: PBInsideFunctionScope
Defined in: libs/device/src/builder/programbuilder.ts:3680
Scope that is inside a function
Extends
Extended by
Indexable
[
props:string]:any
Accessors
$thisProxy
Get Signature
get $thisProxy():
T
Defined in: libs/device/src/builder/base.ts:133
Returns
T
Inherited from
$builder
Get Signature
get $builder():
ProgramBuilder
Defined in: libs/device/src/builder/programbuilder.ts:2772
Get the program builder
Returns
Inherited from
$builtins
Get Signature
get $builtins():
PBBuiltinScope
Defined in: libs/device/src/builder/programbuilder.ts:2776
Returns the scope of the builtin variables
Returns
Inherited from
$inputs
Get Signature
get $inputs():
PBInputScope
Defined in: libs/device/src/builder/programbuilder.ts:2780
Returns the scope of the input variables
Returns
Inherited from
$outputs
Get Signature
get $outputs():
PBOutputScope
Defined in: libs/device/src/builder/programbuilder.ts:2784
Returns the scope of the output variables
Returns
Inherited from
$l
Get Signature
get $l():
PBLocalScope
Defined in: libs/device/src/builder/programbuilder.ts:2812
Get the current local scope
Returns
Inherited from
$g
Get Signature
get $g():
PBGlobalScope
Defined in: libs/device/src/builder/programbuilder.ts:2816
Get the global scope
Returns
Inherited from
Methods
$getVertexAttrib()
$getVertexAttrib(
semantic):PBShaderExp
Defined in: libs/device/src/builder/programbuilder.ts:2808
Get the input vertex attribute by specified semantic
Parameters
semantic
The vertex semantic
Returns
The input vertex attribute or null if not exists
Remarks
Can only be called only in vertex shader
Inherited from
$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
The variable or null if not exists
Inherited from
$return()
$return(
retval?):void
Defined in: libs/device/src/builder/programbuilder.ts:3689
Creates a 'return' statement
Parameters
retval?
The return value
Returns
void
$scope()
$scope(
body):PBInsideFunctionScope
Defined in: libs/device/src/builder/programbuilder.ts:3760
Creates a new scope
Parameters
body
(this) => void
Generator function for the scope
Returns
PBInsideFunctionScope
The created scope
$if()
$if(
condition,body):PBIfScope
Defined in: libs/device/src/builder/programbuilder.ts:3771
Creates an 'if' statement
Parameters
condition
Condition expression for the if statement
body
(this) => void
Generator function for the scope inside the if statement
Returns
The scope inside the if statement
$choice()
$choice(
condition,first,second):PBShaderExp
Defined in: libs/device/src/builder/programbuilder.ts:3788
Creates a select statement: condition ? first : second
Parameters
condition
Condition expression
first
The first value
second
The second value
Returns
The first value if condition evaluates to true, otherwise returns the second value
$break()
$break():
void
Defined in: libs/device/src/builder/programbuilder.ts:3803
Creates a 'break' statement
Returns
void
$continue()
$continue():
void
Defined in: libs/device/src/builder/programbuilder.ts:3807
Creates a 'continue' statement
Returns
void
$for()
$for(
counter,init,end,open?,reverse?,body?):void
Defined in: libs/device/src/builder/programbuilder.ts:3817
Creates a 'for' statement
Parameters
counter
The repeat counter variable declaration
init
number | PBShaderExp
initial value of the repeat counter variable
end
number | PBShaderExp
end value of the counter exclusive
open?
boolean | ((this) => void)
reverse?
boolean | ((this) => void)
body?
(this) => void
Generator function for the scope that inside the for statement
Returns
void
$do()
$do(
body):PBDoWhileScope
Defined in: libs/device/src/builder/programbuilder.ts:3857
Creates a 'do..while' statement
Parameters
body
(this) => void
Generator function for the scope that inside the do..while statment
Returns
The scope that inside the do..while statement
$while()
$while(
condition,body):void
Defined in: libs/device/src/builder/programbuilder.ts:3870
Creates a 'while' statement
Parameters
condition
Condition expression for the while statement
body
(this) => void
Generator function for the scope that inside the while statement
Returns
void
$getMainScope()
$getMainScope():
PBFunctionScope
Defined in: libs/device/src/builder/programbuilder.ts:3889
Gets main function scope