1spv.debugInfo.frag 2error: SPIRV-Tools Validation Errors 3error: Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0 (under OpenGL 4.5 semantics). 4// Module Version 10300 5// Generated by (magic number): 8000a 6// Id's are bound by 124 7 8 Capability Shader 9 2: ExtInstImport "GLSL.std.450" 10 MemoryModel Logical GLSL450 11 EntryPoint Fragment 5 "main" 24 52 12 ExecutionMode 5 OriginLowerLeft 13 1: String "spv.debugInfo.frag" 14 Source GLSL 450 1 "#version 450 15 16struct S { 17 int a; 18}; 19 20uniform ubuf { 21 S s; 22}; 23 24uniform sampler2D s2d; 25 26layout(location = 0) in vec4 inv; 27layout(location = 0) out vec4 outv; 28 29vec4 foo(S s) 30{ 31 vec4 r = s.a * inv; 32 ++r; 33 if (r.x > 3.0) 34 --r; 35 else 36 r *= 2; 37 38 return r; 39} 40 41void main() 42{ 43 outv = foo(s); 44 outv += texture(s2d, vec2(0.5)); 45 46 switch (s.a) { 47 case 10: 48 ++outv; 49 break; 50 case 20: 51 outv = 2 * outv; 52 ++outv; 53 break; 54 default: 55 --outv; 56 break; 57 } 58 59 for (int i = 0; i < 10; ++i) 60 outv *= 3.0; 61 62 outv.x < 10.0 ? 63 outv = sin(outv) : 64 outv = cos(outv); 65}" 66 Name 5 "main" 67 Name 8 "S" 68 MemberName 8(S) 0 "a" 69 Name 14 "foo(struct-S-i11;" 70 Name 13 "s" 71 Name 17 "r" 72 Name 24 "inv" 73 Name 52 "outv" 74 Name 53 "S" 75 MemberName 53(S) 0 "a" 76 Name 54 "ubuf" 77 MemberName 54(ubuf) 0 "s" 78 Name 56 "" 79 Name 57 "param" 80 Name 67 "s2d" 81 Name 97 "i" 82 ModuleProcessed "no-storage-format" 83 ModuleProcessed "resource-set-binding 3" 84 ModuleProcessed "auto-map-bindings" 85 ModuleProcessed "auto-map-locations" 86 ModuleProcessed "client opengl100" 87 ModuleProcessed "target-env spirv1.3" 88 ModuleProcessed "target-env opengl" 89 ModuleProcessed "relaxed-errors" 90 ModuleProcessed "suppress-warnings" 91 ModuleProcessed "hlsl-offsets" 92 ModuleProcessed "entry-point main" 93 Decorate 24(inv) Location 0 94 Decorate 52(outv) Location 0 95 MemberDecorate 53(S) 0 Offset 0 96 MemberDecorate 54(ubuf) 0 Offset 0 97 Decorate 54(ubuf) Block 98 Decorate 56 DescriptorSet 3 99 Decorate 56 Binding 0 100 Decorate 67(s2d) Location 0 101 Decorate 67(s2d) DescriptorSet 3 102 Decorate 67(s2d) Binding 1 103 3: TypeVoid 104 4: TypeFunction 3 105 7: TypeInt 32 1 106 8(S): TypeStruct 7(int) 107 9: TypePointer Function 8(S) 108 10: TypeFloat 32 109 11: TypeVector 10(float) 4 110 12: TypeFunction 11(fvec4) 9(ptr) 111 16: TypePointer Function 11(fvec4) 112 18: 7(int) Constant 0 113 19: TypePointer Function 7(int) 114 23: TypePointer Input 11(fvec4) 115 24(inv): 23(ptr) Variable Input 116 28: 10(float) Constant 1065353216 117 31: TypeInt 32 0 118 32: 31(int) Constant 0 119 33: TypePointer Function 10(float) 120 36: 10(float) Constant 1077936128 121 37: TypeBool 122 45: 10(float) Constant 1073741824 123 51: TypePointer Output 11(fvec4) 124 52(outv): 51(ptr) Variable Output 125 53(S): TypeStruct 7(int) 126 54(ubuf): TypeStruct 53(S) 127 55: TypePointer Uniform 54(ubuf) 128 56: 55(ptr) Variable Uniform 129 58: TypePointer Uniform 53(S) 130 64: TypeImage 10(float) 2D sampled format:Unknown 131 65: TypeSampledImage 64 132 66: TypePointer UniformConstant 65 133 67(s2d): 66(ptr) Variable UniformConstant 134 69: TypeVector 10(float) 2 135 70: 10(float) Constant 1056964608 136 71: 69(fvec2) ConstantComposite 70 70 137 75: TypePointer Uniform 7(int) 138 104: 7(int) Constant 10 139 109: 7(int) Constant 1 140 111: TypePointer Output 10(float) 141 114: 10(float) Constant 1092616192 142 5(main): 3 Function None 4 143 6: Label 144 57(param): 9(ptr) Variable Function 145 97(i): 19(ptr) Variable Function 146 116: 16(ptr) Variable Function 147 Line 1 30 0 148 59: 58(ptr) AccessChain 56 18 149 60: 53(S) Load 59 150 61: 7(int) CompositeExtract 60 0 151 62: 19(ptr) AccessChain 57(param) 18 152 Store 62 61 153 63: 11(fvec4) FunctionCall 14(foo(struct-S-i11;) 57(param) 154 Store 52(outv) 63 155 Line 1 31 0 156 68: 65 Load 67(s2d) 157 72: 11(fvec4) ImageSampleImplicitLod 68 71 158 73: 11(fvec4) Load 52(outv) 159 74: 11(fvec4) FAdd 73 72 160 Store 52(outv) 74 161 Line 1 33 0 162 76: 75(ptr) AccessChain 56 18 18 163 77: 7(int) Load 76 164 SelectionMerge 81 None 165 Switch 77 80 166 case 10: 78 167 case 20: 79 168 80: Label 169 Line 1 42 0 170 92: 11(fvec4) Load 52(outv) 171 93: 11(fvec4) CompositeConstruct 28 28 28 28 172 94: 11(fvec4) FSub 92 93 173 Store 52(outv) 94 174 Line 1 43 0 175 Branch 81 176 78: Label 177 Line 1 35 0 178 82: 11(fvec4) Load 52(outv) 179 83: 11(fvec4) CompositeConstruct 28 28 28 28 180 84: 11(fvec4) FAdd 82 83 181 Store 52(outv) 84 182 Line 1 36 0 183 Branch 81 184 79: Label 185 Line 1 38 0 186 86: 11(fvec4) Load 52(outv) 187 87: 11(fvec4) VectorTimesScalar 86 45 188 Store 52(outv) 87 189 Line 1 39 0 190 88: 11(fvec4) Load 52(outv) 191 89: 11(fvec4) CompositeConstruct 28 28 28 28 192 90: 11(fvec4) FAdd 88 89 193 Store 52(outv) 90 194 Line 1 40 0 195 Branch 81 196 81: Label 197 Line 1 46 0 198 Store 97(i) 18 199 Branch 98 200 98: Label 201 LoopMerge 100 101 None 202 Branch 102 203 102: Label 204 103: 7(int) Load 97(i) 205 105: 37(bool) SLessThan 103 104 206 BranchConditional 105 99 100 207 99: Label 208 Line 1 47 0 209 106: 11(fvec4) Load 52(outv) 210 107: 11(fvec4) VectorTimesScalar 106 36 211 Store 52(outv) 107 212 Branch 101 213 101: Label 214 Line 1 46 0 215 108: 7(int) Load 97(i) 216 110: 7(int) IAdd 108 109 217 Store 97(i) 110 218 Branch 98 219 100: Label 220 Line 1 49 0 221 112: 111(ptr) AccessChain 52(outv) 32 222 113: 10(float) Load 112 223 115: 37(bool) FOrdLessThan 113 114 224 SelectionMerge 118 None 225 BranchConditional 115 117 121 226 117: Label 227 Line 1 50 0 228 119: 11(fvec4) Load 52(outv) 229 120: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 119 230 Store 52(outv) 120 231 Store 116 120 232 Branch 118 233 121: Label 234 Line 1 51 0 235 122: 11(fvec4) Load 52(outv) 236 123: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 122 237 Store 52(outv) 123 238 Store 116 123 239 Branch 118 240 118: Label 241 Return 242 FunctionEnd 24314(foo(struct-S-i11;): 11(fvec4) Function None 12 244 13(s): 9(ptr) FunctionParameter 245 15: Label 246 17(r): 16(ptr) Variable Function 247 Line 1 18 0 248 20: 19(ptr) AccessChain 13(s) 18 249 21: 7(int) Load 20 250 22: 10(float) ConvertSToF 21 251 25: 11(fvec4) Load 24(inv) 252 26: 11(fvec4) VectorTimesScalar 25 22 253 Store 17(r) 26 254 Line 1 19 0 255 27: 11(fvec4) Load 17(r) 256 29: 11(fvec4) CompositeConstruct 28 28 28 28 257 30: 11(fvec4) FAdd 27 29 258 Store 17(r) 30 259 Line 1 20 0 260 34: 33(ptr) AccessChain 17(r) 32 261 35: 10(float) Load 34 262 38: 37(bool) FOrdGreaterThan 35 36 263 SelectionMerge 40 None 264 BranchConditional 38 39 44 265 39: Label 266 Line 1 21 0 267 41: 11(fvec4) Load 17(r) 268 42: 11(fvec4) CompositeConstruct 28 28 28 28 269 43: 11(fvec4) FSub 41 42 270 Store 17(r) 43 271 Branch 40 272 44: Label 273 Line 1 23 0 274 46: 11(fvec4) Load 17(r) 275 47: 11(fvec4) VectorTimesScalar 46 45 276 Store 17(r) 47 277 Branch 40 278 40: Label 279 Line 1 25 0 280 48: 11(fvec4) Load 17(r) 281 ReturnValue 48 282 FunctionEnd 283