Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PassInstance

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

Private _dontNotify

_dontNotify: boolean = false

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

Private _owner

Private _parent

_parent: Pass

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
  • Returns null | BatchedBuffer

bindings

blendState

blocks

  • Returns IBlock[]

customizations

  • get customizations(): string[]
  • Returns string[]

defines

depthStencilState

device

dynamicStates

dynamics

hash

  • get hash(): number
  • Returns number

idxInTech

  • get idxInTech(): number
  • Returns number

parent

  • get parent(): Pass
  • Returns Pass

phase

  • get phase(): number
  • Returns number

primitive

priority

program

  • get program(): string
  • Returns string

properties

  • get properties(): object
  • Returns object

rasterizerState

renderPass

shader

shaderInfo

stage

  • Returns DEFAULT

Methods

Protected doInit

  • Parameters

    Returns void

Protected onStateChange

  • _onStateChange(): void
  • Returns void

beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindBuffer

  • bindBuffer(binding: number, value: GFXBuffer): void
  • 绑定实际 GFXBuffer 到指定 binding。

    Parameters

    • binding: number

      目标 UBO 的 binding。

    • value: GFXBuffer

      目标 buffer。

    Returns void

bindSampler

  • bindSampler(binding: number, value: GFXSampler): void
  • 绑定实际 GFXSampler 到指定 binding。

    Parameters

    • binding: number

      目标贴图类 uniform 的 binding。

    • value: GFXSampler

      目标 sampler。

    Returns void

bindTextureView

  • 绑定实际 GFXTextureView 到指定 binding。

    Parameters

    • binding: number

      目标贴图类 uniform 的 binding。

    • value: GFXTextureView

      目标 texture view。

    Returns void

createBatchedBuffer

  • createBatchedBuffer(): void

createPipelineState

destroy

  • destroy(): void
  • 销毁当前 pass。

    Returns void

destroyPipelineState

endChangeStatesSilently

  • endChangeStatesSilently(): void

getBinding

  • getBinding(name: string): undefined | number
  • 获取指定 uniform 的 binding。

    Parameters

    • name: string

      目标 uniform 名。

    Returns 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

  • 根据指定参数初始化当前 pass,shader 会在这一阶段就尝试编译。

    Parameters

    Returns void

overridePipelineStates

resetTextures

  • resetTextures(): void
  • 重置所有 texture 和 sampler 为初始默认值。

    Returns void

resetUBOs

  • resetUBOs(): void
  • 重置所有 UBO 为初始默认值。

    Returns void

setDynamicState

  • 设置运行时 pass 内可动态更新的管线状态属性。

    Parameters

    Returns void

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(defineOverrides?: IDefineMap): null | false | true
  • Parameters

    Returns null | false | true

update

  • update(): void
  • 更新当前 Uniform 数据。

    Returns void

Static fillinPipelineInfo

Static getPSOHash

  • 根据指定 PSO 信息计算 hash

    Parameters

    • psoInfo: IPSOHashInfo

      用于计算 PSO hash 的最小必要信息

    Returns number

Generated using TypeDoc