Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pass

Render pass, store actual resources for the rendering process

Hierarchy

Index

Constructors

constructor

Properties

Protected _blocks

_blocks: Float32Array[] = []

Protected _buffers

_buffers: GFXBuffer[] = []

Protected _defines

_defines: MacroRecord

Protected _descriptorSet

_descriptorSet: GFXDescriptorSet = null!

Protected _device

_device: GFXDevice

Protected _dynamics

_dynamics: IPassDynamics

Protected _hShaderDefault

_hShaderDefault: ShaderHandle = NULL_HANDLE

Protected _handle

_handle: PassHandle = NULL_HANDLE

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!

Static PropertyType

PropertyType: typeof PropertyType = PropertyType

The binding type enums of the property

Static getBindingFromHandle

getBindingFromHandle: typeof getBindingFromHandle = getBindingFromHandle

Gets the binding with handle

Static Protected getOffsetFromHandle

getOffsetFromHandle: typeof getOffsetFromHandle = getOffsetFromHandle

Static getPropertyTypeFromHandle

getPropertyTypeFromHandle: typeof getPropertyTypeFromHandle = getPropertyTypeFromHandle

Gets the binding type of the property with handle

Static getTypeFromHandle

getTypeFromHandle: typeof getTypeFromHandle = getTypeFromHandle

Gets the type of member in uniform buffer object with the handle

Accessors

batchingScheme

blendState

blocks

  • get blocks(): Float32Array[]

defines

  • get defines(): {}

depthStencilState

descriptorSet

device

dynamicStates

dynamics

handle

  • get handle(): IHandle<PASS>

hash

  • get hash(): number

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 syncBatchingScheme

  • _syncBatchingScheme(): void

Private 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

Private 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(): null | false | true

update

  • update(): void

Static fillPipelineInfo

  • Fill a pass represented by the given pass handle with the given override info

    Parameters

    • hPass: PassHandle

      The pass handle point to the pass

    • info: PassOverrides

      The pass override info

    Returns void

Static getPassHash

  • getPassHash(hPass: PassHandle, hShader: ShaderHandle): number
  • Get pass hash value by Pass hash information.

    Parameters

    • hPass: PassHandle

      Handle of the pass info used to compute hash value.

    • hShader: ShaderHandle

    Returns number

Generated using TypeDoc