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 _bs

_bs: BlendState = new BlendState()

Protected _buffers

_buffers: Buffer[] = []

Protected _defines

_defines: MacroRecord

Protected _descriptorSet

_descriptorSet: DescriptorSet = null!

Protected _device

_device: Device

Protected _dss

_dss: DepthStencilState = new DepthStencilState()

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

Protected _rootBufferDirty

_rootBufferDirty: boolean = false

Protected _rs

_rs: RasterizerState = new RasterizerState()

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(): Record<string, string | number | boolean>

depthStencilState

descriptorSet

device

dynamicStates

dynamics

handle

  • get handle(): PassHandle

hash

  • get hash(): number

localSetLayout

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

Private destroyHandle

  • _destroyHandle(): void

Protected doInit

Private initPassFromTarget

Protected syncBatchingScheme

  • _syncBatchingScheme(): void

Private beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindSampler

  • bindSampler(binding: number, value: Sampler, index?: undefined | number): void
  • Bind a GFX Sampler the the given uniform binding

    Parameters

    • binding: number

      The binding for target uniform of sampler type

    • value: Sampler

      Target sampler

    • Optional index: undefined | number

    Returns void

bindTexture

  • bindTexture(binding: number, value: Texture, index?: undefined | number): void
  • Bind a GFX Texture the the given uniform binding

    Parameters

    • binding: number

      The binding for target uniform of texture type

    • value: Texture

      Target texture

    • Optional index: undefined | number

    Returns void

destroy

  • destroy(): void

Private 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

  • tryCompile(): boolean

update

  • update(): void

Static fillPipelineInfo

Static getPassHash

  • getPassHash(pass: Pass, hShader: ShaderHandle): number

Generated using TypeDoc