Skip to content

WGSLUtils

Overview

Represents a compiled shader and associated data.

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

Type GlobalIndexable

import type { GlobalIndexable } from 'scenerystack/alpenglow';
  • globalIndex?: WGSLExpressionU32
    expression: u32 (the global index of the thread) - overrideable so we can run multiple smaller loads in the same workgroup if ever desired

Type GrainSizable

import type { GrainSizable } from 'scenerystack/alpenglow';
  • grainSize: number
    the number of elements each thread should process

Type LocalIndexable

import type { LocalIndexable } from 'scenerystack/alpenglow';
  • localIndex?: WGSLExpressionU32
    expression: u32 (the index of the thread within the workgroup) - overrideable so we can run multiple smaller loads in the same workgroup if ever desired

Type OptionalLengthExpressionable

import type { OptionalLengthExpressionable } from 'scenerystack/alpenglow';
  • lengthExpression?: WGSLExpressionU32 | null
    if provided, it will enable range checks (based on whatever input order of the data was given)

Type RakedSizable

import type { RakedSizable } from 'scenerystack/alpenglow';

WorkgroupSizable & GrainSizable

Type WorkgroupIndexable

import type { WorkgroupIndexable } from 'scenerystack/alpenglow';
  • workgroupIndex?: WGSLExpressionU32
    expression: u32 (the index of the workgroup) - overrideable so we can run multiple smaller loads in the same workgroup if ever desired

Type WorkgroupSizable

import type { WorkgroupSizable } from 'scenerystack/alpenglow';
  • workgroupSize: number
    the number of threads running this command

Source Code

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