Skip to content

ConsoleLogger

Overview

Supports "console logging" from shaders. See log.wgsl.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class ConsoleLogger

import { ConsoleLogger } from 'scenerystack/alpenglow';

Static Methods

register( info : StrictOmit<ConsoleLogInfo<T>, 'id'> ) : number

analyze( arrayBuffer : ArrayBuffer ) : ConsoleLoggedShader[]

Class ConsoleLoggedEntry

import { ConsoleLoggedEntry } from 'scenerystack/alpenglow';

Constructor

new ConsoleLoggedEntry( info : ConsoleLogInfo, data : T, additionalIndex : number | null, otherEntries : ConsoleLoggedEntry[] )

Instance Methods

Instance Properties

uniqueId : string

(readonly)

Class ConsoleLoggedLine

import { ConsoleLoggedLine } from 'scenerystack/alpenglow';

Constructor

new ConsoleLoggedLine( info : ConsoleLogInfo, additionalIndex : number | null, dataArray : T[], threads : ConsoleLoggedThread[] )

Instance Methods

Static Methods

toLogNull( line : ConsoleLoggedLine ) : unknown

toLogRaw( line : ConsoleLoggedLine ) : unknown

toLogExisting( line : ConsoleLoggedLine ) : unknown

toLogExistingFlat( line : ConsoleLoggedLine ) : unknown

Class ConsoleLoggedShader

import { ConsoleLoggedShader } from 'scenerystack/alpenglow';

Instance Methods

add( info : ConsoleLogInfo, workgroupIndex : Vector3, localIndex : Vector3, data : unknown, additionalIndex : number | null )

isEmpty() : boolean

finalize()

Instance Properties

shaderName : string | null

threads : ConsoleLoggedThread[]

(readonly)

threadMap : Record<string, ConsoleLoggedThread>

(readonly)

logLines : ConsoleLoggedLine[]

(readonly)

Class ConsoleLoggedThread

TODO: Should we create ConsoleLoggedWorkgroup?

import { ConsoleLoggedThread } from 'scenerystack/alpenglow';

Constructor

new ConsoleLoggedThread( workgroupIndex : Vector3, localIndex : Vector3 )

Instance Methods

add( info : ConsoleLogInfo, data : unknown, additionalIndex : number | null )

compare( other : ConsoleLoggedThread ) : number

Instance Properties

entries : ConsoleLoggedEntry[]

(readonly)

Type ConsoleLogInfo

import type { ConsoleLogInfo } from 'scenerystack/alpenglow';
  • id: number
    Filled in when registered
  • logName: string
    Provided by the registering code
  • shaderName: string
  • hasAdditionalIndex: boolean
  • type: ConcreteType<T> | null
  • dataCount: number | null
  • lineToLog: ( line: ConsoleLoggedLine ) => unknown

Source Code

See the source for ConsoleLogger.ts in the alpenglow repository.