diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-11-14 22:32:31 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-11-14 22:32:31 +0100 |
commit | 682b43ffef9e17c41fe03f14b965dda0c46c420a (patch) | |
tree | 6ece24ed7234e4a8025c04956636cb57d0da37a1 /ddl/out/swift | |
parent | b4874356eb1c3f03dd3256aca94e20b158dcc8e6 (diff) |
generate into separate folders for each language, generates folder hierarchy for haskell and purescript modules
Diffstat (limited to 'ddl/out/swift')
-rw-r--r-- | ddl/out/swift/LambdaCube.IR.swift | 1431 | ||||
-rw-r--r-- | ddl/out/swift/LambdaCube.Mesh.swift | 174 | ||||
-rw-r--r-- | ddl/out/swift/LambdaCube.PipelineSchema.swift | 205 | ||||
-rw-r--r-- | ddl/out/swift/LambdaCube.TypeInfo.swift | 192 | ||||
-rw-r--r-- | ddl/out/swift/TestData.swift | 242 |
5 files changed, 2244 insertions, 0 deletions
diff --git a/ddl/out/swift/LambdaCube.IR.swift b/ddl/out/swift/LambdaCube.IR.swift new file mode 100644 index 0000000..bde39fd --- /dev/null +++ b/ddl/out/swift/LambdaCube.IR.swift | |||
@@ -0,0 +1,1431 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-11-11T11:17:02.701527000000Z | ||
3 | |||
4 | typealias StreamName = Int | ||
5 | |||
6 | typealias ProgramName = Int | ||
7 | |||
8 | typealias TextureName = Int | ||
9 | |||
10 | typealias SamplerName = Int | ||
11 | |||
12 | typealias UniformName = String | ||
13 | |||
14 | typealias SlotName = Int | ||
15 | |||
16 | typealias FrameBufferComponent = Int | ||
17 | |||
18 | typealias TextureUnit = Int | ||
19 | |||
20 | typealias RenderTargetName = Int | ||
21 | |||
22 | typealias TextureUnitMapping = Dictionary<UniformName, TextureUnit> | ||
23 | |||
24 | enum ArrayValue { | ||
25 | case VBoolArray(Array<Bool>) | ||
26 | case VIntArray(Array<Int32>) | ||
27 | case VWordArray(Array<UInt32>) | ||
28 | case VFloatArray(Array<Float>) | ||
29 | } | ||
30 | |||
31 | enum Value { | ||
32 | case VBool(Bool) | ||
33 | case VV2B(Int) | ||
34 | case VV3B(Int) | ||
35 | case VV4B(Int) | ||
36 | case VWord(UInt32) | ||
37 | case VV2U(Int) | ||
38 | case VV3U(Int) | ||
39 | case VV4U(Int) | ||
40 | case VInt(Int32) | ||
41 | case VV2I(Int) | ||
42 | case VV3I(Int) | ||
43 | case VV4I(Int) | ||
44 | case VFloat(Float) | ||
45 | case VV2F(Int) | ||
46 | case VV3F(Int) | ||
47 | case VV4F(Int) | ||
48 | case VM22F(Int) | ||
49 | case VM23F(Int) | ||
50 | case VM24F(Int) | ||
51 | case VM32F(Int) | ||
52 | case VM33F(Int) | ||
53 | case VM34F(Int) | ||
54 | case VM42F(Int) | ||
55 | case VM43F(Int) | ||
56 | case VM44F(Int) | ||
57 | } | ||
58 | |||
59 | enum InputType { | ||
60 | case Bool | ||
61 | case V2B | ||
62 | case V3B | ||
63 | case V4B | ||
64 | case Word | ||
65 | case V2U | ||
66 | case V3U | ||
67 | case V4U | ||
68 | case Int | ||
69 | case V2I | ||
70 | case V3I | ||
71 | case V4I | ||
72 | case Float | ||
73 | case V2F | ||
74 | case V3F | ||
75 | case V4F | ||
76 | case M22F | ||
77 | case M23F | ||
78 | case M24F | ||
79 | case M32F | ||
80 | case M33F | ||
81 | case M34F | ||
82 | case M42F | ||
83 | case M43F | ||
84 | case M44F | ||
85 | case STexture1D | ||
86 | case STexture2D | ||
87 | case STextureCube | ||
88 | case STexture1DArray | ||
89 | case STexture2DArray | ||
90 | case STexture2DRect | ||
91 | case FTexture1D | ||
92 | case FTexture2D | ||
93 | case FTexture3D | ||
94 | case FTextureCube | ||
95 | case FTexture1DArray | ||
96 | case FTexture2DArray | ||
97 | case FTexture2DMS | ||
98 | case FTexture2DMSArray | ||
99 | case FTextureBuffer | ||
100 | case FTexture2DRect | ||
101 | case ITexture1D | ||
102 | case ITexture2D | ||
103 | case ITexture3D | ||
104 | case ITextureCube | ||
105 | case ITexture1DArray | ||
106 | case ITexture2DArray | ||
107 | case ITexture2DMS | ||
108 | case ITexture2DMSArray | ||
109 | case ITextureBuffer | ||
110 | case ITexture2DRect | ||
111 | case UTexture1D | ||
112 | case UTexture2D | ||
113 | case UTexture3D | ||
114 | case UTextureCube | ||
115 | case UTexture1DArray | ||
116 | case UTexture2DArray | ||
117 | case UTexture2DMS | ||
118 | case UTexture2DMSArray | ||
119 | case UTextureBuffer | ||
120 | case UTexture2DRect | ||
121 | } | ||
122 | |||
123 | enum PointSpriteCoordOrigin { | ||
124 | case LowerLeft | ||
125 | case UpperLeft | ||
126 | } | ||
127 | |||
128 | enum PointSize { | ||
129 | case PointSize(Float) | ||
130 | case ProgramPointSize | ||
131 | } | ||
132 | |||
133 | enum PolygonOffset { | ||
134 | case NoOffset | ||
135 | case Offset(Float,Float) | ||
136 | } | ||
137 | |||
138 | enum FrontFace { | ||
139 | case CCW | ||
140 | case CW | ||
141 | } | ||
142 | |||
143 | enum PolygonMode { | ||
144 | case PolygonPoint(PointSize) | ||
145 | case PolygonLine(Float) | ||
146 | case PolygonFill | ||
147 | } | ||
148 | |||
149 | enum ProvokingVertex { | ||
150 | case FirstVertex | ||
151 | case LastVertex | ||
152 | } | ||
153 | |||
154 | enum CullMode { | ||
155 | case CullNone | ||
156 | case CullFront(FrontFace) | ||
157 | case CullBack(FrontFace) | ||
158 | } | ||
159 | |||
160 | enum ComparisonFunction { | ||
161 | case Never | ||
162 | case Less | ||
163 | case Equal | ||
164 | case Lequal | ||
165 | case Greater | ||
166 | case Notequal | ||
167 | case Gequal | ||
168 | case Always | ||
169 | } | ||
170 | |||
171 | typealias DepthFunction = ComparisonFunction | ||
172 | |||
173 | enum StencilOperation { | ||
174 | case OpZero | ||
175 | case OpKeep | ||
176 | case OpReplace | ||
177 | case OpIncr | ||
178 | case OpIncrWrap | ||
179 | case OpDecr | ||
180 | case OpDecrWrap | ||
181 | case OpInvert | ||
182 | } | ||
183 | |||
184 | enum BlendEquation { | ||
185 | case FuncAdd | ||
186 | case FuncSubtract | ||
187 | case FuncReverseSubtract | ||
188 | case Min | ||
189 | case Max | ||
190 | } | ||
191 | |||
192 | enum BlendingFactor { | ||
193 | case Zero | ||
194 | case One | ||
195 | case SrcColor | ||
196 | case OneMinusSrcColor | ||
197 | case DstColor | ||
198 | case OneMinusDstColor | ||
199 | case SrcAlpha | ||
200 | case OneMinusSrcAlpha | ||
201 | case DstAlpha | ||
202 | case OneMinusDstAlpha | ||
203 | case ConstantColor | ||
204 | case OneMinusConstantColor | ||
205 | case ConstantAlpha | ||
206 | case OneMinusConstantAlpha | ||
207 | case SrcAlphaSaturate | ||
208 | } | ||
209 | |||
210 | enum LogicOperation { | ||
211 | case Clear | ||
212 | case And | ||
213 | case AndReverse | ||
214 | case Copy | ||
215 | case AndInverted | ||
216 | case Noop | ||
217 | case Xor | ||
218 | case Or | ||
219 | case Nor | ||
220 | case Equiv | ||
221 | case Invert | ||
222 | case OrReverse | ||
223 | case CopyInverted | ||
224 | case OrInverted | ||
225 | case Nand | ||
226 | case Set | ||
227 | } | ||
228 | |||
229 | enum StencilOps { | ||
230 | case StencilOps(StencilOps_Data) | ||
231 | struct StencilOps_Data { | ||
232 | var frontStencilOp : StencilOperation | ||
233 | var backStencilOp : StencilOperation | ||
234 | } | ||
235 | } | ||
236 | |||
237 | enum StencilTest { | ||
238 | case StencilTest(StencilTest_Data) | ||
239 | struct StencilTest_Data { | ||
240 | var stencilComparision : ComparisonFunction | ||
241 | var stencilReference : Int32 | ||
242 | var stencilMask : UInt32 | ||
243 | } | ||
244 | } | ||
245 | |||
246 | enum StencilTests { | ||
247 | case StencilTests(StencilTest,StencilTest) | ||
248 | } | ||
249 | |||
250 | enum FetchPrimitive { | ||
251 | case Points | ||
252 | case Lines | ||
253 | case Triangles | ||
254 | case LinesAdjacency | ||
255 | case TrianglesAdjacency | ||
256 | } | ||
257 | |||
258 | enum OutputPrimitive { | ||
259 | case TrianglesOutput | ||
260 | case LinesOutput | ||
261 | case PointsOutput | ||
262 | } | ||
263 | |||
264 | enum ColorArity { | ||
265 | case Red | ||
266 | case RG | ||
267 | case RGB | ||
268 | case RGBA | ||
269 | } | ||
270 | |||
271 | enum Blending { | ||
272 | case NoBlending | ||
273 | case BlendLogicOp(LogicOperation) | ||
274 | case Blend(Blend_Data) | ||
275 | struct Blend_Data { | ||
276 | var colorEqSrc : BlendEquation | ||
277 | var alphaEqSrc : BlendEquation | ||
278 | var colorFSrc : BlendingFactor | ||
279 | var colorFDst : BlendingFactor | ||
280 | var alphaFSrc : BlendingFactor | ||
281 | var alphaFDst : BlendingFactor | ||
282 | var color : Int | ||
283 | } | ||
284 | } | ||
285 | |||
286 | enum RasterContext { | ||
287 | case PointCtx(PointSize,Float,PointSpriteCoordOrigin) | ||
288 | case LineCtx(Float,ProvokingVertex) | ||
289 | case TriangleCtx(CullMode,PolygonMode,PolygonOffset,ProvokingVertex) | ||
290 | } | ||
291 | |||
292 | enum FragmentOperation { | ||
293 | case DepthOp(DepthFunction,Bool) | ||
294 | case StencilOp(StencilTests,StencilOps,StencilOps) | ||
295 | case ColorOp(Blending,Value) | ||
296 | } | ||
297 | |||
298 | enum AccumulationContext { | ||
299 | case AccumulationContext(AccumulationContext_Data) | ||
300 | struct AccumulationContext_Data { | ||
301 | var accViewportName : Maybe<String> | ||
302 | var accOperations : Array<FragmentOperation> | ||
303 | } | ||
304 | } | ||
305 | |||
306 | enum TextureDataType { | ||
307 | case FloatT(ColorArity) | ||
308 | case IntT(ColorArity) | ||
309 | case WordT(ColorArity) | ||
310 | case ShadowT | ||
311 | } | ||
312 | |||
313 | enum TextureType { | ||
314 | case Texture1D(TextureDataType,Int) | ||
315 | case Texture2D(TextureDataType,Int) | ||
316 | case Texture3D(TextureDataType) | ||
317 | case TextureCube(TextureDataType) | ||
318 | case TextureRect(TextureDataType) | ||
319 | case Texture2DMS(TextureDataType,Int,Int,Bool) | ||
320 | case TextureBuffer(TextureDataType) | ||
321 | } | ||
322 | |||
323 | enum MipMap { | ||
324 | case Mip(Int,Int) | ||
325 | case NoMip | ||
326 | case AutoMip(Int,Int) | ||
327 | } | ||
328 | |||
329 | enum Filter { | ||
330 | case Nearest | ||
331 | case Linear | ||
332 | case NearestMipmapNearest | ||
333 | case NearestMipmapLinear | ||
334 | case LinearMipmapNearest | ||
335 | case LinearMipmapLinear | ||
336 | } | ||
337 | |||
338 | enum EdgeMode { | ||
339 | case Repeat | ||
340 | case MirroredRepeat | ||
341 | case ClampToEdge | ||
342 | case ClampToBorder | ||
343 | } | ||
344 | |||
345 | enum ImageSemantic { | ||
346 | case Depth | ||
347 | case Stencil | ||
348 | case Color | ||
349 | } | ||
350 | |||
351 | enum ImageRef { | ||
352 | case TextureImage(TextureName,Int,Maybe<Int>) | ||
353 | case Framebuffer(ImageSemantic) | ||
354 | } | ||
355 | |||
356 | enum ClearImage { | ||
357 | case ClearImage(ClearImage_Data) | ||
358 | struct ClearImage_Data { | ||
359 | var imageSemantic : ImageSemantic | ||
360 | var clearValue : Value | ||
361 | } | ||
362 | } | ||
363 | |||
364 | enum Command { | ||
365 | case SetRasterContext(RasterContext) | ||
366 | case SetAccumulationContext(AccumulationContext) | ||
367 | case SetRenderTarget(RenderTargetName) | ||
368 | case SetProgram(ProgramName) | ||
369 | case SetSamplerUniform(UniformName,TextureUnit) | ||
370 | case SetTexture(TextureUnit,TextureName) | ||
371 | case SetSampler(TextureUnit,Maybe<SamplerName>) | ||
372 | case RenderSlot(SlotName) | ||
373 | case RenderStream(StreamName) | ||
374 | case ClearRenderTarget(Array<ClearImage>) | ||
375 | case GenerateMipMap(TextureUnit) | ||
376 | case SaveImage(FrameBufferComponent,ImageRef) | ||
377 | case LoadImage(ImageRef,FrameBufferComponent) | ||
378 | } | ||
379 | |||
380 | enum SamplerDescriptor { | ||
381 | case SamplerDescriptor(SamplerDescriptor_Data) | ||
382 | struct SamplerDescriptor_Data { | ||
383 | var samplerWrapS : EdgeMode | ||
384 | var samplerWrapT : Maybe<EdgeMode> | ||
385 | var samplerWrapR : Maybe<EdgeMode> | ||
386 | var samplerMinFilter : Filter | ||
387 | var samplerMagFilter : Filter | ||
388 | var samplerBorderColor : Value | ||
389 | var samplerMinLod : Maybe<Float> | ||
390 | var samplerMaxLod : Maybe<Float> | ||
391 | var samplerLodBias : Float | ||
392 | var samplerCompareFunc : Maybe<ComparisonFunction> | ||
393 | } | ||
394 | } | ||
395 | |||
396 | enum TextureDescriptor { | ||
397 | case TextureDescriptor(TextureDescriptor_Data) | ||
398 | struct TextureDescriptor_Data { | ||
399 | var textureType : TextureType | ||
400 | var textureSize : Value | ||
401 | var textureSemantic : ImageSemantic | ||
402 | var textureSampler : SamplerDescriptor | ||
403 | var textureBaseLevel : Int | ||
404 | var textureMaxLevel : Int | ||
405 | } | ||
406 | } | ||
407 | |||
408 | enum Parameter { | ||
409 | case Parameter(Parameter_Data) | ||
410 | struct Parameter_Data { | ||
411 | var name : String | ||
412 | var ty : InputType | ||
413 | } | ||
414 | } | ||
415 | |||
416 | enum Program { | ||
417 | case Program(Program_Data) | ||
418 | struct Program_Data { | ||
419 | var programUniforms : Dictionary<UniformName, InputType> | ||
420 | var programStreams : Dictionary<UniformName, Parameter> | ||
421 | var programInTextures : Dictionary<UniformName, InputType> | ||
422 | var programOutput : Array<Parameter> | ||
423 | var vertexShader : String | ||
424 | var geometryShader : Maybe<String> | ||
425 | var fragmentShader : String | ||
426 | } | ||
427 | } | ||
428 | |||
429 | enum Slot { | ||
430 | case Slot(Slot_Data) | ||
431 | struct Slot_Data { | ||
432 | var slotName : String | ||
433 | var slotStreams : Dictionary<String, InputType> | ||
434 | var slotUniforms : Dictionary<UniformName, InputType> | ||
435 | var slotPrimitive : FetchPrimitive | ||
436 | var slotPrograms : Array<ProgramName> | ||
437 | } | ||
438 | } | ||
439 | |||
440 | enum StreamData { | ||
441 | case StreamData(StreamData_Data) | ||
442 | struct StreamData_Data { | ||
443 | var streamData : Dictionary<String, ArrayValue> | ||
444 | var streamType : Dictionary<String, InputType> | ||
445 | var streamPrimitive : FetchPrimitive | ||
446 | var streamPrograms : Array<ProgramName> | ||
447 | } | ||
448 | } | ||
449 | |||
450 | enum TargetItem { | ||
451 | case TargetItem(TargetItem_Data) | ||
452 | struct TargetItem_Data { | ||
453 | var targetSemantic : ImageSemantic | ||
454 | var targetRef : Maybe<ImageRef> | ||
455 | } | ||
456 | } | ||
457 | |||
458 | enum RenderTarget { | ||
459 | case RenderTarget(RenderTarget_Data) | ||
460 | struct RenderTarget_Data { | ||
461 | var renderTargets : Array<TargetItem> | ||
462 | } | ||
463 | } | ||
464 | |||
465 | enum Backend { | ||
466 | case WebGL1 | ||
467 | case OpenGL33 | ||
468 | } | ||
469 | |||
470 | enum Pipeline { | ||
471 | case Pipeline(Pipeline_Data) | ||
472 | struct Pipeline_Data { | ||
473 | var info : String | ||
474 | var backend : Backend | ||
475 | var textures : Array<TextureDescriptor> | ||
476 | var samplers : Array<SamplerDescriptor> | ||
477 | var targets : Array<RenderTarget> | ||
478 | var programs : Array<Program> | ||
479 | var slots : Array<Slot> | ||
480 | var streams : Array<StreamData> | ||
481 | var commands : Array<Command> | ||
482 | } | ||
483 | } | ||
484 | |||
485 | |||
486 | extension Int { | ||
487 | var toJSON : [String: AnyObject] { | ||
488 | return ["":""] | ||
489 | } | ||
490 | } | ||
491 | extension Int32 { | ||
492 | var toJSON : [String: AnyObject] { | ||
493 | return ["":""] | ||
494 | } | ||
495 | } | ||
496 | extension UInt { | ||
497 | var toJSON : [String: AnyObject] { | ||
498 | return ["":""] | ||
499 | } | ||
500 | } | ||
501 | extension UInt32 { | ||
502 | var toJSON : [String: AnyObject] { | ||
503 | return ["":""] | ||
504 | } | ||
505 | } | ||
506 | extension Float { | ||
507 | var toJSON : [String: AnyObject] { | ||
508 | return ["":""] | ||
509 | } | ||
510 | } | ||
511 | extension Bool { | ||
512 | var toJSON : [String: AnyObject] { | ||
513 | return ["":""] | ||
514 | } | ||
515 | } | ||
516 | extension String { | ||
517 | var toJSON : [String: AnyObject] { | ||
518 | return ["":""] | ||
519 | } | ||
520 | } | ||
521 | extension Array { | ||
522 | var toJSON : [String: AnyObject] { | ||
523 | return ["":""] | ||
524 | } | ||
525 | } | ||
526 | extension Dictionary { | ||
527 | var toJSON : [String: AnyObject] { | ||
528 | return ["":""] | ||
529 | } | ||
530 | } | ||
531 | extension Maybe { | ||
532 | var toJSON : [String: AnyObject] { | ||
533 | return ["":""] | ||
534 | } | ||
535 | } | ||
536 | |||
537 | |||
538 | |||
539 | extension ArrayValue { | ||
540 | var toJSON : [String: AnyObject] { | ||
541 | switch self { | ||
542 | case .VBoolArray(let arg0): | ||
543 | return [ "tag" : "VBoolArray", "arg0" : arg0.toJSON] | ||
544 | case .VIntArray(let arg0): | ||
545 | return [ "tag" : "VIntArray", "arg0" : arg0.toJSON] | ||
546 | case .VWordArray(let arg0): | ||
547 | return [ "tag" : "VWordArray", "arg0" : arg0.toJSON] | ||
548 | case .VFloatArray(let arg0): | ||
549 | return [ "tag" : "VFloatArray", "arg0" : arg0.toJSON] | ||
550 | } | ||
551 | } | ||
552 | } | ||
553 | extension Value { | ||
554 | var toJSON : [String: AnyObject] { | ||
555 | switch self { | ||
556 | case .VBool(let arg0): | ||
557 | return [ "tag" : "VBool", "arg0" : arg0.toJSON] | ||
558 | case .VV2B(let arg0): | ||
559 | return [ "tag" : "VV2B", "arg0" : arg0.toJSON] | ||
560 | case .VV3B(let arg0): | ||
561 | return [ "tag" : "VV3B", "arg0" : arg0.toJSON] | ||
562 | case .VV4B(let arg0): | ||
563 | return [ "tag" : "VV4B", "arg0" : arg0.toJSON] | ||
564 | case .VWord(let arg0): | ||
565 | return [ "tag" : "VWord", "arg0" : arg0.toJSON] | ||
566 | case .VV2U(let arg0): | ||
567 | return [ "tag" : "VV2U", "arg0" : arg0.toJSON] | ||
568 | case .VV3U(let arg0): | ||
569 | return [ "tag" : "VV3U", "arg0" : arg0.toJSON] | ||
570 | case .VV4U(let arg0): | ||
571 | return [ "tag" : "VV4U", "arg0" : arg0.toJSON] | ||
572 | case .VInt(let arg0): | ||
573 | return [ "tag" : "VInt", "arg0" : arg0.toJSON] | ||
574 | case .VV2I(let arg0): | ||
575 | return [ "tag" : "VV2I", "arg0" : arg0.toJSON] | ||
576 | case .VV3I(let arg0): | ||
577 | return [ "tag" : "VV3I", "arg0" : arg0.toJSON] | ||
578 | case .VV4I(let arg0): | ||
579 | return [ "tag" : "VV4I", "arg0" : arg0.toJSON] | ||
580 | case .VFloat(let arg0): | ||
581 | return [ "tag" : "VFloat", "arg0" : arg0.toJSON] | ||
582 | case .VV2F(let arg0): | ||
583 | return [ "tag" : "VV2F", "arg0" : arg0.toJSON] | ||
584 | case .VV3F(let arg0): | ||
585 | return [ "tag" : "VV3F", "arg0" : arg0.toJSON] | ||
586 | case .VV4F(let arg0): | ||
587 | return [ "tag" : "VV4F", "arg0" : arg0.toJSON] | ||
588 | case .VM22F(let arg0): | ||
589 | return [ "tag" : "VM22F", "arg0" : arg0.toJSON] | ||
590 | case .VM23F(let arg0): | ||
591 | return [ "tag" : "VM23F", "arg0" : arg0.toJSON] | ||
592 | case .VM24F(let arg0): | ||
593 | return [ "tag" : "VM24F", "arg0" : arg0.toJSON] | ||
594 | case .VM32F(let arg0): | ||
595 | return [ "tag" : "VM32F", "arg0" : arg0.toJSON] | ||
596 | case .VM33F(let arg0): | ||
597 | return [ "tag" : "VM33F", "arg0" : arg0.toJSON] | ||
598 | case .VM34F(let arg0): | ||
599 | return [ "tag" : "VM34F", "arg0" : arg0.toJSON] | ||
600 | case .VM42F(let arg0): | ||
601 | return [ "tag" : "VM42F", "arg0" : arg0.toJSON] | ||
602 | case .VM43F(let arg0): | ||
603 | return [ "tag" : "VM43F", "arg0" : arg0.toJSON] | ||
604 | case .VM44F(let arg0): | ||
605 | return [ "tag" : "VM44F", "arg0" : arg0.toJSON] | ||
606 | } | ||
607 | } | ||
608 | } | ||
609 | extension InputType { | ||
610 | var toJSON : [String: AnyObject] { | ||
611 | switch self { | ||
612 | case .Bool: | ||
613 | return [ "tag" : "Bool"] | ||
614 | case .V2B: | ||
615 | return [ "tag" : "V2B"] | ||
616 | case .V3B: | ||
617 | return [ "tag" : "V3B"] | ||
618 | case .V4B: | ||
619 | return [ "tag" : "V4B"] | ||
620 | case .Word: | ||
621 | return [ "tag" : "Word"] | ||
622 | case .V2U: | ||
623 | return [ "tag" : "V2U"] | ||
624 | case .V3U: | ||
625 | return [ "tag" : "V3U"] | ||
626 | case .V4U: | ||
627 | return [ "tag" : "V4U"] | ||
628 | case .Int: | ||
629 | return [ "tag" : "Int"] | ||
630 | case .V2I: | ||
631 | return [ "tag" : "V2I"] | ||
632 | case .V3I: | ||
633 | return [ "tag" : "V3I"] | ||
634 | case .V4I: | ||
635 | return [ "tag" : "V4I"] | ||
636 | case .Float: | ||
637 | return [ "tag" : "Float"] | ||
638 | case .V2F: | ||
639 | return [ "tag" : "V2F"] | ||
640 | case .V3F: | ||
641 | return [ "tag" : "V3F"] | ||
642 | case .V4F: | ||
643 | return [ "tag" : "V4F"] | ||
644 | case .M22F: | ||
645 | return [ "tag" : "M22F"] | ||
646 | case .M23F: | ||
647 | return [ "tag" : "M23F"] | ||
648 | case .M24F: | ||
649 | return [ "tag" : "M24F"] | ||
650 | case .M32F: | ||
651 | return [ "tag" : "M32F"] | ||
652 | case .M33F: | ||
653 | return [ "tag" : "M33F"] | ||
654 | case .M34F: | ||
655 | return [ "tag" : "M34F"] | ||
656 | case .M42F: | ||
657 | return [ "tag" : "M42F"] | ||
658 | case .M43F: | ||
659 | return [ "tag" : "M43F"] | ||
660 | case .M44F: | ||
661 | return [ "tag" : "M44F"] | ||
662 | case .STexture1D: | ||
663 | return [ "tag" : "STexture1D"] | ||
664 | case .STexture2D: | ||
665 | return [ "tag" : "STexture2D"] | ||
666 | case .STextureCube: | ||
667 | return [ "tag" : "STextureCube"] | ||
668 | case .STexture1DArray: | ||
669 | return [ "tag" : "STexture1DArray"] | ||
670 | case .STexture2DArray: | ||
671 | return [ "tag" : "STexture2DArray"] | ||
672 | case .STexture2DRect: | ||
673 | return [ "tag" : "STexture2DRect"] | ||
674 | case .FTexture1D: | ||
675 | return [ "tag" : "FTexture1D"] | ||
676 | case .FTexture2D: | ||
677 | return [ "tag" : "FTexture2D"] | ||
678 | case .FTexture3D: | ||
679 | return [ "tag" : "FTexture3D"] | ||
680 | case .FTextureCube: | ||
681 | return [ "tag" : "FTextureCube"] | ||
682 | case .FTexture1DArray: | ||
683 | return [ "tag" : "FTexture1DArray"] | ||
684 | case .FTexture2DArray: | ||
685 | return [ "tag" : "FTexture2DArray"] | ||
686 | case .FTexture2DMS: | ||
687 | return [ "tag" : "FTexture2DMS"] | ||
688 | case .FTexture2DMSArray: | ||
689 | return [ "tag" : "FTexture2DMSArray"] | ||
690 | case .FTextureBuffer: | ||
691 | return [ "tag" : "FTextureBuffer"] | ||
692 | case .FTexture2DRect: | ||
693 | return [ "tag" : "FTexture2DRect"] | ||
694 | case .ITexture1D: | ||
695 | return [ "tag" : "ITexture1D"] | ||
696 | case .ITexture2D: | ||
697 | return [ "tag" : "ITexture2D"] | ||
698 | case .ITexture3D: | ||
699 | return [ "tag" : "ITexture3D"] | ||
700 | case .ITextureCube: | ||
701 | return [ "tag" : "ITextureCube"] | ||
702 | case .ITexture1DArray: | ||
703 | return [ "tag" : "ITexture1DArray"] | ||
704 | case .ITexture2DArray: | ||
705 | return [ "tag" : "ITexture2DArray"] | ||
706 | case .ITexture2DMS: | ||
707 | return [ "tag" : "ITexture2DMS"] | ||
708 | case .ITexture2DMSArray: | ||
709 | return [ "tag" : "ITexture2DMSArray"] | ||
710 | case .ITextureBuffer: | ||
711 | return [ "tag" : "ITextureBuffer"] | ||
712 | case .ITexture2DRect: | ||
713 | return [ "tag" : "ITexture2DRect"] | ||
714 | case .UTexture1D: | ||
715 | return [ "tag" : "UTexture1D"] | ||
716 | case .UTexture2D: | ||
717 | return [ "tag" : "UTexture2D"] | ||
718 | case .UTexture3D: | ||
719 | return [ "tag" : "UTexture3D"] | ||
720 | case .UTextureCube: | ||
721 | return [ "tag" : "UTextureCube"] | ||
722 | case .UTexture1DArray: | ||
723 | return [ "tag" : "UTexture1DArray"] | ||
724 | case .UTexture2DArray: | ||
725 | return [ "tag" : "UTexture2DArray"] | ||
726 | case .UTexture2DMS: | ||
727 | return [ "tag" : "UTexture2DMS"] | ||
728 | case .UTexture2DMSArray: | ||
729 | return [ "tag" : "UTexture2DMSArray"] | ||
730 | case .UTextureBuffer: | ||
731 | return [ "tag" : "UTextureBuffer"] | ||
732 | case .UTexture2DRect: | ||
733 | return [ "tag" : "UTexture2DRect"] | ||
734 | } | ||
735 | } | ||
736 | } | ||
737 | extension PointSpriteCoordOrigin { | ||
738 | var toJSON : [String: AnyObject] { | ||
739 | switch self { | ||
740 | case .LowerLeft: | ||
741 | return [ "tag" : "LowerLeft"] | ||
742 | case .UpperLeft: | ||
743 | return [ "tag" : "UpperLeft"] | ||
744 | } | ||
745 | } | ||
746 | } | ||
747 | extension PointSize { | ||
748 | var toJSON : [String: AnyObject] { | ||
749 | switch self { | ||
750 | case .PointSize(let arg0): | ||
751 | return [ "tag" : "PointSize", "arg0" : arg0.toJSON] | ||
752 | case .ProgramPointSize: | ||
753 | return [ "tag" : "ProgramPointSize"] | ||
754 | } | ||
755 | } | ||
756 | } | ||
757 | extension PolygonOffset { | ||
758 | var toJSON : [String: AnyObject] { | ||
759 | switch self { | ||
760 | case .NoOffset: | ||
761 | return [ "tag" : "NoOffset"] | ||
762 | case .Offset(let arg0, let arg1): | ||
763 | return [ "tag" : "Offset", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
764 | } | ||
765 | } | ||
766 | } | ||
767 | extension FrontFace { | ||
768 | var toJSON : [String: AnyObject] { | ||
769 | switch self { | ||
770 | case .CCW: | ||
771 | return [ "tag" : "CCW"] | ||
772 | case .CW: | ||
773 | return [ "tag" : "CW"] | ||
774 | } | ||
775 | } | ||
776 | } | ||
777 | extension PolygonMode { | ||
778 | var toJSON : [String: AnyObject] { | ||
779 | switch self { | ||
780 | case .PolygonPoint(let arg0): | ||
781 | return [ "tag" : "PolygonPoint", "arg0" : arg0.toJSON] | ||
782 | case .PolygonLine(let arg0): | ||
783 | return [ "tag" : "PolygonLine", "arg0" : arg0.toJSON] | ||
784 | case .PolygonFill: | ||
785 | return [ "tag" : "PolygonFill"] | ||
786 | } | ||
787 | } | ||
788 | } | ||
789 | extension ProvokingVertex { | ||
790 | var toJSON : [String: AnyObject] { | ||
791 | switch self { | ||
792 | case .FirstVertex: | ||
793 | return [ "tag" : "FirstVertex"] | ||
794 | case .LastVertex: | ||
795 | return [ "tag" : "LastVertex"] | ||
796 | } | ||
797 | } | ||
798 | } | ||
799 | extension CullMode { | ||
800 | var toJSON : [String: AnyObject] { | ||
801 | switch self { | ||
802 | case .CullNone: | ||
803 | return [ "tag" : "CullNone"] | ||
804 | case .CullFront(let arg0): | ||
805 | return [ "tag" : "CullFront", "arg0" : arg0.toJSON] | ||
806 | case .CullBack(let arg0): | ||
807 | return [ "tag" : "CullBack", "arg0" : arg0.toJSON] | ||
808 | } | ||
809 | } | ||
810 | } | ||
811 | extension ComparisonFunction { | ||
812 | var toJSON : [String: AnyObject] { | ||
813 | switch self { | ||
814 | case .Never: | ||
815 | return [ "tag" : "Never"] | ||
816 | case .Less: | ||
817 | return [ "tag" : "Less"] | ||
818 | case .Equal: | ||
819 | return [ "tag" : "Equal"] | ||
820 | case .Lequal: | ||
821 | return [ "tag" : "Lequal"] | ||
822 | case .Greater: | ||
823 | return [ "tag" : "Greater"] | ||
824 | case .Notequal: | ||
825 | return [ "tag" : "Notequal"] | ||
826 | case .Gequal: | ||
827 | return [ "tag" : "Gequal"] | ||
828 | case .Always: | ||
829 | return [ "tag" : "Always"] | ||
830 | } | ||
831 | } | ||
832 | } | ||
833 | extension StencilOperation { | ||
834 | var toJSON : [String: AnyObject] { | ||
835 | switch self { | ||
836 | case .OpZero: | ||
837 | return [ "tag" : "OpZero"] | ||
838 | case .OpKeep: | ||
839 | return [ "tag" : "OpKeep"] | ||
840 | case .OpReplace: | ||
841 | return [ "tag" : "OpReplace"] | ||
842 | case .OpIncr: | ||
843 | return [ "tag" : "OpIncr"] | ||
844 | case .OpIncrWrap: | ||
845 | return [ "tag" : "OpIncrWrap"] | ||
846 | case .OpDecr: | ||
847 | return [ "tag" : "OpDecr"] | ||
848 | case .OpDecrWrap: | ||
849 | return [ "tag" : "OpDecrWrap"] | ||
850 | case .OpInvert: | ||
851 | return [ "tag" : "OpInvert"] | ||
852 | } | ||
853 | } | ||
854 | } | ||
855 | extension BlendEquation { | ||
856 | var toJSON : [String: AnyObject] { | ||
857 | switch self { | ||
858 | case .FuncAdd: | ||
859 | return [ "tag" : "FuncAdd"] | ||
860 | case .FuncSubtract: | ||
861 | return [ "tag" : "FuncSubtract"] | ||
862 | case .FuncReverseSubtract: | ||
863 | return [ "tag" : "FuncReverseSubtract"] | ||
864 | case .Min: | ||
865 | return [ "tag" : "Min"] | ||
866 | case .Max: | ||
867 | return [ "tag" : "Max"] | ||
868 | } | ||
869 | } | ||
870 | } | ||
871 | extension BlendingFactor { | ||
872 | var toJSON : [String: AnyObject] { | ||
873 | switch self { | ||
874 | case .Zero: | ||
875 | return [ "tag" : "Zero"] | ||
876 | case .One: | ||
877 | return [ "tag" : "One"] | ||
878 | case .SrcColor: | ||
879 | return [ "tag" : "SrcColor"] | ||
880 | case .OneMinusSrcColor: | ||
881 | return [ "tag" : "OneMinusSrcColor"] | ||
882 | case .DstColor: | ||
883 | return [ "tag" : "DstColor"] | ||
884 | case .OneMinusDstColor: | ||
885 | return [ "tag" : "OneMinusDstColor"] | ||
886 | case .SrcAlpha: | ||
887 | return [ "tag" : "SrcAlpha"] | ||
888 | case .OneMinusSrcAlpha: | ||
889 | return [ "tag" : "OneMinusSrcAlpha"] | ||
890 | case .DstAlpha: | ||
891 | return [ "tag" : "DstAlpha"] | ||
892 | case .OneMinusDstAlpha: | ||
893 | return [ "tag" : "OneMinusDstAlpha"] | ||
894 | case .ConstantColor: | ||
895 | return [ "tag" : "ConstantColor"] | ||
896 | case .OneMinusConstantColor: | ||
897 | return [ "tag" : "OneMinusConstantColor"] | ||
898 | case .ConstantAlpha: | ||
899 | return [ "tag" : "ConstantAlpha"] | ||
900 | case .OneMinusConstantAlpha: | ||
901 | return [ "tag" : "OneMinusConstantAlpha"] | ||
902 | case .SrcAlphaSaturate: | ||
903 | return [ "tag" : "SrcAlphaSaturate"] | ||
904 | } | ||
905 | } | ||
906 | } | ||
907 | extension LogicOperation { | ||
908 | var toJSON : [String: AnyObject] { | ||
909 | switch self { | ||
910 | case .Clear: | ||
911 | return [ "tag" : "Clear"] | ||
912 | case .And: | ||
913 | return [ "tag" : "And"] | ||
914 | case .AndReverse: | ||
915 | return [ "tag" : "AndReverse"] | ||
916 | case .Copy: | ||
917 | return [ "tag" : "Copy"] | ||
918 | case .AndInverted: | ||
919 | return [ "tag" : "AndInverted"] | ||
920 | case .Noop: | ||
921 | return [ "tag" : "Noop"] | ||
922 | case .Xor: | ||
923 | return [ "tag" : "Xor"] | ||
924 | case .Or: | ||
925 | return [ "tag" : "Or"] | ||
926 | case .Nor: | ||
927 | return [ "tag" : "Nor"] | ||
928 | case .Equiv: | ||
929 | return [ "tag" : "Equiv"] | ||
930 | case .Invert: | ||
931 | return [ "tag" : "Invert"] | ||
932 | case .OrReverse: | ||
933 | return [ "tag" : "OrReverse"] | ||
934 | case .CopyInverted: | ||
935 | return [ "tag" : "CopyInverted"] | ||
936 | case .OrInverted: | ||
937 | return [ "tag" : "OrInverted"] | ||
938 | case .Nand: | ||
939 | return [ "tag" : "Nand"] | ||
940 | case .Set: | ||
941 | return [ "tag" : "Set"] | ||
942 | } | ||
943 | } | ||
944 | } | ||
945 | extension StencilOps { | ||
946 | var toJSON : [String: AnyObject] { | ||
947 | switch self { | ||
948 | case .StencilOps(let v): | ||
949 | return [ "tag" : "StencilOps" | ||
950 | , "frontStencilOp" : v.frontStencilOp.toJSON | ||
951 | , "backStencilOp" : v.backStencilOp.toJSON | ||
952 | ] | ||
953 | } | ||
954 | } | ||
955 | } | ||
956 | extension StencilTest { | ||
957 | var toJSON : [String: AnyObject] { | ||
958 | switch self { | ||
959 | case .StencilTest(let v): | ||
960 | return [ "tag" : "StencilTest" | ||
961 | , "stencilComparision" : v.stencilComparision.toJSON | ||
962 | , "stencilReference" : v.stencilReference.toJSON | ||
963 | , "stencilMask" : v.stencilMask.toJSON | ||
964 | ] | ||
965 | } | ||
966 | } | ||
967 | } | ||
968 | extension StencilTests { | ||
969 | var toJSON : [String: AnyObject] { | ||
970 | switch self { | ||
971 | case .StencilTests(let arg0, let arg1): | ||
972 | return [ "tag" : "StencilTests", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
973 | } | ||
974 | } | ||
975 | } | ||
976 | extension FetchPrimitive { | ||
977 | var toJSON : [String: AnyObject] { | ||
978 | switch self { | ||
979 | case .Points: | ||
980 | return [ "tag" : "Points"] | ||
981 | case .Lines: | ||
982 | return [ "tag" : "Lines"] | ||
983 | case .Triangles: | ||
984 | return [ "tag" : "Triangles"] | ||
985 | case .LinesAdjacency: | ||
986 | return [ "tag" : "LinesAdjacency"] | ||
987 | case .TrianglesAdjacency: | ||
988 | return [ "tag" : "TrianglesAdjacency"] | ||
989 | } | ||
990 | } | ||
991 | } | ||
992 | extension OutputPrimitive { | ||
993 | var toJSON : [String: AnyObject] { | ||
994 | switch self { | ||
995 | case .TrianglesOutput: | ||
996 | return [ "tag" : "TrianglesOutput"] | ||
997 | case .LinesOutput: | ||
998 | return [ "tag" : "LinesOutput"] | ||
999 | case .PointsOutput: | ||
1000 | return [ "tag" : "PointsOutput"] | ||
1001 | } | ||
1002 | } | ||
1003 | } | ||
1004 | extension ColorArity { | ||
1005 | var toJSON : [String: AnyObject] { | ||
1006 | switch self { | ||
1007 | case .Red: | ||
1008 | return [ "tag" : "Red"] | ||
1009 | case .RG: | ||
1010 | return [ "tag" : "RG"] | ||
1011 | case .RGB: | ||
1012 | return [ "tag" : "RGB"] | ||
1013 | case .RGBA: | ||
1014 | return [ "tag" : "RGBA"] | ||
1015 | } | ||
1016 | } | ||
1017 | } | ||
1018 | extension Blending { | ||
1019 | var toJSON : [String: AnyObject] { | ||
1020 | switch self { | ||
1021 | case .NoBlending: | ||
1022 | return [ "tag" : "NoBlending"] | ||
1023 | case .BlendLogicOp(let arg0): | ||
1024 | return [ "tag" : "BlendLogicOp", "arg0" : arg0.toJSON] | ||
1025 | case .Blend(let v): | ||
1026 | return [ "tag" : "Blend" | ||
1027 | , "colorEqSrc" : v.colorEqSrc.toJSON | ||
1028 | , "alphaEqSrc" : v.alphaEqSrc.toJSON | ||
1029 | , "colorFSrc" : v.colorFSrc.toJSON | ||
1030 | , "colorFDst" : v.colorFDst.toJSON | ||
1031 | , "alphaFSrc" : v.alphaFSrc.toJSON | ||
1032 | , "alphaFDst" : v.alphaFDst.toJSON | ||
1033 | , "color" : v.color.toJSON | ||
1034 | ] | ||
1035 | } | ||
1036 | } | ||
1037 | } | ||
1038 | extension RasterContext { | ||
1039 | var toJSON : [String: AnyObject] { | ||
1040 | switch self { | ||
1041 | case .PointCtx(let arg0, let arg1, let arg2): | ||
1042 | return [ "tag" : "PointCtx", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON] | ||
1043 | case .LineCtx(let arg0, let arg1): | ||
1044 | return [ "tag" : "LineCtx", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1045 | case .TriangleCtx(let arg0, let arg1, let arg2, let arg3): | ||
1046 | return [ "tag" : "TriangleCtx", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON, "arg3" : arg3.toJSON] | ||
1047 | } | ||
1048 | } | ||
1049 | } | ||
1050 | extension FragmentOperation { | ||
1051 | var toJSON : [String: AnyObject] { | ||
1052 | switch self { | ||
1053 | case .DepthOp(let arg0, let arg1): | ||
1054 | return [ "tag" : "DepthOp", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1055 | case .StencilOp(let arg0, let arg1, let arg2): | ||
1056 | return [ "tag" : "StencilOp", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON] | ||
1057 | case .ColorOp(let arg0, let arg1): | ||
1058 | return [ "tag" : "ColorOp", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1059 | } | ||
1060 | } | ||
1061 | } | ||
1062 | extension AccumulationContext { | ||
1063 | var toJSON : [String: AnyObject] { | ||
1064 | switch self { | ||
1065 | case .AccumulationContext(let v): | ||
1066 | return [ "tag" : "AccumulationContext" | ||
1067 | , "accViewportName" : v.accViewportName.toJSON | ||
1068 | , "accOperations" : v.accOperations.toJSON | ||
1069 | ] | ||
1070 | } | ||
1071 | } | ||
1072 | } | ||
1073 | extension TextureDataType { | ||
1074 | var toJSON : [String: AnyObject] { | ||
1075 | switch self { | ||
1076 | case .FloatT(let arg0): | ||
1077 | return [ "tag" : "FloatT", "arg0" : arg0.toJSON] | ||
1078 | case .IntT(let arg0): | ||
1079 | return [ "tag" : "IntT", "arg0" : arg0.toJSON] | ||
1080 | case .WordT(let arg0): | ||
1081 | return [ "tag" : "WordT", "arg0" : arg0.toJSON] | ||
1082 | case .ShadowT: | ||
1083 | return [ "tag" : "ShadowT"] | ||
1084 | } | ||
1085 | } | ||
1086 | } | ||
1087 | extension TextureType { | ||
1088 | var toJSON : [String: AnyObject] { | ||
1089 | switch self { | ||
1090 | case .Texture1D(let arg0, let arg1): | ||
1091 | return [ "tag" : "Texture1D", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1092 | case .Texture2D(let arg0, let arg1): | ||
1093 | return [ "tag" : "Texture2D", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1094 | case .Texture3D(let arg0): | ||
1095 | return [ "tag" : "Texture3D", "arg0" : arg0.toJSON] | ||
1096 | case .TextureCube(let arg0): | ||
1097 | return [ "tag" : "TextureCube", "arg0" : arg0.toJSON] | ||
1098 | case .TextureRect(let arg0): | ||
1099 | return [ "tag" : "TextureRect", "arg0" : arg0.toJSON] | ||
1100 | case .Texture2DMS(let arg0, let arg1, let arg2, let arg3): | ||
1101 | return [ "tag" : "Texture2DMS", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON, "arg3" : arg3.toJSON] | ||
1102 | case .TextureBuffer(let arg0): | ||
1103 | return [ "tag" : "TextureBuffer", "arg0" : arg0.toJSON] | ||
1104 | } | ||
1105 | } | ||
1106 | } | ||
1107 | extension MipMap { | ||
1108 | var toJSON : [String: AnyObject] { | ||
1109 | switch self { | ||
1110 | case .Mip(let arg0, let arg1): | ||
1111 | return [ "tag" : "Mip", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1112 | case .NoMip: | ||
1113 | return [ "tag" : "NoMip"] | ||
1114 | case .AutoMip(let arg0, let arg1): | ||
1115 | return [ "tag" : "AutoMip", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1116 | } | ||
1117 | } | ||
1118 | } | ||
1119 | extension Filter { | ||
1120 | var toJSON : [String: AnyObject] { | ||
1121 | switch self { | ||
1122 | case .Nearest: | ||
1123 | return [ "tag" : "Nearest"] | ||
1124 | case .Linear: | ||
1125 | return [ "tag" : "Linear"] | ||
1126 | case .NearestMipmapNearest: | ||
1127 | return [ "tag" : "NearestMipmapNearest"] | ||
1128 | case .NearestMipmapLinear: | ||
1129 | return [ "tag" : "NearestMipmapLinear"] | ||
1130 | case .LinearMipmapNearest: | ||
1131 | return [ "tag" : "LinearMipmapNearest"] | ||
1132 | case .LinearMipmapLinear: | ||
1133 | return [ "tag" : "LinearMipmapLinear"] | ||
1134 | } | ||
1135 | } | ||
1136 | } | ||
1137 | extension EdgeMode { | ||
1138 | var toJSON : [String: AnyObject] { | ||
1139 | switch self { | ||
1140 | case .Repeat: | ||
1141 | return [ "tag" : "Repeat"] | ||
1142 | case .MirroredRepeat: | ||
1143 | return [ "tag" : "MirroredRepeat"] | ||
1144 | case .ClampToEdge: | ||
1145 | return [ "tag" : "ClampToEdge"] | ||
1146 | case .ClampToBorder: | ||
1147 | return [ "tag" : "ClampToBorder"] | ||
1148 | } | ||
1149 | } | ||
1150 | } | ||
1151 | extension ImageSemantic { | ||
1152 | var toJSON : [String: AnyObject] { | ||
1153 | switch self { | ||
1154 | case .Depth: | ||
1155 | return [ "tag" : "Depth"] | ||
1156 | case .Stencil: | ||
1157 | return [ "tag" : "Stencil"] | ||
1158 | case .Color: | ||
1159 | return [ "tag" : "Color"] | ||
1160 | } | ||
1161 | } | ||
1162 | } | ||
1163 | extension ImageRef { | ||
1164 | var toJSON : [String: AnyObject] { | ||
1165 | switch self { | ||
1166 | case .TextureImage(let arg0, let arg1, let arg2): | ||
1167 | return [ "tag" : "TextureImage", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON] | ||
1168 | case .Framebuffer(let arg0): | ||
1169 | return [ "tag" : "Framebuffer", "arg0" : arg0.toJSON] | ||
1170 | } | ||
1171 | } | ||
1172 | } | ||
1173 | extension ClearImage { | ||
1174 | var toJSON : [String: AnyObject] { | ||
1175 | switch self { | ||
1176 | case .ClearImage(let v): | ||
1177 | return [ "tag" : "ClearImage" | ||
1178 | , "imageSemantic" : v.imageSemantic.toJSON | ||
1179 | , "clearValue" : v.clearValue.toJSON | ||
1180 | ] | ||
1181 | } | ||
1182 | } | ||
1183 | } | ||
1184 | extension Command { | ||
1185 | var toJSON : [String: AnyObject] { | ||
1186 | switch self { | ||
1187 | case .SetRasterContext(let arg0): | ||
1188 | return [ "tag" : "SetRasterContext", "arg0" : arg0.toJSON] | ||
1189 | case .SetAccumulationContext(let arg0): | ||
1190 | return [ "tag" : "SetAccumulationContext", "arg0" : arg0.toJSON] | ||
1191 | case .SetRenderTarget(let arg0): | ||
1192 | return [ "tag" : "SetRenderTarget", "arg0" : arg0.toJSON] | ||
1193 | case .SetProgram(let arg0): | ||
1194 | return [ "tag" : "SetProgram", "arg0" : arg0.toJSON] | ||
1195 | case .SetSamplerUniform(let arg0, let arg1): | ||
1196 | return [ "tag" : "SetSamplerUniform", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1197 | case .SetTexture(let arg0, let arg1): | ||
1198 | return [ "tag" : "SetTexture", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1199 | case .SetSampler(let arg0, let arg1): | ||
1200 | return [ "tag" : "SetSampler", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1201 | case .RenderSlot(let arg0): | ||
1202 | return [ "tag" : "RenderSlot", "arg0" : arg0.toJSON] | ||
1203 | case .RenderStream(let arg0): | ||
1204 | return [ "tag" : "RenderStream", "arg0" : arg0.toJSON] | ||
1205 | case .ClearRenderTarget(let arg0): | ||
1206 | return [ "tag" : "ClearRenderTarget", "arg0" : arg0.toJSON] | ||
1207 | case .GenerateMipMap(let arg0): | ||
1208 | return [ "tag" : "GenerateMipMap", "arg0" : arg0.toJSON] | ||
1209 | case .SaveImage(let arg0, let arg1): | ||
1210 | return [ "tag" : "SaveImage", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1211 | case .LoadImage(let arg0, let arg1): | ||
1212 | return [ "tag" : "LoadImage", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON] | ||
1213 | } | ||
1214 | } | ||
1215 | } | ||
1216 | extension SamplerDescriptor { | ||
1217 | var toJSON : [String: AnyObject] { | ||
1218 | switch self { | ||
1219 | case .SamplerDescriptor(let v): | ||
1220 | return [ "tag" : "SamplerDescriptor" | ||
1221 | , "samplerWrapS" : v.samplerWrapS.toJSON | ||
1222 | , "samplerWrapT" : v.samplerWrapT.toJSON | ||
1223 | , "samplerWrapR" : v.samplerWrapR.toJSON | ||
1224 | , "samplerMinFilter" : v.samplerMinFilter.toJSON | ||
1225 | , "samplerMagFilter" : v.samplerMagFilter.toJSON | ||
1226 | , "samplerBorderColor" : v.samplerBorderColor.toJSON | ||
1227 | , "samplerMinLod" : v.samplerMinLod.toJSON | ||
1228 | , "samplerMaxLod" : v.samplerMaxLod.toJSON | ||
1229 | , "samplerLodBias" : v.samplerLodBias.toJSON | ||
1230 | , "samplerCompareFunc" : v.samplerCompareFunc.toJSON | ||
1231 | ] | ||
1232 | } | ||
1233 | } | ||
1234 | } | ||
1235 | extension TextureDescriptor { | ||
1236 | var toJSON : [String: AnyObject] { | ||
1237 | switch self { | ||
1238 | case .TextureDescriptor(let v): | ||
1239 | return [ "tag" : "TextureDescriptor" | ||
1240 | , "textureType" : v.textureType.toJSON | ||
1241 | , "textureSize" : v.textureSize.toJSON | ||
1242 | , "textureSemantic" : v.textureSemantic.toJSON | ||
1243 | , "textureSampler" : v.textureSampler.toJSON | ||
1244 | , "textureBaseLevel" : v.textureBaseLevel.toJSON | ||
1245 | , "textureMaxLevel" : v.textureMaxLevel.toJSON | ||
1246 | ] | ||
1247 | } | ||
1248 | } | ||
1249 | } | ||
1250 | extension Parameter { | ||
1251 | var toJSON : [String: AnyObject] { | ||
1252 | switch self { | ||
1253 | case .Parameter(let v): | ||
1254 | return [ "tag" : "Parameter" | ||
1255 | , "name" : v.name.toJSON | ||
1256 | , "ty" : v.ty.toJSON | ||
1257 | ] | ||
1258 | } | ||
1259 | } | ||
1260 | } | ||
1261 | extension Program { | ||
1262 | var toJSON : [String: AnyObject] { | ||
1263 | switch self { | ||
1264 | case .Program(let v): | ||
1265 | return [ "tag" : "Program" | ||
1266 | , "programUniforms" : v.programUniforms.toJSON | ||
1267 | , "programStreams" : v.programStreams.toJSON | ||
1268 | , "programInTextures" : v.programInTextures.toJSON | ||
1269 | , "programOutput" : v.programOutput.toJSON | ||
1270 | , "vertexShader" : v.vertexShader.toJSON | ||
1271 | , "geometryShader" : v.geometryShader.toJSON | ||
1272 | , "fragmentShader" : v.fragmentShader.toJSON | ||
1273 | ] | ||
1274 | } | ||
1275 | } | ||
1276 | } | ||
1277 | extension Slot { | ||
1278 | var toJSON : [String: AnyObject] { | ||
1279 | switch self { | ||
1280 | case .Slot(let v): | ||
1281 | return [ "tag" : "Slot" | ||
1282 | , "slotName" : v.slotName.toJSON | ||
1283 | , "slotStreams" : v.slotStreams.toJSON | ||
1284 | , "slotUniforms" : v.slotUniforms.toJSON | ||
1285 | , "slotPrimitive" : v.slotPrimitive.toJSON | ||
1286 | , "slotPrograms" : v.slotPrograms.toJSON | ||
1287 | ] | ||
1288 | } | ||
1289 | } | ||
1290 | } | ||
1291 | extension StreamData { | ||
1292 | var toJSON : [String: AnyObject] { | ||
1293 | switch self { | ||
1294 | case .StreamData(let v): | ||
1295 | return [ "tag" : "StreamData" | ||
1296 | , "streamData" : v.streamData.toJSON | ||
1297 | , "streamType" : v.streamType.toJSON | ||
1298 | , "streamPrimitive" : v.streamPrimitive.toJSON | ||
1299 | , "streamPrograms" : v.streamPrograms.toJSON | ||
1300 | ] | ||
1301 | } | ||
1302 | } | ||
1303 | } | ||
1304 | extension TargetItem { | ||
1305 | var toJSON : [String: AnyObject] { | ||
1306 | switch self { | ||
1307 | case .TargetItem(let v): | ||
1308 | return [ "tag" : "TargetItem" | ||
1309 | , "targetSemantic" : v.targetSemantic.toJSON | ||
1310 | , "targetRef" : v.targetRef.toJSON | ||
1311 | ] | ||
1312 | } | ||
1313 | } | ||
1314 | } | ||
1315 | extension RenderTarget { | ||
1316 | var toJSON : [String: AnyObject] { | ||
1317 | switch self { | ||
1318 | case .RenderTarget(let v): | ||
1319 | return [ "tag" : "RenderTarget" | ||
1320 | , "renderTargets" : v.renderTargets.toJSON | ||
1321 | ] | ||
1322 | } | ||
1323 | } | ||
1324 | } | ||
1325 | extension Backend { | ||
1326 | var toJSON : [String: AnyObject] { | ||
1327 | switch self { | ||
1328 | case .WebGL1: | ||
1329 | return [ "tag" : "WebGL1"] | ||
1330 | case .OpenGL33: | ||
1331 | return [ "tag" : "OpenGL33"] | ||
1332 | } | ||
1333 | } | ||
1334 | } | ||
1335 | extension Pipeline { | ||
1336 | var toJSON : [String: AnyObject] { | ||
1337 | switch self { | ||
1338 | case .Pipeline(let v): | ||
1339 | return [ "tag" : "Pipeline" | ||
1340 | , "info" : v.info.toJSON | ||
1341 | , "backend" : v.backend.toJSON | ||
1342 | , "textures" : v.textures.toJSON | ||
1343 | , "samplers" : v.samplers.toJSON | ||
1344 | , "targets" : v.targets.toJSON | ||
1345 | , "programs" : v.programs.toJSON | ||
1346 | , "slots" : v.slots.toJSON | ||
1347 | , "streams" : v.streams.toJSON | ||
1348 | , "commands" : v.commands.toJSON | ||
1349 | ] | ||
1350 | } | ||
1351 | } | ||
1352 | } | ||
1353 | |||
1354 | enum Maybe<T> { | ||
1355 | case Nothing | ||
1356 | case Just(T) | ||
1357 | } | ||
1358 | |||
1359 | enum Type { | ||
1360 | case Int | ||
1361 | case Int32 | ||
1362 | case Word | ||
1363 | case Word32 | ||
1364 | case Float | ||
1365 | case Bool | ||
1366 | case String | ||
1367 | case Array(Type) | ||
1368 | case List(Type) | ||
1369 | case Maybe(Type) | ||
1370 | case Map(Type,Type) | ||
1371 | case ArrayValue | ||
1372 | case Value | ||
1373 | case InputType | ||
1374 | case PointSpriteCoordOrigin | ||
1375 | case PointSize | ||
1376 | case PolygonOffset | ||
1377 | case FrontFace | ||
1378 | case PolygonMode | ||
1379 | case ProvokingVertex | ||
1380 | case CullMode | ||
1381 | case ComparisonFunction | ||
1382 | case StencilOperation | ||
1383 | case BlendEquation | ||
1384 | case BlendingFactor | ||
1385 | case LogicOperation | ||
1386 | case StencilOps | ||
1387 | case StencilTest | ||
1388 | case StencilTests | ||
1389 | case FetchPrimitive | ||
1390 | case OutputPrimitive | ||
1391 | case ColorArity | ||
1392 | case Blending | ||
1393 | case RasterContext | ||
1394 | case FragmentOperation | ||
1395 | case AccumulationContext | ||
1396 | case TextureDataType | ||
1397 | case TextureType | ||
1398 | case MipMap | ||
1399 | case Filter | ||
1400 | case EdgeMode | ||
1401 | case ImageSemantic | ||
1402 | case ImageRef | ||
1403 | case ClearImage | ||
1404 | case Command | ||
1405 | case SamplerDescriptor | ||
1406 | case TextureDescriptor | ||
1407 | case Parameter | ||
1408 | case Program | ||
1409 | case Slot | ||
1410 | case StreamData | ||
1411 | case TargetItem | ||
1412 | case RenderTarget | ||
1413 | case Backend | ||
1414 | case Pipeline | ||
1415 | } | ||
1416 | |||
1417 | func fromJSON(type: Type, personName: String) -> Any { | ||
1418 | switch type { | ||
1419 | case .Int: return 0 | ||
1420 | case .Int32: return 0 | ||
1421 | case .Word: return 0 | ||
1422 | case .Word32: return 0 | ||
1423 | case .Float: return 0.0 | ||
1424 | case .Bool: return false | ||
1425 | case .String: return "" | ||
1426 | case .Array(let a): return fromJSON(a,personName) | ||
1427 | case .List(let a): return fromJSON(a,personName) | ||
1428 | case .Maybe(let a): return fromJSON(a,personName) | ||
1429 | } | ||
1430 | return 0; | ||
1431 | } \ No newline at end of file | ||
diff --git a/ddl/out/swift/LambdaCube.Mesh.swift b/ddl/out/swift/LambdaCube.Mesh.swift new file mode 100644 index 0000000..8df6c2a --- /dev/null +++ b/ddl/out/swift/LambdaCube.Mesh.swift | |||
@@ -0,0 +1,174 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-11-11T11:17:03.517567000000Z | ||
3 | |||
4 | enum MeshAttribute { | ||
5 | case A_Float(Array<Float>) | ||
6 | case A_V2F(Array<Int>) | ||
7 | case A_V3F(Array<Int>) | ||
8 | case A_V4F(Array<Int>) | ||
9 | case A_M22F(Array<Int>) | ||
10 | case A_M33F(Array<Int>) | ||
11 | case A_M44F(Array<Int>) | ||
12 | case A_Int(Array<Int32>) | ||
13 | case A_Word(Array<UInt32>) | ||
14 | } | ||
15 | |||
16 | enum MeshPrimitive { | ||
17 | case P_Points | ||
18 | case P_TriangleStrip | ||
19 | case P_Triangles | ||
20 | case P_TriangleStripI(Array<Int32>) | ||
21 | case P_TrianglesI(Array<Int32>) | ||
22 | } | ||
23 | |||
24 | enum Mesh { | ||
25 | case Mesh(Mesh_Data) | ||
26 | struct Mesh_Data { | ||
27 | var mAttributes : Dictionary<String, MeshAttribute> | ||
28 | var mPrimitive : MeshPrimitive | ||
29 | } | ||
30 | } | ||
31 | |||
32 | |||
33 | extension Int { | ||
34 | var toJSON : [String: AnyObject] { | ||
35 | return ["":""] | ||
36 | } | ||
37 | } | ||
38 | extension Int32 { | ||
39 | var toJSON : [String: AnyObject] { | ||
40 | return ["":""] | ||
41 | } | ||
42 | } | ||
43 | extension UInt { | ||
44 | var toJSON : [String: AnyObject] { | ||
45 | return ["":""] | ||
46 | } | ||
47 | } | ||
48 | extension UInt32 { | ||
49 | var toJSON : [String: AnyObject] { | ||
50 | return ["":""] | ||
51 | } | ||
52 | } | ||
53 | extension Float { | ||
54 | var toJSON : [String: AnyObject] { | ||
55 | return ["":""] | ||
56 | } | ||
57 | } | ||
58 | extension Bool { | ||
59 | var toJSON : [String: AnyObject] { | ||
60 | return ["":""] | ||
61 | } | ||
62 | } | ||
63 | extension String { | ||
64 | var toJSON : [String: AnyObject] { | ||
65 | return ["":""] | ||
66 | } | ||
67 | } | ||
68 | extension Array { | ||
69 | var toJSON : [String: AnyObject] { | ||
70 | return ["":""] | ||
71 | } | ||
72 | } | ||
73 | extension Dictionary { | ||
74 | var toJSON : [String: AnyObject] { | ||
75 | return ["":""] | ||
76 | } | ||
77 | } | ||
78 | extension Maybe { | ||
79 | var toJSON : [String: AnyObject] { | ||
80 | return ["":""] | ||
81 | } | ||
82 | } | ||
83 | |||
84 | |||
85 | |||
86 | extension MeshAttribute { | ||
87 | var toJSON : [String: AnyObject] { | ||
88 | switch self { | ||
89 | case .A_Float(let arg0): | ||
90 | return [ "tag" : "A_Float", "arg0" : arg0.toJSON] | ||
91 | case .A_V2F(let arg0): | ||
92 | return [ "tag" : "A_V2F", "arg0" : arg0.toJSON] | ||
93 | case .A_V3F(let arg0): | ||
94 | return [ "tag" : "A_V3F", "arg0" : arg0.toJSON] | ||
95 | case .A_V4F(let arg0): | ||
96 | return [ "tag" : "A_V4F", "arg0" : arg0.toJSON] | ||
97 | case .A_M22F(let arg0): | ||
98 | return [ "tag" : "A_M22F", "arg0" : arg0.toJSON] | ||
99 | case .A_M33F(let arg0): | ||
100 | return [ "tag" : "A_M33F", "arg0" : arg0.toJSON] | ||
101 | case .A_M44F(let arg0): | ||
102 | return [ "tag" : "A_M44F", "arg0" : arg0.toJSON] | ||
103 | case .A_Int(let arg0): | ||
104 | return [ "tag" : "A_Int", "arg0" : arg0.toJSON] | ||
105 | case .A_Word(let arg0): | ||
106 | return [ "tag" : "A_Word", "arg0" : arg0.toJSON] | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | extension MeshPrimitive { | ||
111 | var toJSON : [String: AnyObject] { | ||
112 | switch self { | ||
113 | case .P_Points: | ||
114 | return [ "tag" : "P_Points"] | ||
115 | case .P_TriangleStrip: | ||
116 | return [ "tag" : "P_TriangleStrip"] | ||
117 | case .P_Triangles: | ||
118 | return [ "tag" : "P_Triangles"] | ||
119 | case .P_TriangleStripI(let arg0): | ||
120 | return [ "tag" : "P_TriangleStripI", "arg0" : arg0.toJSON] | ||
121 | case .P_TrianglesI(let arg0): | ||
122 | return [ "tag" : "P_TrianglesI", "arg0" : arg0.toJSON] | ||
123 | } | ||
124 | } | ||
125 | } | ||
126 | extension Mesh { | ||
127 | var toJSON : [String: AnyObject] { | ||
128 | switch self { | ||
129 | case .Mesh(let v): | ||
130 | return [ "tag" : "Mesh" | ||
131 | , "mAttributes" : v.mAttributes.toJSON | ||
132 | , "mPrimitive" : v.mPrimitive.toJSON | ||
133 | ] | ||
134 | } | ||
135 | } | ||
136 | } | ||
137 | |||
138 | enum Maybe<T> { | ||
139 | case Nothing | ||
140 | case Just(T) | ||
141 | } | ||
142 | |||
143 | enum Type { | ||
144 | case Int | ||
145 | case Int32 | ||
146 | case Word | ||
147 | case Word32 | ||
148 | case Float | ||
149 | case Bool | ||
150 | case String | ||
151 | case Array(Type) | ||
152 | case List(Type) | ||
153 | case Maybe(Type) | ||
154 | case Map(Type,Type) | ||
155 | case MeshAttribute | ||
156 | case MeshPrimitive | ||
157 | case Mesh | ||
158 | } | ||
159 | |||
160 | func fromJSON(type: Type, personName: String) -> Any { | ||
161 | switch type { | ||
162 | case .Int: return 0 | ||
163 | case .Int32: return 0 | ||
164 | case .Word: return 0 | ||
165 | case .Word32: return 0 | ||
166 | case .Float: return 0.0 | ||
167 | case .Bool: return false | ||
168 | case .String: return "" | ||
169 | case .Array(let a): return fromJSON(a,personName) | ||
170 | case .List(let a): return fromJSON(a,personName) | ||
171 | case .Maybe(let a): return fromJSON(a,personName) | ||
172 | } | ||
173 | return 0; | ||
174 | } \ No newline at end of file | ||
diff --git a/ddl/out/swift/LambdaCube.PipelineSchema.swift b/ddl/out/swift/LambdaCube.PipelineSchema.swift new file mode 100644 index 0000000..47ac3aa --- /dev/null +++ b/ddl/out/swift/LambdaCube.PipelineSchema.swift | |||
@@ -0,0 +1,205 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-11-11T11:17:03.470118000000Z | ||
3 | |||
4 | enum StreamType { | ||
5 | case Attribute_Word | ||
6 | case Attribute_V2U | ||
7 | case Attribute_V3U | ||
8 | case Attribute_V4U | ||
9 | case Attribute_Int | ||
10 | case Attribute_V2I | ||
11 | case Attribute_V3I | ||
12 | case Attribute_V4I | ||
13 | case Attribute_Float | ||
14 | case Attribute_V2F | ||
15 | case Attribute_V3F | ||
16 | case Attribute_V4F | ||
17 | case Attribute_M22F | ||
18 | case Attribute_M23F | ||
19 | case Attribute_M24F | ||
20 | case Attribute_M32F | ||
21 | case Attribute_M33F | ||
22 | case Attribute_M34F | ||
23 | case Attribute_M42F | ||
24 | case Attribute_M43F | ||
25 | case Attribute_M44F | ||
26 | } | ||
27 | |||
28 | enum ObjectArraySchema { | ||
29 | case ObjectArraySchema(ObjectArraySchema_Data) | ||
30 | struct ObjectArraySchema_Data { | ||
31 | var primitive : FetchPrimitive | ||
32 | var attributes : Dictionary<String, StreamType> | ||
33 | } | ||
34 | } | ||
35 | |||
36 | enum PipelineSchema { | ||
37 | case PipelineSchema(PipelineSchema_Data) | ||
38 | struct PipelineSchema_Data { | ||
39 | var objectArrays : Dictionary<String, ObjectArraySchema> | ||
40 | var uniforms : Dictionary<String, InputType> | ||
41 | } | ||
42 | } | ||
43 | |||
44 | |||
45 | extension Int { | ||
46 | var toJSON : [String: AnyObject] { | ||
47 | return ["":""] | ||
48 | } | ||
49 | } | ||
50 | extension Int32 { | ||
51 | var toJSON : [String: AnyObject] { | ||
52 | return ["":""] | ||
53 | } | ||
54 | } | ||
55 | extension UInt { | ||
56 | var toJSON : [String: AnyObject] { | ||
57 | return ["":""] | ||
58 | } | ||
59 | } | ||
60 | extension UInt32 { | ||
61 | var toJSON : [String: AnyObject] { | ||
62 | return ["":""] | ||
63 | } | ||
64 | } | ||
65 | extension Float { | ||
66 | var toJSON : [String: AnyObject] { | ||
67 | return ["":""] | ||
68 | } | ||
69 | } | ||
70 | extension Bool { | ||
71 | var toJSON : [String: AnyObject] { | ||
72 | return ["":""] | ||
73 | } | ||
74 | } | ||
75 | extension String { | ||
76 | var toJSON : [String: AnyObject] { | ||
77 | return ["":""] | ||
78 | } | ||
79 | } | ||
80 | extension Array { | ||
81 | var toJSON : [String: AnyObject] { | ||
82 | return ["":""] | ||
83 | } | ||
84 | } | ||
85 | extension Dictionary { | ||
86 | var toJSON : [String: AnyObject] { | ||
87 | return ["":""] | ||
88 | } | ||
89 | } | ||
90 | extension Maybe { | ||
91 | var toJSON : [String: AnyObject] { | ||
92 | return ["":""] | ||
93 | } | ||
94 | } | ||
95 | |||
96 | |||
97 | |||
98 | extension StreamType { | ||
99 | var toJSON : [String: AnyObject] { | ||
100 | switch self { | ||
101 | case .Attribute_Word: | ||
102 | return [ "tag" : "Attribute_Word"] | ||
103 | case .Attribute_V2U: | ||
104 | return [ "tag" : "Attribute_V2U"] | ||
105 | case .Attribute_V3U: | ||
106 | return [ "tag" : "Attribute_V3U"] | ||
107 | case .Attribute_V4U: | ||
108 | return [ "tag" : "Attribute_V4U"] | ||
109 | case .Attribute_Int: | ||
110 | return [ "tag" : "Attribute_Int"] | ||
111 | case .Attribute_V2I: | ||
112 | return [ "tag" : "Attribute_V2I"] | ||
113 | case .Attribute_V3I: | ||
114 | return [ "tag" : "Attribute_V3I"] | ||
115 | case .Attribute_V4I: | ||
116 | return [ "tag" : "Attribute_V4I"] | ||
117 | case .Attribute_Float: | ||
118 | return [ "tag" : "Attribute_Float"] | ||
119 | case .Attribute_V2F: | ||
120 | return [ "tag" : "Attribute_V2F"] | ||
121 | case .Attribute_V3F: | ||
122 | return [ "tag" : "Attribute_V3F"] | ||
123 | case .Attribute_V4F: | ||
124 | return [ "tag" : "Attribute_V4F"] | ||
125 | case .Attribute_M22F: | ||
126 | return [ "tag" : "Attribute_M22F"] | ||
127 | case .Attribute_M23F: | ||
128 | return [ "tag" : "Attribute_M23F"] | ||
129 | case .Attribute_M24F: | ||
130 | return [ "tag" : "Attribute_M24F"] | ||
131 | case .Attribute_M32F: | ||
132 | return [ "tag" : "Attribute_M32F"] | ||
133 | case .Attribute_M33F: | ||
134 | return [ "tag" : "Attribute_M33F"] | ||
135 | case .Attribute_M34F: | ||
136 | return [ "tag" : "Attribute_M34F"] | ||
137 | case .Attribute_M42F: | ||
138 | return [ "tag" : "Attribute_M42F"] | ||
139 | case .Attribute_M43F: | ||
140 | return [ "tag" : "Attribute_M43F"] | ||
141 | case .Attribute_M44F: | ||
142 | return [ "tag" : "Attribute_M44F"] | ||
143 | } | ||
144 | } | ||
145 | } | ||
146 | extension ObjectArraySchema { | ||
147 | var toJSON : [String: AnyObject] { | ||
148 | switch self { | ||
149 | case .ObjectArraySchema(let v): | ||
150 | return [ "tag" : "ObjectArraySchema" | ||
151 | , "primitive" : v.primitive.toJSON | ||
152 | , "attributes" : v.attributes.toJSON | ||
153 | ] | ||
154 | } | ||
155 | } | ||
156 | } | ||
157 | extension PipelineSchema { | ||
158 | var toJSON : [String: AnyObject] { | ||
159 | switch self { | ||
160 | case .PipelineSchema(let v): | ||
161 | return [ "tag" : "PipelineSchema" | ||
162 | , "objectArrays" : v.objectArrays.toJSON | ||
163 | , "uniforms" : v.uniforms.toJSON | ||
164 | ] | ||
165 | } | ||
166 | } | ||
167 | } | ||
168 | |||
169 | enum Maybe<T> { | ||
170 | case Nothing | ||
171 | case Just(T) | ||
172 | } | ||
173 | |||
174 | enum Type { | ||
175 | case Int | ||
176 | case Int32 | ||
177 | case Word | ||
178 | case Word32 | ||
179 | case Float | ||
180 | case Bool | ||
181 | case String | ||
182 | case Array(Type) | ||
183 | case List(Type) | ||
184 | case Maybe(Type) | ||
185 | case Map(Type,Type) | ||
186 | case StreamType | ||
187 | case ObjectArraySchema | ||
188 | case PipelineSchema | ||
189 | } | ||
190 | |||
191 | func fromJSON(type: Type, personName: String) -> Any { | ||
192 | switch type { | ||
193 | case .Int: return 0 | ||
194 | case .Int32: return 0 | ||
195 | case .Word: return 0 | ||
196 | case .Word32: return 0 | ||
197 | case .Float: return 0.0 | ||
198 | case .Bool: return false | ||
199 | case .String: return "" | ||
200 | case .Array(let a): return fromJSON(a,personName) | ||
201 | case .List(let a): return fromJSON(a,personName) | ||
202 | case .Maybe(let a): return fromJSON(a,personName) | ||
203 | } | ||
204 | return 0; | ||
205 | } \ No newline at end of file | ||
diff --git a/ddl/out/swift/LambdaCube.TypeInfo.swift b/ddl/out/swift/LambdaCube.TypeInfo.swift new file mode 100644 index 0000000..0328305 --- /dev/null +++ b/ddl/out/swift/LambdaCube.TypeInfo.swift | |||
@@ -0,0 +1,192 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-11-11T11:17:03.605012000000Z | ||
3 | |||
4 | enum Range { | ||
5 | case Range(Range_Data) | ||
6 | struct Range_Data { | ||
7 | var startLine : Int | ||
8 | var startColumn : Int | ||
9 | var endLine : Int | ||
10 | var endColumn : Int | ||
11 | } | ||
12 | } | ||
13 | |||
14 | enum TypeInfo { | ||
15 | case TypeInfo(TypeInfo_Data) | ||
16 | struct TypeInfo_Data { | ||
17 | var range : Range | ||
18 | var text : String | ||
19 | } | ||
20 | } | ||
21 | |||
22 | enum WarningInfo { | ||
23 | case WarningInfo(WarningInfo_Data) | ||
24 | struct WarningInfo_Data { | ||
25 | var wRange : Range | ||
26 | var wText : String | ||
27 | } | ||
28 | } | ||
29 | |||
30 | enum ErrorInfo { | ||
31 | case ErrorInfo(ErrorInfo_Data) | ||
32 | struct ErrorInfo_Data { | ||
33 | var eRange : Range | ||
34 | var eText : String | ||
35 | } | ||
36 | } | ||
37 | |||
38 | enum CompileResult { | ||
39 | case CompileError(String,Array<TypeInfo>,Array<WarningInfo>,Array<ErrorInfo>) | ||
40 | case Compiled(String,String,Pipeline,Array<TypeInfo>,Array<WarningInfo>) | ||
41 | } | ||
42 | |||
43 | |||
44 | extension Int { | ||
45 | var toJSON : [String: AnyObject] { | ||
46 | return ["":""] | ||
47 | } | ||
48 | } | ||
49 | extension Int32 { | ||
50 | var toJSON : [String: AnyObject] { | ||
51 | return ["":""] | ||
52 | } | ||
53 | } | ||
54 | extension UInt { | ||
55 | var toJSON : [String: AnyObject] { | ||
56 | return ["":""] | ||
57 | } | ||
58 | } | ||
59 | extension UInt32 { | ||
60 | var toJSON : [String: AnyObject] { | ||
61 | return ["":""] | ||
62 | } | ||
63 | } | ||
64 | extension Float { | ||
65 | var toJSON : [String: AnyObject] { | ||
66 | return ["":""] | ||
67 | } | ||
68 | } | ||
69 | extension Bool { | ||
70 | var toJSON : [String: AnyObject] { | ||
71 | return ["":""] | ||
72 | } | ||
73 | } | ||
74 | extension String { | ||
75 | var toJSON : [String: AnyObject] { | ||
76 | return ["":""] | ||
77 | } | ||
78 | } | ||
79 | extension Array { | ||
80 | var toJSON : [String: AnyObject] { | ||
81 | return ["":""] | ||
82 | } | ||
83 | } | ||
84 | extension Dictionary { | ||
85 | var toJSON : [String: AnyObject] { | ||
86 | return ["":""] | ||
87 | } | ||
88 | } | ||
89 | extension Maybe { | ||
90 | var toJSON : [String: AnyObject] { | ||
91 | return ["":""] | ||
92 | } | ||
93 | } | ||
94 | |||
95 | |||
96 | |||
97 | extension Range { | ||
98 | var toJSON : [String: AnyObject] { | ||
99 | switch self { | ||
100 | case .Range(let v): | ||
101 | return [ "tag" : "Range" | ||
102 | , "startLine" : v.startLine.toJSON | ||
103 | , "startColumn" : v.startColumn.toJSON | ||
104 | , "endLine" : v.endLine.toJSON | ||
105 | , "endColumn" : v.endColumn.toJSON | ||
106 | ] | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | extension TypeInfo { | ||
111 | var toJSON : [String: AnyObject] { | ||
112 | switch self { | ||
113 | case .TypeInfo(let v): | ||
114 | return [ "tag" : "TypeInfo" | ||
115 | , "range" : v.range.toJSON | ||
116 | , "text" : v.text.toJSON | ||
117 | ] | ||
118 | } | ||
119 | } | ||
120 | } | ||
121 | extension WarningInfo { | ||
122 | var toJSON : [String: AnyObject] { | ||
123 | switch self { | ||
124 | case .WarningInfo(let v): | ||
125 | return [ "tag" : "WarningInfo" | ||
126 | , "wRange" : v.wRange.toJSON | ||
127 | , "wText" : v.wText.toJSON | ||
128 | ] | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | extension ErrorInfo { | ||
133 | var toJSON : [String: AnyObject] { | ||
134 | switch self { | ||
135 | case .ErrorInfo(let v): | ||
136 | return [ "tag" : "ErrorInfo" | ||
137 | , "eRange" : v.eRange.toJSON | ||
138 | , "eText" : v.eText.toJSON | ||
139 | ] | ||
140 | } | ||
141 | } | ||
142 | } | ||
143 | extension CompileResult { | ||
144 | var toJSON : [String: AnyObject] { | ||
145 | switch self { | ||
146 | case .CompileError(let arg0, let arg1, let arg2, let arg3): | ||
147 | return [ "tag" : "CompileError", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON, "arg3" : arg3.toJSON] | ||
148 | case .Compiled(let arg0, let arg1, let arg2, let arg3, let arg4): | ||
149 | return [ "tag" : "Compiled", "arg0" : arg0.toJSON, "arg1" : arg1.toJSON, "arg2" : arg2.toJSON, "arg3" : arg3.toJSON, "arg4" : arg4.toJSON] | ||
150 | } | ||
151 | } | ||
152 | } | ||
153 | |||
154 | enum Maybe<T> { | ||
155 | case Nothing | ||
156 | case Just(T) | ||
157 | } | ||
158 | |||
159 | enum Type { | ||
160 | case Int | ||
161 | case Int32 | ||
162 | case Word | ||
163 | case Word32 | ||
164 | case Float | ||
165 | case Bool | ||
166 | case String | ||
167 | case Array(Type) | ||
168 | case List(Type) | ||
169 | case Maybe(Type) | ||
170 | case Map(Type,Type) | ||
171 | case Range | ||
172 | case TypeInfo | ||
173 | case WarningInfo | ||
174 | case ErrorInfo | ||
175 | case CompileResult | ||
176 | } | ||
177 | |||
178 | func fromJSON(type: Type, personName: String) -> Any { | ||
179 | switch type { | ||
180 | case .Int: return 0 | ||
181 | case .Int32: return 0 | ||
182 | case .Word: return 0 | ||
183 | case .Word32: return 0 | ||
184 | case .Float: return 0.0 | ||
185 | case .Bool: return false | ||
186 | case .String: return "" | ||
187 | case .Array(let a): return fromJSON(a,personName) | ||
188 | case .List(let a): return fromJSON(a,personName) | ||
189 | case .Maybe(let a): return fromJSON(a,personName) | ||
190 | } | ||
191 | return 0; | ||
192 | } \ No newline at end of file | ||
diff --git a/ddl/out/swift/TestData.swift b/ddl/out/swift/TestData.swift new file mode 100644 index 0000000..21c53d3 --- /dev/null +++ b/ddl/out/swift/TestData.swift | |||
@@ -0,0 +1,242 @@ | |||
1 | // generated file, do not modify! | ||
2 | // 2016-11-11T11:17:03.685172000000Z | ||
3 | |||
4 | enum ClientInfo { | ||
5 | case ClientInfo(ClientInfo_Data) | ||
6 | struct ClientInfo_Data { | ||
7 | var clientName : String | ||
8 | var clientBackend : Backend | ||
9 | } | ||
10 | } | ||
11 | |||
12 | enum Frame { | ||
13 | case Frame(Frame_Data) | ||
14 | struct Frame_Data { | ||
15 | var renderCount : Int | ||
16 | var frameUniforms : Dictionary<String, Value> | ||
17 | var frameTextures : Dictionary<String, Int> | ||
18 | } | ||
19 | } | ||
20 | |||
21 | enum Scene { | ||
22 | case Scene(Scene_Data) | ||
23 | struct Scene_Data { | ||
24 | var objectArrays : Dictionary<String, Array<Int>> | ||
25 | var renderTargetWidth : Int | ||
26 | var renderTargetHeight : Int | ||
27 | var frames : Array<Frame> | ||
28 | } | ||
29 | } | ||
30 | |||
31 | enum PipelineInfo { | ||
32 | case PipelineInfo(PipelineInfo_Data) | ||
33 | struct PipelineInfo_Data { | ||
34 | var pipelineName : String | ||
35 | var pipeline : Pipeline | ||
36 | } | ||
37 | } | ||
38 | |||
39 | enum RenderJob { | ||
40 | case RenderJob(RenderJob_Data) | ||
41 | struct RenderJob_Data { | ||
42 | var meshes : Array<Mesh> | ||
43 | var textures : Array<String> | ||
44 | var schema : PipelineSchema | ||
45 | var scenes : Array<Scene> | ||
46 | var pipelines : Array<PipelineInfo> | ||
47 | } | ||
48 | } | ||
49 | |||
50 | enum FrameResult { | ||
51 | case FrameResult(FrameResult_Data) | ||
52 | struct FrameResult_Data { | ||
53 | var frRenderTimes : Array<Float> | ||
54 | var frImageWidth : Int | ||
55 | var frImageHeight : Int | ||
56 | } | ||
57 | } | ||
58 | |||
59 | enum RenderJobResult { | ||
60 | case RenderJobResult(FrameResult) | ||
61 | case RenderJobError(String) | ||
62 | } | ||
63 | |||
64 | |||
65 | extension Int { | ||
66 | var toJSON : [String: AnyObject] { | ||
67 | return ["":""] | ||
68 | } | ||
69 | } | ||
70 | extension Int32 { | ||
71 | var toJSON : [String: AnyObject] { | ||
72 | return ["":""] | ||
73 | } | ||
74 | } | ||
75 | extension UInt { | ||
76 | var toJSON : [String: AnyObject] { | ||
77 | return ["":""] | ||
78 | } | ||
79 | } | ||
80 | extension UInt32 { | ||
81 | var toJSON : [String: AnyObject] { | ||
82 | return ["":""] | ||
83 | } | ||
84 | } | ||
85 | extension Float { | ||
86 | var toJSON : [String: AnyObject] { | ||
87 | return ["":""] | ||
88 | } | ||
89 | } | ||
90 | extension Bool { | ||
91 | var toJSON : [String: AnyObject] { | ||
92 | return ["":""] | ||
93 | } | ||
94 | } | ||
95 | extension String { | ||
96 | var toJSON : [String: AnyObject] { | ||
97 | return ["":""] | ||
98 | } | ||
99 | } | ||
100 | extension Array { | ||
101 | var toJSON : [String: AnyObject] { | ||
102 | return ["":""] | ||
103 | } | ||
104 | } | ||
105 | extension Dictionary { | ||
106 | var toJSON : [String: AnyObject] { | ||
107 | return ["":""] | ||
108 | } | ||
109 | } | ||
110 | extension Maybe { | ||
111 | var toJSON : [String: AnyObject] { | ||
112 | return ["":""] | ||
113 | } | ||
114 | } | ||
115 | |||
116 | |||
117 | |||
118 | extension ClientInfo { | ||
119 | var toJSON : [String: AnyObject] { | ||
120 | switch self { | ||
121 | case .ClientInfo(let v): | ||
122 | return [ "tag" : "ClientInfo" | ||
123 | , "clientName" : v.clientName.toJSON | ||
124 | , "clientBackend" : v.clientBackend.toJSON | ||
125 | ] | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | extension Frame { | ||
130 | var toJSON : [String: AnyObject] { | ||
131 | switch self { | ||
132 | case .Frame(let v): | ||
133 | return [ "tag" : "Frame" | ||
134 | , "renderCount" : v.renderCount.toJSON | ||
135 | , "frameUniforms" : v.frameUniforms.toJSON | ||
136 | , "frameTextures" : v.frameTextures.toJSON | ||
137 | ] | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | extension Scene { | ||
142 | var toJSON : [String: AnyObject] { | ||
143 | switch self { | ||
144 | case .Scene(let v): | ||
145 | return [ "tag" : "Scene" | ||
146 | , "objectArrays" : v.objectArrays.toJSON | ||
147 | , "renderTargetWidth" : v.renderTargetWidth.toJSON | ||
148 | , "renderTargetHeight" : v.renderTargetHeight.toJSON | ||
149 | , "frames" : v.frames.toJSON | ||
150 | ] | ||
151 | } | ||
152 | } | ||
153 | } | ||
154 | extension PipelineInfo { | ||
155 | var toJSON : [String: AnyObject] { | ||
156 | switch self { | ||
157 | case .PipelineInfo(let v): | ||
158 | return [ "tag" : "PipelineInfo" | ||
159 | , "pipelineName" : v.pipelineName.toJSON | ||
160 | , "pipeline" : v.pipeline.toJSON | ||
161 | ] | ||
162 | } | ||
163 | } | ||
164 | } | ||
165 | extension RenderJob { | ||
166 | var toJSON : [String: AnyObject] { | ||
167 | switch self { | ||
168 | case .RenderJob(let v): | ||
169 | return [ "tag" : "RenderJob" | ||
170 | , "meshes" : v.meshes.toJSON | ||
171 | , "textures" : v.textures.toJSON | ||
172 | , "schema" : v.schema.toJSON | ||
173 | , "scenes" : v.scenes.toJSON | ||
174 | , "pipelines" : v.pipelines.toJSON | ||
175 | ] | ||
176 | } | ||
177 | } | ||
178 | } | ||
179 | extension FrameResult { | ||
180 | var toJSON : [String: AnyObject] { | ||
181 | switch self { | ||
182 | case .FrameResult(let v): | ||
183 | return [ "tag" : "FrameResult" | ||
184 | , "frRenderTimes" : v.frRenderTimes.toJSON | ||
185 | , "frImageWidth" : v.frImageWidth.toJSON | ||
186 | , "frImageHeight" : v.frImageHeight.toJSON | ||
187 | ] | ||
188 | } | ||
189 | } | ||
190 | } | ||
191 | extension RenderJobResult { | ||
192 | var toJSON : [String: AnyObject] { | ||
193 | switch self { | ||
194 | case .RenderJobResult(let arg0): | ||
195 | return [ "tag" : "RenderJobResult", "arg0" : arg0.toJSON] | ||
196 | case .RenderJobError(let arg0): | ||
197 | return [ "tag" : "RenderJobError", "arg0" : arg0.toJSON] | ||
198 | } | ||
199 | } | ||
200 | } | ||
201 | |||
202 | enum Maybe<T> { | ||
203 | case Nothing | ||
204 | case Just(T) | ||
205 | } | ||
206 | |||
207 | enum Type { | ||
208 | case Int | ||
209 | case Int32 | ||
210 | case Word | ||
211 | case Word32 | ||
212 | case Float | ||
213 | case Bool | ||
214 | case String | ||
215 | case Array(Type) | ||
216 | case List(Type) | ||
217 | case Maybe(Type) | ||
218 | case Map(Type,Type) | ||
219 | case ClientInfo | ||
220 | case Frame | ||
221 | case Scene | ||
222 | case PipelineInfo | ||
223 | case RenderJob | ||
224 | case FrameResult | ||
225 | case RenderJobResult | ||
226 | } | ||
227 | |||
228 | func fromJSON(type: Type, personName: String) -> Any { | ||
229 | switch type { | ||
230 | case .Int: return 0 | ||
231 | case .Int32: return 0 | ||
232 | case .Word: return 0 | ||
233 | case .Word32: return 0 | ||
234 | case .Float: return 0.0 | ||
235 | case .Bool: return false | ||
236 | case .String: return "" | ||
237 | case .Array(let a): return fromJSON(a,personName) | ||
238 | case .List(let a): return fromJSON(a,personName) | ||
239 | case .Maybe(let a): return fromJSON(a,personName) | ||
240 | } | ||
241 | return 0; | ||
242 | } \ No newline at end of file | ||