Milky2018/wgsl/ir does not have a README file
pub suberror WgslIrLowerError {
Parse(String)
MissingType(String)
UnsupportedType(String)
UnsupportedExpression(String)
UnsupportedStatement(String)
UnknownIdentifier(String)
}pub suberror WgslIrPipelineError {
Lower(String)
UnknownIdentifier(String)
Emit(String)
Validate(String)
Reparse(String)
}pub suberror WgslIrTypeSpellingError {
MissingType(Int)
MissingTypeName(Int)
MissingGlobalExpression(Int)
UnsupportedTypeSpelling(String)
}pub suberror WgslIrValidationError {
InvalidTypeHandle(Int)
InvalidConstantHandle(Int)
InvalidOverrideHandle(Int)
InvalidGlobalVariableHandle(Int)
InvalidGlobalExpressionHandle(Int)
InvalidFunctionHandle(Int)
InvalidLocalVariableHandle(Int)
InvalidFunctionExpressionHandle(Int)
InvalidHandleRange(Int, Int)
InvalidEntryPoint(String)
MissingExpressionType(Int, String)
InvalidConditionType(String, Int, String, String)
InvalidStoreTarget(Int)
InvalidReturnValue(String)
InvalidFunctionArgumentCount(String, Int, Int)
InvalidFunctionArgumentType(String, Int)
InvalidFunctionResult(String)
InvalidType(String)
InvalidGlobalVariable(String)
InvalidExpression(String, Int)
InvalidStatement(String)
}pub(all) enum AddressSpace {
Function
Private
WorkGroup
Uniform
Storage(StorageAccess)
Handle
Immediate
TaskPayload
RayPayload
IncomingRayPayload
} derive(Eq, Debug)pub(all) enum Binding {
BuiltIn(BuiltIn)
Location(Int, Interpolation?, Sampling?, Int?, Bool)
} derive(Eq, Debug)pub(all) enum BuiltIn {
PrimitiveIndex
Position(Bool)
ViewIndex
BaseInstance
BaseVertex
ClipDistances
CullDistance
InstanceIndex
PointSize
VertexIndex
DrawIndex
FragDepth
PointCoord
FrontFacing
Barycentric(Bool)
SampleIndex
SampleMask
GlobalInvocationId
LocalInvocationId
LocalInvocationIndex
WorkGroupId
WorkGroupSize
NumWorkGroups
NumSubgroups
SubgroupId
SubgroupSize
SubgroupInvocationId
MeshTaskSize
CullPrimitive
PointIndex
LineIndices
TriangleIndices
VertexCount
Vertices
PrimitiveCount
Primitives
RayInvocationId
NumRayInvocations
InstanceCustomData
GeometryIndex
WorldRayOrigin
WorldRayDirection
ObjectRayOrigin
ObjectRayDirection
RayTmin
RayTCurrentMax
ObjectToWorld
WorldToObject
HitKind
} derive(Eq, Debug)pub(all) struct DiagnosticFilter {
new_severity : Severity
triggering_rule : FilterableTriggeringRule
} derive(Eq, Debug)fn DiagnosticFilterArena::append(self : DiagnosticFilterArena, item : DiagnosticFilterNode) -> Handlepub(all) struct DocComments {
types : Array[(Handle, Array[String])]
struct_members : Array[(Handle, Int, Array[String])]
entry_points : Array[(Int, Array[String])]
functions : Array[(Handle, Array[String])]
constants : Array[(Handle, Array[String])]
global_variables : Array[(Handle, Array[String])]
module_comments : Array[String]
} derive(Eq, Debug)pub(all) struct EntryPoint {
name : String
source_start : Int
stage : ShaderStage
early_depth_test : EarlyDepthTest?
workgroup_size : Array[Int]
workgroup_size_overrides : Array[Handle?]?
function : Function
mesh_info : MeshStageInfo?
task_payload : Handle?
incoming_ray_payload : Handle?
} derive(Eq, Debug)pub(all) enum Expression {
Literal(Literal)
Constant(Handle)
Override(Handle)
ZeroValue(Handle)
Compose(Handle, Array[Handle])
Access(Handle, Handle)
AccessIndex(Handle, Int)
Component(Handle, SwizzleComponent)
Splat(VectorSize, Handle)
Swizzle(VectorSize, Handle, Array[SwizzleComponent])
FunctionArgument(Int)
GlobalVariable(Handle)
LocalVariable(Handle)
Load(Handle)
AddressOf(Handle, Handle)
AtomicCall(AtomicFunction, Array[Handle])
ImageSample(Handle, Handle, SwizzleComponent?, Handle, Handle?, Handle?, SampleLevel, Handle?, Bool)
ImageLoad(Handle, Handle, Handle?, Handle?, Handle?)
ImageQuery(Handle, ImageQuery)
Unary(UnaryOperator, Handle)
Binary(BinaryOperator, Handle, Handle)
FunctionCall(Handle, Array[Handle])
Select(Handle, Handle, Handle)
Bitcast(Handle, Handle)
Derivative(DerivativeAxis, DerivativeControl, Handle)
Relational(RelationalFunction, Handle)
Math(MathFunction, Handle, Handle?, Handle?, Handle?)
As(Handle, ScalarKind, Int?)
CallResult(Handle)
AtomicResult(Handle, Bool)
WorkGroupUniformLoadResult(Handle)
WorkGroupUniformLoad(Handle)
ArrayLength(Handle)
RayQueryInitialize(Handle, Handle, Handle)
RayQueryProceed(Handle)
RayQueryGenerateIntersection(Handle, Handle)
RayQueryConfirmIntersection(Handle)
RayQueryTerminate(Handle)
RayQueryVertexPositions(Handle, Bool)
RayQueryProceedResult
RayQueryGetIntersection(Handle, Bool)
SubgroupCall(SubgroupFunction, Array[Handle])
SubgroupBallotResult
SubgroupOperationResult(Handle)
CooperativeLoad(CooperativeSize, CooperativeSize, CooperativeRole, CooperativeData)
CooperativeMultiplyAdd(Handle, Handle, Handle)
} derive(Eq, Debug)pub(all) struct ExpressionArena {
items : Array[Expression]
origins : Array[ExpressionOrigin]
} derive(Eq, Debug)pub(all) enum FilterableTriggeringRule {
Standard(StandardFilterableTriggeringRule)
Unknown(String)
User(String, String)
} derive(Eq, Debug)fn FilterableTriggeringRule::not_equal(x : FilterableTriggeringRule, y : FilterableTriggeringRule) -> Boolpub(all) struct Function {
name : String?
source_start : Int
arguments : Array[FunctionArgument]
result : FunctionResult?
local_variables : LocalVariableArena
expressions : ExpressionArena
named_expressions : Array[NamedExpression]
body : Block
diagnostic_filter_leaf : Handle?
} derive(Eq, Debug)pub(all) struct GlobalVariable {
name : String?
space : AddressSpace
binding : ResourceBinding?
ty : Handle
init : Handle?
memory_decorations : MemoryDecorations
} derive(Eq, Debug)fn GlobalVariableArena::set(self : GlobalVariableArena, handle : Handle, item : GlobalVariable) -> Unitpub(all) enum ImageClass {
Sampled(ScalarKind, Bool)
Depth(Bool)
External
Storage(StorageFormat, StorageAccess)
} derive(Eq, Debug)pub(all) struct LocalVariable {
name : String?
kind : LocalVariableKind
generated_temporary : Bool
generated_temporary_store_value_reference : Bool
short_circuit_result : Bool
ty : Handle
init : Handle?
} derive(Eq, Debug)pub(all) enum MathFunction {
Abs
Min
Max
Clamp
Saturate
Cos
Cosh
Sin
Sinh
Tan
Tanh
Acos
Asin
Atan
Atan2
Asinh
Acosh
Atanh
Radians
Degrees
Ceil
Floor
Round
Fract
Trunc
Modf
Frexp
Ldexp
Exp
Exp2
Log
Log2
Pow
Dot
Dot4I8Packed
Dot4U8Packed
Outer
Cross
Distance
Length
Normalize
FaceForward
Reflect
Refract
Sign
Fma
Mix
Step
SmoothStep
Sqrt
InverseSqrt
Inverse
Transpose
Determinant
QuantizeToF16
CountTrailingZeros
CountLeadingZeros
CountOneBits
ReverseBits
ExtractBits
InsertBits
FirstTrailingBit
FirstLeadingBit
Pack4x8snorm
Pack4x8unorm
Pack2x16snorm
Pack2x16unorm
Pack2x16float
Pack4xI8
Pack4xU8
Pack4xI8Clamp
Pack4xU8Clamp
Unpack4x8snorm
Unpack4x8unorm
Unpack2x16snorm
Unpack2x16unorm
Unpack2x16float
Unpack4xI8
Unpack4xU8
} derive(Eq, Debug)fn MemoryDecorations::union(self : MemoryDecorations, other : MemoryDecorations) -> MemoryDecorationspub(all) struct Module {
directives : Array[String]
types : TypeArena
special_types : SpecialTypes
constants : ConstantArena
const_asserts : Array[Handle]
overrides : OverrideArena
global_variables : GlobalVariableArena
global_expressions : ExpressionArena
functions : FunctionArena
entry_points : Array[EntryPoint]
diagnostic_filters : DiagnosticFilterArena
diagnostic_filter_leaf : Handle?
doc_comments : DocComments?
} derive(Eq, Debug)pub(all) enum PredeclaredType {
AtomicCompareExchangeWeakResult(Scalar)
ModfResult(VectorSize?, Scalar)
FrexpResult(VectorSize?, Scalar)
} derive(Eq, Debug)fn StandardFilterableTriggeringRule::not_equal(x : StandardFilterableTriggeringRule, y : StandardFilterableTriggeringRule) -> Boolpub(all) enum Statement {
Declare(Handle)
Emit(HandleRange)
Phony(Handle)
Block(Block)
If(Handle, Block, Block)
Switch(Handle, Array[SwitchCase])
Loop(Block, Block, Handle?)
Break
Continue
Return(Handle?)
ImplicitReturn
Kill
ConstAssert(Handle)
ControlBarrier(Barrier)
MemoryBarrier(Barrier)
Store(Handle, Handle)
ImageStore(Handle, Handle, Handle?, Handle)
Atomic(Handle, AtomicFunction, Handle, Handle?, Handle?)
ImageAtomic(Handle, Handle, Handle?, AtomicFunction, Handle)
WorkGroupUniformLoad(Handle, Handle)
Call(Handle, Array[Handle], Handle?)
RayQuery(Handle, RayQueryFunction)
RayPipelineFunction(RayPipelineFunction)
SubgroupBallot(Handle, Handle?)
SubgroupGather(GatherMode, Handle, Handle)
SubgroupCollectiveOperation(SubgroupOperation, CollectiveOperation, Handle, Handle)
CooperativeStore(Handle, CooperativeData)
} derive(Eq, Debug)pub(all) enum StorageFormat {
R8Unorm
R8Snorm
R8Uint
R8Sint
R16Uint
R16Sint
R16Float
Rg8Unorm
Rg8Snorm
Rg8Uint
Rg8Sint
R32Uint
R32Sint
R32Float
Rg16Uint
Rg16Sint
Rg16Float
Rgba8Unorm
Rgba8Snorm
Rgba8Uint
Rgba8Sint
Bgra8Unorm
Rgb10a2Uint
Rgb10a2Unorm
Rg11b10Ufloat
R64Uint
Rg32Uint
Rg32Sint
Rg32Float
Rgba16Uint
Rgba16Sint
Rgba16Float
Rgba32Uint
Rgba32Sint
Rgba32Float
R16Unorm
R16Snorm
Rg16Unorm
Rg16Snorm
Rgba16Unorm
Rgba16Snorm
} derive(Eq, Debug)pub(all) enum SwitchValue {
I32(Int, SwitchCaseLabelStyle)
U32(UInt, SwitchCaseLabelStyle)
Default
} derive(Eq, Debug)pub(all) enum TypeInner {
Scalar(Scalar)
Vector(VectorSize, Scalar)
Matrix(VectorSize, VectorSize, Scalar)
CooperativeMatrix(CooperativeSize, CooperativeSize, Scalar, CooperativeRole)
Atomic(Scalar)
Pointer(Handle, AddressSpace)
ValuePointer(VectorSize?, Scalar, AddressSpace)
Array(Handle, ArraySize, Int)
Struct(Array[StructMember], Int)
PredeclaredStruct(Array[StructMember], Int)
Image(ImageDimension, Bool, ImageClass)
Sampler(Bool)
AccelerationStructure(Bool)
RayQuery(Bool)
BindingArray(Handle, ArraySize)
} derive(Eq, Debug)pub struct WgslIrTypeInference {
// private fields
}fn WgslIrTypeInference::as_expression_result_type(self : WgslIrTypeInference, input : Handle?, kind : ScalarKind, width : Int) -> Handle?fn WgslIrTypeInference::atomic_pointer_scalar_type(self : WgslIrTypeInference, function : Function?, pointer : Handle) -> Scalar?fn WgslIrTypeInference::expression_type(self : WgslIrTypeInference, function : Function?, handle : Handle) -> Handle?pub struct WgslIrTypeSpelling {
// private fields
}fn WgslIrTypeSpelling::address_space_template(self : WgslIrTypeSpelling, space : AddressSpace) -> Stringfn WgslIrTypeSpelling::compose_constructor_name_for_components(self : WgslIrTypeSpelling, handle : Handle, components : Array[Handle], function : Function?) -> String raise WgslIrTypeSpellingErrorfn WgslIrTypeSpelling::expression_is_pointer(self : WgslIrTypeSpelling, function : Function?, handle : Handle) -> Boolfn WgslIrTypeSpelling::expression_is_scalar_type(self : WgslIrTypeSpelling, function : Function?, handle : Handle, scalar : Scalar) -> Boolfn WgslIrTypeSpelling::new(shader_module : Module, final_type_name : (Handle) -> String?, global_expression : (Handle) -> String?, elide_storage_pointer_read_access : Bool, storage_texture_type_argument_separator : String) -> WgslIrTypeSpellingfn WgslIrTypeSpelling::type_contains_abstract_scalar(self : WgslIrTypeSpelling, handle : Handle) -> Boolfn WgslIrTypeSpelling::type_name(self : WgslIrTypeSpelling, handle : Handle) -> String raise WgslIrTypeSpellingErrorfn build_wgsl_ir_reachability(shader_module : Module, root_items : Array[String]) -> WgslIrReachabilityfn tree_shake_wgsl_source_via_ir(source : String, root_items : Array[String]) -> String raise WgslIrPipelineErrorfn wgsl_ir_identifier_ends_with_digit(ident : String) -> Boolfn wgsl_ir_identifier_is_builtin_function(ident : String) -> Boolfn wgsl_ir_identifier_is_predeclared_type(ident : String) -> Bool