wgpu/naga/tests/out/spv/wgsl-math-functions.spvasm
Sam 6e76a98c99
[naga const-eval] LiteralVector and some demo builtins (#8223)
* [naga] Add `LiteralVector` and `match_literal_vector!`

Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* [naga] Implement builtins dot, length, distance, normalize in const using LiteralVector

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update snapshots

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com>
2025-10-18 07:28:09 -04:00

105 lines
3.2 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 85
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %18 "main"
OpExecutionMode %18 OriginUpperLeft
OpMemberDecorate %11 0 Offset 0
OpMemberDecorate %11 1 Offset 4
OpMemberDecorate %12 0 Offset 0
OpMemberDecorate %12 1 Offset 8
OpMemberDecorate %13 0 Offset 0
OpMemberDecorate %13 1 Offset 16
OpMemberDecorate %14 0 Offset 0
OpMemberDecorate %14 1 Offset 4
OpMemberDecorate %15 0 Offset 0
OpMemberDecorate %15 1 Offset 16
%2 = OpTypeVoid
%3 = OpTypeFloat 32
%4 = OpTypeVector %3 4
%5 = OpTypeInt 32 1
%6 = OpTypeVector %5 4
%7 = OpTypeVector %5 2
%9 = OpTypeInt 32 0
%8 = OpTypeVector %9 2
%10 = OpTypeVector %3 2
%11 = OpTypeStruct %3 %3
%12 = OpTypeStruct %10 %10
%13 = OpTypeStruct %4 %4
%14 = OpTypeStruct %3 %5
%15 = OpTypeStruct %4 %6
%16 = OpTypeVector %3 3
%19 = OpTypeFunction %2
%20 = OpConstant %3 1
%21 = OpConstant %3 0
%22 = OpConstantComposite %4 %21 %21 %21 %21
%23 = OpConstant %5 -1
%24 = OpConstantComposite %6 %23 %23 %23 %23
%25 = OpConstant %3 -1
%26 = OpConstantComposite %4 %25 %25 %25 %25
%27 = OpConstant %5 0
%28 = OpConstant %9 4294967295
%29 = OpConstantComposite %7 %23 %23
%30 = OpConstant %9 0
%31 = OpConstantComposite %8 %30 %30
%32 = OpConstantComposite %7 %27 %27
%33 = OpConstant %9 32
%34 = OpConstant %5 32
%35 = OpConstantComposite %8 %33 %33
%36 = OpConstantComposite %7 %34 %34
%37 = OpConstant %9 31
%38 = OpConstantComposite %8 %37 %37
%39 = OpConstant %5 2
%40 = OpConstant %3 2
%41 = OpConstantComposite %10 %20 %40
%42 = OpConstant %5 3
%43 = OpConstant %5 4
%44 = OpConstantComposite %7 %42 %43
%45 = OpConstant %3 1.5
%46 = OpConstantComposite %10 %45 %45
%47 = OpConstantComposite %4 %45 %45 %45 %45
%48 = OpConstantComposite %10 %20 %20
%49 = OpConstantComposite %16 %20 %20 %20
%50 = OpConstantComposite %4 %20 %20 %20 %20
%57 = OpConstantComposite %4 %20 %20 %20 %20
%18 = OpFunction %2 None %19
%17 = OpLabel
OpBranch %51
%51 = OpLabel
%52 = OpExtInst %3 %1 Degrees %20
%53 = OpExtInst %3 %1 Radians %20
%54 = OpExtInst %4 %1 Degrees %22
%55 = OpExtInst %4 %1 Radians %22
%56 = OpExtInst %4 %1 FClamp %22 %22 %57
%58 = OpExtInst %4 %1 Refract %22 %22 %20
%59 = OpExtInst %3 %1 Ldexp %20 %39
%60 = OpExtInst %10 %1 Ldexp %41 %44
%61 = OpExtInst %11 %1 ModfStruct %45
%62 = OpExtInst %11 %1 ModfStruct %45
%63 = OpCompositeExtract %3 %62 0
%64 = OpExtInst %11 %1 ModfStruct %45
%65 = OpCompositeExtract %3 %64 1
%66 = OpExtInst %12 %1 ModfStruct %46
%67 = OpExtInst %13 %1 ModfStruct %47
%68 = OpCompositeExtract %4 %67 1
%69 = OpCompositeExtract %3 %68 0
%70 = OpExtInst %12 %1 ModfStruct %46
%71 = OpCompositeExtract %10 %70 0
%72 = OpCompositeExtract %3 %71 1
%73 = OpExtInst %14 %1 FrexpStruct %45
%74 = OpExtInst %14 %1 FrexpStruct %45
%75 = OpCompositeExtract %3 %74 0
%76 = OpExtInst %14 %1 FrexpStruct %45
%77 = OpCompositeExtract %5 %76 1
%78 = OpExtInst %15 %1 FrexpStruct %47
%79 = OpCompositeExtract %6 %78 1
%80 = OpCompositeExtract %5 %79 0
%81 = OpQuantizeToF16 %3 %20
%82 = OpQuantizeToF16 %10 %48
%83 = OpQuantizeToF16 %16 %49
%84 = OpQuantizeToF16 %4 %50
OpReturn
OpFunctionEnd