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 _inputState

_inputState: GFXInputState = new GFXInputState()

Protected _instancedBuffer

_instancedBuffer: InstancedBuffer | null = null

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

inputState

instancedBuffer

  • get instancedBuffer(): null | InstancedBuffer

phase

  • get phase(): number

primitive

priority

program

  • get program(): string

properties

  • get properties(): object

rasterizerState

renderPass

shader

shaderInfo

stage

Methods

Protected doInit

Protected dynamicBatchingSync

  • _dynamicBatchingSync(): void

Protected getShaderWithBuiltinMacroPatches

beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindBuffer

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

bindSampler

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

bindTextureView

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

      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 | undefined

getUniform

initialize

overridePipelineStates

resetTexture

  • resetTexture(name: string): void

resetTextures

  • resetTextures(): void

resetUBOs

  • resetUBOs(): void

resetUniform

  • resetUniform(name: string): void

setDynamicState

setUniform

setUniformArray

tryCompile

  • tryCompile(): null | false | true

update

  • update(): void

Static fillinPipelineInfo

Static getPSOHash

Generated using TypeDoc