Packageaway3d.materials.compilation
Classpublic class MethodDependencyCounter
InheritanceMethodDependencyCounter Inheritance Object

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


Public Properties
 PropertyDefined By
  globalPosDependencies : uint
[read-only] The amount of dependencies on the global position.
MethodDependencyCounter
  normalDependencies : uint
[read-only] The amount of dependencies on the normal vector.
MethodDependencyCounter
  projectionDependencies : uint
[read-only] The amount of dependencies on the projected position.
MethodDependencyCounter
  secondaryUVDependencies : uint
[read-only] The amount of dependencies on the secondary UV coordinates.
MethodDependencyCounter
  tangentDependencies : uint
[read-only] The amount of tangent vector dependencies (fragment shader).
MethodDependencyCounter
  usesGlobalPosFragment : Boolean
[read-only] Indicates whether there are any dependencies on the world-space position vector.
MethodDependencyCounter
  uvDependencies : uint
[read-only] The amount of dependencies on the primary UV coordinates.
MethodDependencyCounter
  viewDirDependencies : uint
[read-only] The amount of dependencies on the view direction.
MethodDependencyCounter
Public Methods
 MethodDefined By
  
Creates a new MethodDependencyCounter object.
MethodDependencyCounter
  
addWorldSpaceDependencies(fragmentLights:Boolean):void
Adds any external world space dependencies, used to force world space calculations.
MethodDependencyCounter
  
includeMethodVO(methodVO:MethodVO):void
Increases dependency counters for the named registers listed as required by the given MethodVO.
MethodDependencyCounter
  
reset():void
Clears dependency counts for all registers.
MethodDependencyCounter
  
setPositionedLights(numPointLights:uint, lightSourceMask:uint):void
Sets the amount of lights that have a position associated with them.
MethodDependencyCounter
Property Detail
globalPosDependenciesproperty
globalPosDependencies:uint  [read-only]

The amount of dependencies on the global position. This can be 0 while hasGlobalPosDependencies is true when the global position is used as a temporary value (fe to calculate the view direction)


Implementation
    public function get globalPosDependencies():uint
normalDependenciesproperty 
normalDependencies:uint  [read-only]

The amount of dependencies on the normal vector.


Implementation
    public function get normalDependencies():uint
projectionDependenciesproperty 
projectionDependencies:uint  [read-only]

The amount of dependencies on the projected position.


Implementation
    public function get projectionDependencies():uint
secondaryUVDependenciesproperty 
secondaryUVDependencies:uint  [read-only]

The amount of dependencies on the secondary UV coordinates.


Implementation
    public function get secondaryUVDependencies():uint
tangentDependenciesproperty 
tangentDependencies:uint  [read-only]

The amount of tangent vector dependencies (fragment shader).


Implementation
    public function get tangentDependencies():uint
usesGlobalPosFragmentproperty 
usesGlobalPosFragment:Boolean  [read-only]

Indicates whether there are any dependencies on the world-space position vector.


Implementation
    public function get usesGlobalPosFragment():Boolean
uvDependenciesproperty 
uvDependencies:uint  [read-only]

The amount of dependencies on the primary UV coordinates.


Implementation
    public function get uvDependencies():uint
viewDirDependenciesproperty 
viewDirDependencies:uint  [read-only]

The amount of dependencies on the view direction.


Implementation
    public function get viewDirDependencies():uint
Constructor Detail
MethodDependencyCounter()Constructor
public function MethodDependencyCounter()

Creates a new MethodDependencyCounter object.

Method Detail
addWorldSpaceDependencies()method
public function addWorldSpaceDependencies(fragmentLights:Boolean):void

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

Parameters

fragmentLights:Boolean

includeMethodVO()method 
public function includeMethodVO(methodVO:MethodVO):void

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

Parameters

methodVO:MethodVO — the MethodVO object for which to include dependencies.

reset()method 
public function reset():void

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

setPositionedLights()method 
public function setPositionedLights(numPointLights:uint, lightSourceMask:uint):void

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

Parameters

numPointLights:uint — The amount of point lights.
 
lightSourceMask:uint — The light source types used by the material.