mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Implement WGSL frontend and WGSL, SPIR-V, HLSL, MSL, and GLSL backends. WGSL and SPIR-V backends natively support the instruction. MSL and HLSL emulate it by casting to f16 and back to f32. GLSL does similar but must (mis)use (un)pack2x16 to do so.
115 lines
3.5 KiB
Plaintext
115 lines
3.5 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 95
|
|
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
|
|
%6 = OpTypeInt 32 1
|
|
%5 = OpTypeVector %6 4
|
|
%7 = OpTypeVector %6 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 %6
|
|
%15 = OpTypeStruct %4 %5
|
|
%16 = OpTypeVector %3 3
|
|
%19 = OpTypeFunction %2
|
|
%20 = OpConstant %3 1.0
|
|
%21 = OpConstant %3 0.0
|
|
%22 = OpConstantComposite %4 %21 %21 %21 %21
|
|
%23 = OpConstant %6 -1
|
|
%24 = OpConstantComposite %5 %23 %23 %23 %23
|
|
%25 = OpConstant %3 -1.0
|
|
%26 = OpConstantComposite %4 %25 %25 %25 %25
|
|
%27 = OpConstantNull %7
|
|
%28 = OpConstant %9 4294967295
|
|
%29 = OpConstantComposite %7 %23 %23
|
|
%30 = OpConstant %9 0
|
|
%31 = OpConstantComposite %8 %30 %30
|
|
%32 = OpConstant %6 0
|
|
%33 = OpConstantComposite %7 %32 %32
|
|
%34 = OpConstant %9 32
|
|
%35 = OpConstant %6 32
|
|
%36 = OpConstantComposite %8 %34 %34
|
|
%37 = OpConstantComposite %7 %35 %35
|
|
%38 = OpConstant %9 31
|
|
%39 = OpConstantComposite %8 %38 %38
|
|
%40 = OpConstant %6 2
|
|
%41 = OpConstant %3 2.0
|
|
%42 = OpConstantComposite %10 %20 %41
|
|
%43 = OpConstant %6 3
|
|
%44 = OpConstant %6 4
|
|
%45 = OpConstantComposite %7 %43 %44
|
|
%46 = OpConstant %3 1.5
|
|
%47 = OpConstantComposite %10 %46 %46
|
|
%48 = OpConstantComposite %4 %46 %46 %46 %46
|
|
%49 = OpConstantComposite %10 %20 %20
|
|
%50 = OpConstantComposite %16 %20 %20 %20
|
|
%51 = OpConstantComposite %4 %20 %20 %20 %20
|
|
%58 = OpConstantComposite %4 %20 %20 %20 %20
|
|
%61 = OpConstantNull %6
|
|
%18 = OpFunction %2 None %19
|
|
%17 = OpLabel
|
|
OpBranch %52
|
|
%52 = OpLabel
|
|
%53 = OpExtInst %3 %1 Degrees %20
|
|
%54 = OpExtInst %3 %1 Radians %20
|
|
%55 = OpExtInst %4 %1 Degrees %22
|
|
%56 = OpExtInst %4 %1 Radians %22
|
|
%57 = OpExtInst %4 %1 FClamp %22 %22 %58
|
|
%59 = OpExtInst %4 %1 Refract %22 %22 %20
|
|
%62 = OpCompositeExtract %6 %27 0
|
|
%63 = OpCompositeExtract %6 %27 0
|
|
%64 = OpIMul %6 %62 %63
|
|
%65 = OpIAdd %6 %61 %64
|
|
%66 = OpCompositeExtract %6 %27 1
|
|
%67 = OpCompositeExtract %6 %27 1
|
|
%68 = OpIMul %6 %66 %67
|
|
%60 = OpIAdd %6 %65 %68
|
|
%69 = OpExtInst %3 %1 Ldexp %20 %40
|
|
%70 = OpExtInst %10 %1 Ldexp %42 %45
|
|
%71 = OpExtInst %11 %1 ModfStruct %46
|
|
%72 = OpExtInst %11 %1 ModfStruct %46
|
|
%73 = OpCompositeExtract %3 %72 0
|
|
%74 = OpExtInst %11 %1 ModfStruct %46
|
|
%75 = OpCompositeExtract %3 %74 1
|
|
%76 = OpExtInst %12 %1 ModfStruct %47
|
|
%77 = OpExtInst %13 %1 ModfStruct %48
|
|
%78 = OpCompositeExtract %4 %77 1
|
|
%79 = OpCompositeExtract %3 %78 0
|
|
%80 = OpExtInst %12 %1 ModfStruct %47
|
|
%81 = OpCompositeExtract %10 %80 0
|
|
%82 = OpCompositeExtract %3 %81 1
|
|
%83 = OpExtInst %14 %1 FrexpStruct %46
|
|
%84 = OpExtInst %14 %1 FrexpStruct %46
|
|
%85 = OpCompositeExtract %3 %84 0
|
|
%86 = OpExtInst %14 %1 FrexpStruct %46
|
|
%87 = OpCompositeExtract %6 %86 1
|
|
%88 = OpExtInst %15 %1 FrexpStruct %48
|
|
%89 = OpCompositeExtract %5 %88 1
|
|
%90 = OpCompositeExtract %6 %89 0
|
|
%91 = OpQuantizeToF16 %3 %20
|
|
%92 = OpQuantizeToF16 %10 %49
|
|
%93 = OpQuantizeToF16 %16 %50
|
|
%94 = OpQuantizeToF16 %4 %51
|
|
OpReturn
|
|
OpFunctionEnd |