Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pass

渲染 pass,储存实际描述绘制过程的各项资源。

Hierarchy

Index

Constructors

constructor

Properties

Protected _batchedBuffer

_batchedBuffer: BatchedBuffer | null = null

Protected _bindings

_bindings: IGFXBinding[] = []

Protected _blocks

_blocks: IBlock[] = []

Protected _bs

_bs: GFXBlendState = new GFXBlendState()

Protected _buffers

_buffers: Record<number, GFXBuffer>

Protected _customizations

_customizations: string[] = []

Protected _defines

_defines: IDefineMap

Protected _device

_device: GFXDevice

Protected _dss

_dss: GFXDepthStencilState = new GFXDepthStencilState()

Protected _dynamicStates

_dynamicStates: GFXDynamicState[] = []

Protected _dynamics

_dynamics: IPassDynamics

Protected _handleMap

_handleMap: Record<string, number>

Protected _hash

_hash: number = 0

Protected _idxInTech

_idxInTech: number = 0

Protected _phase

_phase: number = getPhaseID('default')

Protected _primitive

_primitive: GFXPrimitiveMode = GFXPrimitiveMode.TRIANGLE_LIST

Protected _priority

_priority: RenderPriority = RenderPriority.DEFAULT

Protected _programName

_programName: string = ""

Protected _properties

_properties: Record<string, IPropertyInfo>

Protected _renderPass

_renderPass: GFXRenderPass | null = null

Protected _resources

_resources: IPassResources[] = []

Protected _rs

_rs: GFXRasterizerState = new GFXRasterizerState()

Protected _samplers

_samplers: Record<number, GFXSampler>

Protected _shader

_shader: GFXShader | null = null

Protected _shaderInfo

_shaderInfo: IProgramInfo = null!

Protected _stage

_stage: RenderPassStage = RenderPassStage.DEFAULT

Protected _textureViews

_textureViews: Record<number, GFXTextureView>

Static getBindingFromHandle

getBindingFromHandle: getBindingFromHandle = getBindingFromHandle

根据 handle 获取 binding。

Static getBindingTypeFromHandle

getBindingTypeFromHandle: getBindingTypeFromHandle = getBindingTypeFromHandle

根据 handle 获取 unform 的绑定类型(UBO 或贴图等)。

Static Protected getOffsetFromHandle

getOffsetFromHandle: getOffsetFromHandle = getOffsetFromHandle

Static getTypeFromHandle

getTypeFromHandle: getTypeFromHandle = getTypeFromHandle

根据 handle 获取 UBO member 的具体类型。

Accessors

batchedBuffer

  • get batchedBuffer(): null | BatchedBuffer

bindings

blendState

blocks

customizations

  • get customizations(): string[]

defines

depthStencilState

device

dynamicStates

dynamics

hash

  • get hash(): number

idxInTech

  • get idxInTech(): number

phase

  • get phase(): number

primitive

priority

program

  • get program(): string

properties

  • get properties(): object

rasterizerState

renderPass

shader

shaderInfo

stage

Methods

Protected doInit

beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindBuffer

  • bindBuffer(binding: number, value: GFXBuffer): void

bindSampler

  • bindSampler(binding: number, value: GFXSampler): void

bindTextureView

createBatchedBuffer

  • createBatchedBuffer(): void

createPipelineState

destroy

  • destroy(): void

destroyPipelineState

endChangeStatesSilently

  • endChangeStatesSilently(): void

getBinding

  • getBinding(name: string): undefined | number

getHandle

  • getHandle(name: string, offset?: number, targetType?: GFXType): number | undefined
  • 获取指定 UBO 成员,或其更具体分量的读写句柄。默认以成员自身的类型为目标读写类型(即读写时必须传入与成员类型相同的变量)。

    example
    // say 'pbrParams' is a uniform vec4
    const hParams = pass.getHandle('pbrParams'); // get the default handle
    pass.setUniform(hAlbedo, cc.v3(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, cc.GFXType.FLOAT);
    pass.setUniform(hThreshold, 0.5); // now, albedoScale.w = 0.5

    Parameters

    • name: string

      目标 UBO 成员名

    • Default value offset: number = 0

      目标分量在成员内的偏移量

    • Default value targetType: GFXType = GFXType.UNKNOWN

      目标读写类型,用于定制化在使用此句柄时,将以什么类型进行读写操作

    Returns number | undefined

getUniform

  • getUniform(handle: number, out: any): any
  • 获取指定普通向量类 uniform 的值。

    Parameters

    • handle: number

      目标 uniform 的 handle。

    • out: any

      输出向量。

    Returns any

initialize

overridePipelineStates

resetTextures

  • resetTextures(): void

resetUBOs

  • resetUBOs(): void

setDynamicState

setUniform

  • setUniform(handle: number, value: any): void
  • 设置指定普通向量类 uniform 的值,如果需要频繁更新请尽量使用此接口。

    Parameters

    • handle: number

      目标 uniform 的 handle。

    • value: any

      目标值。

    Returns void

setUniformArray

  • setUniformArray(handle: number, value: any[]): void
  • 设置指定数组类 uniform 的值,如果需要频繁更新请尽量使用此接口。

    Parameters

    • handle: number

      目标 uniform 的 handle。

    • value: any[]

      目标值。

    Returns void

tryCompile

  • tryCompile(): null | false | true

update

  • update(): void

Static fillinPipelineInfo

Static getPSOHash

Generated using TypeDoc