Skip to content

@tmrw-realityos/charmDocs


@tmrw-realityos/charm / PipelineInfo

Class: PipelineInfo

This class helps build and hash pipelines by converting some complex object into a single 32bits number. It only covers the most common cases like blending, depth, culling, multisample and topology. Cases not covered: geometry stride, separate blending, For most complex cases you need to build the pipelinedescriptor manually.

Usage

Just create an instance and assign the flags you want. There are two ways to do so, one using the setters:

typescript
const desc = new PipelineInfo();
desc.topology = Topology.triangleList;
desc.cullMode = CullMode.front;

Or another one using const flags (faster):

typescript
const desc = new PipelineInfo();
desc.hash = TRIANGLELIST | CULLMODE_FRONT | DEPTH_LESS | DEPTH_WRITE

Keep in mind that the default pipeline is: DEPTH_ALWAYS | CULLMODE_NONE | NO_BLEND

Constructors

new PipelineInfo()

new PipelineInfo(v): PipelineInfo

Parameters

v: number = DEFAULT_PIPELINE

Returns

PipelineInfo

Defined in

packages/charm/src/graphics/pipelineInfo.ts:331

Properties

hash

hash: number = DEFAULT_PIPELINE

Defined in

packages/charm/src/graphics/pipelineInfo.ts:327


default

static default: PipelineInfo

Defined in

packages/charm/src/graphics/pipelineInfo.ts:329

Accessors

blendOperation

get blendOperation(): BlendOperation

set blendOperation(value): void

Parameters

value: BlendOperation

Returns

BlendOperation

Defined in

packages/charm/src/graphics/pipelineInfo.ts:409


colorFormat

get colorFormat(): ColorFormat

set colorFormat(value): void

Parameters

value: ColorFormat

Returns

ColorFormat

Defined in

packages/charm/src/graphics/pipelineInfo.ts:441


cullMode

get cullMode(): CullMode

set cullMode(value): void

Parameters

value: CullMode

Returns

CullMode

Defined in

packages/charm/src/graphics/pipelineInfo.ts:361


depthCompare

get depthCompare(): DepthCompare

set depthCompare(value): void

Parameters

value: DepthCompare

Returns

DepthCompare

Defined in

packages/charm/src/graphics/pipelineInfo.ts:370


depthFormat

get depthFormat(): DepthFormat

set depthFormat(value): void

Parameters

value: DepthFormat

Returns

DepthFormat

Defined in

packages/charm/src/graphics/pipelineInfo.ts:451


depthWrite

get depthWrite(): boolean

set depthWrite(value): void

Parameters

value: boolean

Returns

boolean

Defined in

packages/charm/src/graphics/pipelineInfo.ts:380


dstBlendFactor

get dstBlendFactor(): BlendFactor

set dstBlendFactor(value): void

Parameters

value: BlendFactor

Returns

BlendFactor

Defined in

packages/charm/src/graphics/pipelineInfo.ts:431


geometryBuffers

get geometryBuffers(): number

set geometryBuffers(value): void

Parameters

value: number

Returns

number

Defined in

packages/charm/src/graphics/pipelineInfo.ts:345


multisample

get multisample(): boolean

set multisample(value): void

Parameters

value: boolean

Returns

boolean

Defined in

packages/charm/src/graphics/pipelineInfo.ts:390


perInstance

get perInstance(): boolean

set perInstance(value): void

Parameters

value: boolean

Returns

boolean

Defined in

packages/charm/src/graphics/pipelineInfo.ts:400


srcBlendFactor

get srcBlendFactor(): BlendFactor

set srcBlendFactor(value): void

Parameters

value: BlendFactor

Returns

BlendFactor

Defined in

packages/charm/src/graphics/pipelineInfo.ts:420


topology

get topology(): Topology

set topology(value): void

Parameters

value: Topology

Returns

Topology

Defined in

packages/charm/src/graphics/pipelineInfo.ts:353

Methods

clear()

clear(): void

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:335


disableBlend()

disableBlend(): void

This is not a flag, it helps change several flags in one function

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:470


getDescriptor()

getDescriptor(): IPipelineSimpleDescriptor

Returns

IPipelineSimpleDescriptor

Defined in

packages/charm/src/graphics/pipelineInfo.ts:503


setBlend()

setBlend(op, src, dst): void

This is not a flag, it helps change several flags in one function

Parameters

op: BlendOperation

src: BlendFactor

dst: BlendFactor

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:463


setColorFormatFromString()

setColorFormatFromString(value): void

Parameters

value: string

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:491


setDepthFormatFromString()

setDepthFormatFromString(value): void

Parameters

value: string

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:497


setDepthTest()

setDepthTest(v): void

this is not a flag, just helpers to change depthWrite and depthCompare flags

Parameters

v: boolean

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:457


setOutput()

setOutput(output, compatible): void

Sets color format and multisample based on a texture properties. Compatible flag forces to find a compatible format (using sRGB when necessary)

Parameters

output: GPUTexture

compatible: boolean = true

Returns

void

Defined in

packages/charm/src/graphics/pipelineInfo.ts:479


descriptorFromHash()

static descriptorFromHash(h): IPipelineSimpleDescriptor

Constructs a simple pipeline descriptor based on the pipeline flags

Parameters

h: number

Returns

IPipelineSimpleDescriptor

Defined in

packages/charm/src/graphics/pipelineInfo.ts:508