Files
wgpu/tests/out/spv/bits.spvasm
T
6035b07b78 [wgsl-in] Implement module-level scoping.
Fixes #1745: Support out-of-order module scope declarations in WGSL
Fixes #1044: Forbid local variable shadowing in WGSL
Fixes #2076: [wgsl-in] no error for duplicated type definition
Fixes #2071: Global item does not support 'const'
Fixes #2105: [wgsl-in] Type aliases for a vecN<T> doesn't work when constructing vec from a single argument
Fixes #1775: Referencing a function without a return type yields an unknown identifier error.
Fixes #2089: Error span reported on the declaration of a variable instead of its use
Fixes #1996: [wgsl-in] Confusing error: "expected unsigned/signed integer literal, found '1'"

Separate parsing from lowering by generating an AST, which desugars as
much as possible down to something like Naga IR. The AST is then used
to resolve identifiers while lowering to Naga IR.

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2023-01-12 09:37:08 -08:00

227 lines
5.8 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 161
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %50 "main"
OpExecutionMode %50 LocalSize 1 1 1
%2 = OpTypeVoid
%4 = OpTypeInt 32 1
%3 = OpConstant %4 0
%6 = OpTypeInt 32 0
%5 = OpConstant %6 0
%8 = OpTypeFloat 32
%7 = OpConstant %8 0.0
%9 = OpConstant %6 5
%10 = OpConstant %6 10
%11 = OpTypeVector %4 2
%12 = OpTypeVector %4 3
%13 = OpTypeVector %4 4
%14 = OpTypeVector %6 2
%15 = OpTypeVector %6 3
%16 = OpTypeVector %6 4
%17 = OpTypeVector %8 2
%18 = OpTypeVector %8 4
%20 = OpTypePointer Function %4
%21 = OpConstantNull %4
%23 = OpTypePointer Function %11
%24 = OpConstantNull %11
%26 = OpTypePointer Function %12
%27 = OpConstantNull %12
%29 = OpTypePointer Function %13
%30 = OpConstantNull %13
%32 = OpTypePointer Function %6
%33 = OpConstantNull %6
%35 = OpTypePointer Function %14
%36 = OpConstantNull %14
%38 = OpTypePointer Function %15
%39 = OpConstantNull %15
%41 = OpTypePointer Function %16
%42 = OpConstantNull %16
%44 = OpTypePointer Function %17
%45 = OpConstantNull %17
%47 = OpTypePointer Function %18
%48 = OpConstantNull %18
%51 = OpTypeFunction %2
%50 = OpFunction %2 None %51
%49 = OpLabel
%46 = OpVariable %47 Function %48
%37 = OpVariable %38 Function %39
%28 = OpVariable %29 Function %30
%19 = OpVariable %20 Function %21
%40 = OpVariable %41 Function %42
%31 = OpVariable %32 Function %33
%22 = OpVariable %23 Function %24
%43 = OpVariable %44 Function %45
%34 = OpVariable %35 Function %36
%25 = OpVariable %26 Function %27
OpBranch %52
%52 = OpLabel
OpStore %19 %3
%53 = OpCompositeConstruct %11 %3 %3
OpStore %22 %53
%54 = OpCompositeConstruct %12 %3 %3 %3
OpStore %25 %54
%55 = OpCompositeConstruct %13 %3 %3 %3 %3
OpStore %28 %55
OpStore %31 %5
%56 = OpCompositeConstruct %14 %5 %5
OpStore %34 %56
%57 = OpCompositeConstruct %15 %5 %5 %5
OpStore %37 %57
%58 = OpCompositeConstruct %16 %5 %5 %5 %5
OpStore %40 %58
%59 = OpCompositeConstruct %17 %7 %7
OpStore %43 %59
%60 = OpCompositeConstruct %18 %7 %7 %7 %7
OpStore %46 %60
%61 = OpLoad %18 %46
%62 = OpExtInst %6 %1 PackSnorm4x8 %61
OpStore %31 %62
%63 = OpLoad %18 %46
%64 = OpExtInst %6 %1 PackUnorm4x8 %63
OpStore %31 %64
%65 = OpLoad %17 %43
%66 = OpExtInst %6 %1 PackSnorm2x16 %65
OpStore %31 %66
%67 = OpLoad %17 %43
%68 = OpExtInst %6 %1 PackUnorm2x16 %67
OpStore %31 %68
%69 = OpLoad %17 %43
%70 = OpExtInst %6 %1 PackHalf2x16 %69
OpStore %31 %70
%71 = OpLoad %6 %31
%72 = OpExtInst %18 %1 UnpackSnorm4x8 %71
OpStore %46 %72
%73 = OpLoad %6 %31
%74 = OpExtInst %18 %1 UnpackUnorm4x8 %73
OpStore %46 %74
%75 = OpLoad %6 %31
%76 = OpExtInst %17 %1 UnpackSnorm2x16 %75
OpStore %43 %76
%77 = OpLoad %6 %31
%78 = OpExtInst %17 %1 UnpackUnorm2x16 %77
OpStore %43 %78
%79 = OpLoad %6 %31
%80 = OpExtInst %17 %1 UnpackHalf2x16 %79
OpStore %43 %80
%81 = OpLoad %4 %19
%82 = OpLoad %4 %19
%83 = OpBitFieldInsert %4 %81 %82 %9 %10
OpStore %19 %83
%84 = OpLoad %11 %22
%85 = OpLoad %11 %22
%86 = OpBitFieldInsert %11 %84 %85 %9 %10
OpStore %22 %86
%87 = OpLoad %12 %25
%88 = OpLoad %12 %25
%89 = OpBitFieldInsert %12 %87 %88 %9 %10
OpStore %25 %89
%90 = OpLoad %13 %28
%91 = OpLoad %13 %28
%92 = OpBitFieldInsert %13 %90 %91 %9 %10
OpStore %28 %92
%93 = OpLoad %6 %31
%94 = OpLoad %6 %31
%95 = OpBitFieldInsert %6 %93 %94 %9 %10
OpStore %31 %95
%96 = OpLoad %14 %34
%97 = OpLoad %14 %34
%98 = OpBitFieldInsert %14 %96 %97 %9 %10
OpStore %34 %98
%99 = OpLoad %15 %37
%100 = OpLoad %15 %37
%101 = OpBitFieldInsert %15 %99 %100 %9 %10
OpStore %37 %101
%102 = OpLoad %16 %40
%103 = OpLoad %16 %40
%104 = OpBitFieldInsert %16 %102 %103 %9 %10
OpStore %40 %104
%105 = OpLoad %4 %19
%106 = OpBitFieldSExtract %4 %105 %9 %10
OpStore %19 %106
%107 = OpLoad %11 %22
%108 = OpBitFieldSExtract %11 %107 %9 %10
OpStore %22 %108
%109 = OpLoad %12 %25
%110 = OpBitFieldSExtract %12 %109 %9 %10
OpStore %25 %110
%111 = OpLoad %13 %28
%112 = OpBitFieldSExtract %13 %111 %9 %10
OpStore %28 %112
%113 = OpLoad %6 %31
%114 = OpBitFieldUExtract %6 %113 %9 %10
OpStore %31 %114
%115 = OpLoad %14 %34
%116 = OpBitFieldUExtract %14 %115 %9 %10
OpStore %34 %116
%117 = OpLoad %15 %37
%118 = OpBitFieldUExtract %15 %117 %9 %10
OpStore %37 %118
%119 = OpLoad %16 %40
%120 = OpBitFieldUExtract %16 %119 %9 %10
OpStore %40 %120
%121 = OpLoad %4 %19
%122 = OpExtInst %4 %1 FindILsb %121
OpStore %19 %122
%123 = OpLoad %14 %34
%124 = OpExtInst %14 %1 FindILsb %123
OpStore %34 %124
%125 = OpLoad %12 %25
%126 = OpExtInst %12 %1 FindSMsb %125
OpStore %25 %126
%127 = OpLoad %6 %31
%128 = OpExtInst %6 %1 FindUMsb %127
OpStore %31 %128
%129 = OpLoad %4 %19
%130 = OpBitCount %4 %129
OpStore %19 %130
%131 = OpLoad %11 %22
%132 = OpBitCount %11 %131
OpStore %22 %132
%133 = OpLoad %12 %25
%134 = OpBitCount %12 %133
OpStore %25 %134
%135 = OpLoad %13 %28
%136 = OpBitCount %13 %135
OpStore %28 %136
%137 = OpLoad %6 %31
%138 = OpBitCount %6 %137
OpStore %31 %138
%139 = OpLoad %14 %34
%140 = OpBitCount %14 %139
OpStore %34 %140
%141 = OpLoad %15 %37
%142 = OpBitCount %15 %141
OpStore %37 %142
%143 = OpLoad %16 %40
%144 = OpBitCount %16 %143
OpStore %40 %144
%145 = OpLoad %4 %19
%146 = OpBitReverse %4 %145
OpStore %19 %146
%147 = OpLoad %11 %22
%148 = OpBitReverse %11 %147
OpStore %22 %148
%149 = OpLoad %12 %25
%150 = OpBitReverse %12 %149
OpStore %25 %150
%151 = OpLoad %13 %28
%152 = OpBitReverse %13 %151
OpStore %28 %152
%153 = OpLoad %6 %31
%154 = OpBitReverse %6 %153
OpStore %31 %154
%155 = OpLoad %14 %34
%156 = OpBitReverse %14 %155
OpStore %34 %156
%157 = OpLoad %15 %37
%158 = OpBitReverse %15 %157
OpStore %37 %158
%159 = OpLoad %16 %40
%160 = OpBitReverse %16 %159
OpStore %40 %160
OpReturn
OpFunctionEnd