MethodDependencyCounter keeps track of the number of dependencies for "named registers" used across methods. Named registers are that are not necessarily limited to a single method. They are created by the compiler and passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed each time a method has been compiled into the shader.

See also:

  • RegisterPool.addUsage

Constructor

new()

Creates a new MethodDependencyCounter object.

Variables

read onlynormalDependencies:Int

read onlytangentDependencies:Int

read onlyusesGlobalPosFragment:Bool

read onlyuvDependencies:Int

read onlyviewDirDependencies:Int

Methods

addWorldSpaceDependencies(fragmentLights:Bool):Void

Adds any external world space dependencies, used to force world space calculations.

includeMethodVO(methodVO:MethodVO):Void

Increases dependency counters for the named registers listed as required by the given MethodVO.

Parameters:

methodVO

the MethodVO object for which to include dependencies.

reset():Void

Clears dependency counts for all registers. Called when recompiling a pass.

setPositionedLights(numPointLights:Int, lightSourceMask:Int):Void

Sets the amount of lights that have a position associated with them.

Parameters:

numPointLights

The amount of point lights.

lightSourceMask

The light source types used by the material.