search
/
·
Intro
expand_more
Guides
·
Getting started
·
WebGPU canvas
·
Drawing and animation
·
Scene geometry
·
2D and 3D plot
·
Data-driven geometry
·
Live vs React
·
Memoization
·
WGSL Shaders
·
Renderers and Passes
·
Layout and UI
·
Background
·
Roadmap
·
Contributing
Reference
chevron_right
Components
expand_more
Libraries
chevron_right
@use-gpu/core
chevron_right
@use-gpu/glyph
expand_more
@use-gpu/shader
east
bindBundle
east
bindEntryPoint
east
bindingsToLinks
east
bindingToModule
east
bindModule
east
bundleToAttribute
east
bundleToAttributes
east
castTo
east
chainTo
east
compressAST
east
decompressAST
east
defineConstants
east
diffBy
east
extractBindings
east
f32
east
getBundleEntry
east
getBundleHash
east
getBundleKey
east
i32
east
linkBundle
east
linkCode
east
linkModule
east
loadModule
east
loadModuleWithCache
east
loadStaticModule
east
makeASTParser
east
makeModuleCache
east
rewriteUsingAST
east
sourceToModule
east
swizzleTo
east
toBundle
east
toModule
east
transpileWGSL
east
u32
east
wgsl
data_object
GLSLLinker
data_object
parser
data_object
resolveBindings
data_object
WGSLLinker
title
AnnotatedTypeRef
title
ASTParser
title
AttributeRef
title
AttributesRef
title
CompressedNode
title
DataBinding
title
DeclarationRef
title
EnableRef
title
FunctionHeaderRef
title
FunctionRef
title
IdentifiersRef
title
ImportRef
title
InferrableRef
title
InferRef
title
LambdaSource
title
ModuleRef
title
ParameterLike
title
ParameterRef
title
ParsedBundle
title
ParsedModule
title
ParsedModuleCache
title
QualifiedTypeAliasRef
title
ReturnTypeRef
title
ShaderDefine
title
ShaderModule
title
ShaderSource
title
ShakeOp
title
ShakeTable
title
StorageSource
title
StructMemberRef
title
StructRef
title
SymbolTable
title
SymbolTableT
title
TextureSource
title
TypeAliasRef
title
TypeLike
title
TypeRef
title
UniformAttribute
title
UniformAttributeValue
title
UniformShaderAttribute
title
VariableDeclarationRef
title
VariableRef
title
VirtualRender
title
VirtualTable
format_list_bulleted
RefFlags
inventory_2
@use-gpu/wgsl
chevron_right
Live
chevron_right
Loaders
chevron_right
Development

east Function – transpileWGSL

const transpileWGSL: (
  source: string,
  resourcePath: string,
  esModule?: boolean,
  minify?: boolean,
) => string

ES/CommonJS Transpiler

Source

packages / shader / src / wgsl / shader.ts

Sections
Source  
menu
format_list_numbered