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 _bs

_bs: BlendState = new BlendState()

Protected _buffers

_buffers: Buffer[] = []

Protected _defines

_defines: MacroRecord

Protected _descriptorSet

_descriptorSet: DescriptorSet = null!

Protected _device

_device: Device

Private _dontNotify

_dontNotify: boolean = false

Protected _dss

_dss: DepthStencilState = new DepthStencilState()

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: Buffer | null = null

Protected _rootBufferDirty

_rootBufferDirty: boolean = false

Protected _rs

_rs: RasterizerState = new RasterizerState()

Protected _shaderInfo

_shaderInfo: IProgramInfo = null!

Accessors

batchingScheme

blendState

blocks

  • get blocks(): Float32Array[]

defines

  • get defines(): Record<string, string | number | boolean>

depthStencilState

descriptorSet

device

dynamicStates

dynamics

handle

  • get handle(): PassHandle

hash

  • get hash(): number

localSetLayout

parent

  • get parent(): Pass

passIndex

  • get passIndex(): number

phase

  • get phase(): number

primitive

priority

program

  • get program(): string

properties

propertyIndex

  • get propertyIndex(): number

rasterizerState

root

rootBufferDirty

  • get rootBufferDirty(): boolean

shaderInfo

stage

Methods

Protected doInit

Protected onStateChange

  • _onStateChange(): void

Protected syncBatchingScheme

  • _syncBatchingScheme(): void

beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindSampler

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

bindTexture

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

destroy

  • destroy(): void

endChangeStatesSilently

  • endChangeStatesSilently(): void

getBinding

  • getBinding(name: string): number

getHandle

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

    example
    import { Vec3, gfx } 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, gfx.Type.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: Type = Type.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

  • getUniform<T>(handle: number, out: T): T

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

update

  • update(): void

Generated using TypeDoc