mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-20 20:10:05 +00:00
138 lines
5.1 KiB
Plaintext
138 lines
5.1 KiB
Plaintext
|
;; Test where src has an extra if block in one function, and dst has an extra
|
||
|
;; if block in another function.
|
||
|
OpCapability Shader
|
||
|
%1 = OpExtInstImport "GLSL.std.450"
|
||
|
OpMemoryModel Logical GLSL450
|
||
|
OpEntryPoint Fragment %4 "main" %63 %68
|
||
|
OpExecutionMode %4 OriginUpperLeft
|
||
|
OpSource ESSL 310
|
||
|
OpName %4 "main"
|
||
|
OpName %8 "f1("
|
||
|
OpName %10 "f2("
|
||
|
OpName %13 "v"
|
||
|
OpName %16 "Buffer"
|
||
|
OpMemberName %16 0 "flag1"
|
||
|
OpMemberName %16 1 "flag2"
|
||
|
OpName %18 ""
|
||
|
OpName %45 "v"
|
||
|
OpName %63 "color"
|
||
|
OpName %68 "v"
|
||
|
OpDecorate %8 RelaxedPrecision
|
||
|
OpDecorate %10 RelaxedPrecision
|
||
|
OpDecorate %13 RelaxedPrecision
|
||
|
OpMemberDecorate %16 0 RelaxedPrecision
|
||
|
OpMemberDecorate %16 0 Offset 0
|
||
|
OpMemberDecorate %16 1 RelaxedPrecision
|
||
|
OpMemberDecorate %16 1 Offset 4
|
||
|
OpDecorate %16 Block
|
||
|
OpDecorate %18 DescriptorSet 0
|
||
|
OpDecorate %18 Binding 0
|
||
|
OpDecorate %23 RelaxedPrecision
|
||
|
OpDecorate %30 RelaxedPrecision
|
||
|
OpDecorate %31 RelaxedPrecision
|
||
|
OpDecorate %34 RelaxedPrecision
|
||
|
OpDecorate %35 RelaxedPrecision
|
||
|
OpDecorate %36 RelaxedPrecision
|
||
|
OpDecorate %37 RelaxedPrecision
|
||
|
OpDecorate %38 RelaxedPrecision
|
||
|
OpDecorate %39 RelaxedPrecision
|
||
|
OpDecorate %40 RelaxedPrecision
|
||
|
OpDecorate %41 RelaxedPrecision
|
||
|
OpDecorate %42 RelaxedPrecision
|
||
|
OpDecorate %45 RelaxedPrecision
|
||
|
OpDecorate %47 RelaxedPrecision
|
||
|
OpDecorate %48 RelaxedPrecision
|
||
|
OpDecorate %50 RelaxedPrecision
|
||
|
OpDecorate %51 RelaxedPrecision
|
||
|
OpDecorate %54 RelaxedPrecision
|
||
|
OpDecorate %55 RelaxedPrecision
|
||
|
OpDecorate %56 RelaxedPrecision
|
||
|
OpDecorate %57 RelaxedPrecision
|
||
|
OpDecorate %58 RelaxedPrecision
|
||
|
OpDecorate %63 RelaxedPrecision
|
||
|
OpDecorate %63 Location 0
|
||
|
OpDecorate %64 RelaxedPrecision
|
||
|
OpDecorate %65 RelaxedPrecision
|
||
|
OpDecorate %66 RelaxedPrecision
|
||
|
OpDecorate %68 RelaxedPrecision
|
||
|
OpDecorate %68 Location 0
|
||
|
%2 = OpTypeVoid
|
||
|
%3 = OpTypeFunction %2
|
||
|
%6 = OpTypeFloat 32
|
||
|
%7 = OpTypeFunction %6
|
||
|
%12 = OpTypePointer Function %6
|
||
|
%14 = OpConstant %6 0
|
||
|
%15 = OpTypeInt 32 0
|
||
|
%16 = OpTypeStruct %15 %15
|
||
|
%17 = OpTypePointer Uniform %16
|
||
|
%18 = OpVariable %17 Uniform
|
||
|
%19 = OpTypeInt 32 1
|
||
|
%20 = OpConstant %19 0
|
||
|
%21 = OpTypePointer Uniform %15
|
||
|
%24 = OpConstant %15 0
|
||
|
%25 = OpTypeBool
|
||
|
%29 = OpConstant %6 1
|
||
|
%32 = OpConstant %19 1
|
||
|
%49 = OpConstant %6 10
|
||
|
%52 = OpConstant %6 0.5
|
||
|
%53 = OpConstant %6 0.699999988
|
||
|
%61 = OpTypeVector %6 4
|
||
|
%62 = OpTypePointer Output %61
|
||
|
%63 = OpVariable %62 Output
|
||
|
%67 = OpTypePointer Input %6
|
||
|
%68 = OpVariable %67 Input
|
||
|
%4 = OpFunction %2 None %3
|
||
|
%5 = OpLabel
|
||
|
%64 = OpFunctionCall %6 %8
|
||
|
%65 = OpFunctionCall %6 %10
|
||
|
%66 = OpCompositeConstruct %61 %64 %65 %14 %29
|
||
|
OpStore %63 %66
|
||
|
OpReturn
|
||
|
OpFunctionEnd
|
||
|
%8 = OpFunction %6 None %7
|
||
|
%9 = OpLabel
|
||
|
%13 = OpVariable %12 Function
|
||
|
OpStore %13 %14
|
||
|
%22 = OpAccessChain %21 %18 %20
|
||
|
%23 = OpLoad %15 %22
|
||
|
%26 = OpINotEqual %25 %23 %24
|
||
|
OpSelectionMerge %28 None
|
||
|
OpBranchConditional %26 %27 %28
|
||
|
%27 = OpLabel
|
||
|
%30 = OpLoad %6 %13
|
||
|
%31 = OpFAdd %6 %30 %29
|
||
|
OpStore %13 %31
|
||
|
OpBranch %28
|
||
|
%28 = OpLabel
|
||
|
%33 = OpAccessChain %21 %18 %32
|
||
|
%34 = OpLoad %15 %33
|
||
|
%35 = OpConvertUToF %6 %34
|
||
|
%36 = OpExtInst %6 %1 Log2 %35
|
||
|
%37 = OpLoad %6 %13
|
||
|
%38 = OpFAdd %6 %37 %36
|
||
|
OpStore %13 %38
|
||
|
%39 = OpLoad %6 %13
|
||
|
%40 = OpLoad %6 %13
|
||
|
%41 = OpExtInst %6 %1 Sqrt %40
|
||
|
%42 = OpFSub %6 %39 %41
|
||
|
OpReturnValue %42
|
||
|
OpFunctionEnd
|
||
|
%10 = OpFunction %6 None %7
|
||
|
%11 = OpLabel
|
||
|
%45 = OpVariable %12 Function
|
||
|
%46 = OpAccessChain %21 %18 %20
|
||
|
%47 = OpLoad %15 %46
|
||
|
%48 = OpConvertUToF %6 %47
|
||
|
%50 = OpFDiv %6 %48 %49
|
||
|
OpStore %45 %50
|
||
|
%51 = OpLoad %6 %45
|
||
|
%54 = OpExtInst %6 %1 FClamp %51 %52 %53
|
||
|
%55 = OpLoad %6 %45
|
||
|
%56 = OpFMul %6 %55 %54
|
||
|
OpStore %45 %56
|
||
|
%57 = OpLoad %6 %45
|
||
|
%58 = OpExtInst %6 %1 Exp %57
|
||
|
OpReturnValue %58
|
||
|
OpFunctionEnd
|
||
|
|