Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PassInstance

A pass instance defines an variant version of the Pass

Hierarchy

Index

Type aliases

Static PropertyType

PropertyType: typeof PropertyType

Static fillPipelineInfo

fillPipelineInfo: typeof fillPipelineInfo

Static getBindingFromHandle

getBindingFromHandle: typeof getBindingFromHandle

Static getOffsetFromHandle

getOffsetFromHandle: typeof getOffsetFromHandle

Static getPassHash

getPassHash: typeof getPassHash

Static getPropertyTypeFromHandle

getPropertyTypeFromHandle: typeof getPropertyTypeFromHandle

Static getTypeFromHandle

getTypeFromHandle: typeof getTypeFromHandle

Constructors

constructor

Properties

Protected _blocks

_blocks: Float32Array[] = []

Protected _buffers

_buffers: GFXBuffer[] = []

Protected _defines

_defines: MacroRecord

Protected _descriptorSet

_descriptorSet: GFXDescriptorSet = null!

Protected _device

_device: GFXDevice

Private _dontNotify

_dontNotify: boolean = false

Protected _dynamics

_dynamics: IPassDynamics

Protected _hShaderDefault

_hShaderDefault: ShaderHandle = NULL_HANDLE

Protected _handle

_handle: PassHandle = NULL_HANDLE

Private _owner

Private _parent

_parent: Pass

Protected _passIndex

_passIndex: number = 0

Protected _programName

_programName: string = ""

Protected _properties

_properties: Record<string, IPropertyInfo>

Protected _propertyHandleMap

_propertyHandleMap: Record<string, number>

Protected _propertyIndex

_propertyIndex: number = 0

Protected _root

_root: Root

Protected _rootBlock

_rootBlock: ArrayBuffer | null = null

Protected _rootBuffer

_rootBuffer: GFXBuffer | null = null

Protected _rootBufferDirty

_rootBufferDirty: boolean = false

Protected _shaderInfo

_shaderInfo: IProgramInfo = null!

Accessors

batchingScheme

blendState

blocks

  • get blocks(): Float32Array[]

defines

  • get defines(): {}

depthStencilState

descriptorSet

device

dynamicStates

dynamics

handle

  • get handle(): IHandle<PASS>

hash

  • get hash(): number

parent

  • get parent(): Pass

passIndex

  • get passIndex(): number

phase

  • get phase(): number

primitive

priority

  • get priority(): number

program

  • get program(): string

properties

  • get properties(): {}

propertyIndex

  • get propertyIndex(): number

rasterizerState

root

setLayouts

shaderInfo

stage

Methods

Protected doInit

Protected onStateChange

  • _onStateChange(): void

Protected syncBatchingScheme

  • _syncBatchingScheme(): void

beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindSampler

  • bindSampler(binding: number, value: GFXSampler, index?: undefined | number): void

bindTexture

  • bindTexture(binding: number, value: GFXTexture, index?: undefined | number): void

destroy

  • destroy(): void

endChangeStatesSilently

  • endChangeStatesSilently(): void

getBinding

  • getBinding(name: string): number

getHandle

  • getHandle(name: string, offset?: number, targetType?: GFXType): number
  • Get the handle of a UBO member, or specific channels of it.

    example
    import { Vec3, GFXType } from 'cc';
    // say 'pbrParams' is a uniform vec4
    const hParams = pass.getHandle('pbrParams'); // get the default handle
    pass.setUniform(hAlbedo, new Vec3(1, 0, 0)); // wrong! pbrParams.w is NaN now
    // say 'albedoScale' is a uniform vec4, and we only want to modify the w component in the form of a single float
    const hThreshold = pass.getHandle('albedoScale', 3, GFXType.FLOAT);
    pass.setUniform(hThreshold, 0.5); // now, albedoScale.w = 0.5

    Parameters

    • name: string

      Name of the target UBO member.

    • Default value offset: number = 0

      Channel offset into the member.

    • Default value targetType: GFXType = GFXType.UNKNOWN

      Target type of the handle, i.e. the type of data when read/write to it.

    Returns number

getShaderVariant

  • getShaderVariant(patches?: IMacroPatch[] | null): ShaderHandle

getUniform

initialize

overridePipelineStates

resetTexture

  • resetTexture(name: string, index?: undefined | number): void

resetTextures

  • resetTextures(): void

resetUBOs

  • resetUBOs(): void

resetUniform

  • resetUniform(name: string): void

setDynamicState

setUniform

setUniformArray

tryCompile

  • tryCompile(defineOverrides?: MacroRecord): null | false | true

update

  • update(): void

Generated using TypeDoc