summaryrefslogtreecommitdiff
path: root/ddl/out
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-03-20 22:44:29 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-03-21 14:12:02 +0100
commitc5e063b3c9aeff65161e24445e9672daff980b45 (patch)
treef469f6e8eb1a24060b01453f3f23db5c72a4850c /ddl/out
parent3b50722f433ec5ecc515ea1441fd633d85118cb9 (diff)
working c# backend
Diffstat (limited to 'ddl/out')
-rw-r--r--ddl/out/LambdaCube.IR.cpp4
-rw-r--r--ddl/out/LambdaCube.IR.cs4444
-rw-r--r--ddl/out/LambdaCube.IR.hpp4
-rw-r--r--ddl/out/LambdaCube.IR.hs4
-rw-r--r--ddl/out/LambdaCube.IR.java877
-rw-r--r--ddl/out/LambdaCube.IR.purs4
-rw-r--r--ddl/out/LambdaCube.IR.swift4
-rw-r--r--ddl/out/LambdaCube.IR2.hpp4
-rw-r--r--ddl/out/LambdaCube.Mesh.cpp4
-rw-r--r--ddl/out/LambdaCube.Mesh.cs529
-rw-r--r--ddl/out/LambdaCube.Mesh.hpp4
-rw-r--r--ddl/out/LambdaCube.Mesh.hs4
-rw-r--r--ddl/out/LambdaCube.Mesh.java79
-rw-r--r--ddl/out/LambdaCube.Mesh.purs4
-rw-r--r--ddl/out/LambdaCube.Mesh.swift4
-rw-r--r--ddl/out/LambdaCube.Mesh2.hpp4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.cpp4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.cs339
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.hpp4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.hs4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.java59
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.purs4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.swift4
-rw-r--r--ddl/out/LambdaCube.PipelineSchema2.hpp4
-rw-r--r--ddl/out/LambdaCube.TypeInfo.cpp4
-rw-r--r--ddl/out/LambdaCube.TypeInfo.cs218
-rw-r--r--ddl/out/LambdaCube.TypeInfo.hpp4
-rw-r--r--ddl/out/LambdaCube.TypeInfo.hs4
-rw-r--r--ddl/out/LambdaCube.TypeInfo.java52
-rw-r--r--ddl/out/LambdaCube.TypeInfo.purs4
-rw-r--r--ddl/out/LambdaCube.TypeInfo.swift4
-rw-r--r--ddl/out/LambdaCube.TypeInfo2.hpp4
-rw-r--r--ddl/out/TestData.cpp4
-rw-r--r--ddl/out/TestData.cs499
-rw-r--r--ddl/out/TestData.hpp4
-rw-r--r--ddl/out/TestData.hs4
-rw-r--r--ddl/out/TestData.java103
-rw-r--r--ddl/out/TestData.purs4
-rw-r--r--ddl/out/TestData.swift4
-rw-r--r--ddl/out/TestData2.hpp4
-rw-r--r--ddl/out/java/LambdaCube/IR/AccumulationContext.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/ArrayValue.java37
-rw-r--r--ddl/out/java/LambdaCube/IR/Backend.java19
-rw-r--r--ddl/out/java/LambdaCube/IR/BlendEquation.java22
-rw-r--r--ddl/out/java/LambdaCube/IR/Blending.java34
-rw-r--r--ddl/out/java/LambdaCube/IR/BlendingFactor.java32
-rw-r--r--ddl/out/java/LambdaCube/IR/ClearImage.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/ColorArity.java21
-rw-r--r--ddl/out/java/LambdaCube/IR/Command.java87
-rw-r--r--ddl/out/java/LambdaCube/IR/ComparisonFunction.java25
-rw-r--r--ddl/out/java/LambdaCube/IR/CullMode.java28
-rw-r--r--ddl/out/java/LambdaCube/IR/EdgeMode.java21
-rw-r--r--ddl/out/java/LambdaCube/IR/FetchPrimitive.java22
-rw-r--r--ddl/out/java/LambdaCube/IR/Filter.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/FragmentOperation.java36
-rw-r--r--ddl/out/java/LambdaCube/IR/FrontFace.java19
-rw-r--r--ddl/out/java/LambdaCube/IR/ImageRef.java29
-rw-r--r--ddl/out/java/LambdaCube/IR/ImageSemantic.java20
-rw-r--r--ddl/out/java/LambdaCube/IR/InputType.java78
-rw-r--r--ddl/out/java/LambdaCube/IR/JSON.java1460
-rw-r--r--ddl/out/java/LambdaCube/IR/LogicOperation.java33
-rw-r--r--ddl/out/java/LambdaCube/IR/MipMap.java30
-rw-r--r--ddl/out/java/LambdaCube/IR/OutputPrimitive.java20
-rw-r--r--ddl/out/java/LambdaCube/IR/Parameter.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/Pipeline.java30
-rw-r--r--ddl/out/java/LambdaCube/IR/PointSize.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java19
-rw-r--r--ddl/out/java/LambdaCube/IR/PolygonMode.java28
-rw-r--r--ddl/out/java/LambdaCube/IR/PolygonOffset.java24
-rw-r--r--ddl/out/java/LambdaCube/IR/Program.java28
-rw-r--r--ddl/out/java/LambdaCube/IR/ProvokingVertex.java19
-rw-r--r--ddl/out/java/LambdaCube/IR/RasterContext.java38
-rw-r--r--ddl/out/java/LambdaCube/IR/RenderTarget.java22
-rw-r--r--ddl/out/java/LambdaCube/IR/SamplerDescriptor.java31
-rw-r--r--ddl/out/java/LambdaCube/IR/Slot.java26
-rw-r--r--ddl/out/java/LambdaCube/IR/StencilOperation.java25
-rw-r--r--ddl/out/java/LambdaCube/IR/StencilOps.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/StencilTest.java24
-rw-r--r--ddl/out/java/LambdaCube/IR/StencilTests.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/StreamData.java25
-rw-r--r--ddl/out/java/LambdaCube/IR/TargetItem.java23
-rw-r--r--ddl/out/java/LambdaCube/IR/TextureDataType.java33
-rw-r--r--ddl/out/java/LambdaCube/IR/TextureDescriptor.java27
-rw-r--r--ddl/out/java/LambdaCube/IR/TextureType.java57
-rw-r--r--ddl/out/java/LambdaCube/IR/Value.java142
-rw-r--r--ddl/out/java/LambdaCube/Mesh/JSON.java206
-rw-r--r--ddl/out/java/LambdaCube/Mesh/Mesh.java23
-rw-r--r--ddl/out/java/LambdaCube/Mesh/MeshAttribute.java62
-rw-r--r--ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java30
-rw-r--r--ddl/out/java/LambdaCube/PipelineSchema/JSON.java122
-rw-r--r--ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java24
-rw-r--r--ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java24
-rw-r--r--ddl/out/java/LambdaCube/PipelineSchema/StreamType.java39
-rw-r--r--ddl/out/java/LambdaCube/TypeInfo/CompileResult.java32
-rw-r--r--ddl/out/java/LambdaCube/TypeInfo/JSON.java85
-rw-r--r--ddl/out/java/LambdaCube/TypeInfo/Range.java26
-rw-r--r--ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java24
-rw-r--r--ddl/out/java/TestData/ClientInfo.java26
-rw-r--r--ddl/out/java/TestData/Frame.java27
-rw-r--r--ddl/out/java/TestData/FrameResult.java27
-rw-r--r--ddl/out/java/TestData/JSON.java193
-rw-r--r--ddl/out/java/TestData/PipelineInfo.java26
-rw-r--r--ddl/out/java/TestData/RenderJob.java29
-rw-r--r--ddl/out/java/TestData/RenderJobResult.java30
-rw-r--r--ddl/out/java/TestData/Scene.java28
105 files changed, 11257 insertions, 0 deletions
diff --git a/ddl/out/LambdaCube.IR.cpp b/ddl/out/LambdaCube.IR.cpp
index 75a26eb..fcbcebb 100644
--- a/ddl/out/LambdaCube.IR.cpp
+++ b/ddl/out/LambdaCube.IR.cpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.426854000000Z 3// 2016-03-01T13:00:40.426854000000Z
4=======
5// 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4#include "LambdaCube.IR.hpp" 8#include "LambdaCube.IR.hpp"
5template<> json toJSON<std::shared_ptr<ArrayValue>>(std::shared_ptr<ArrayValue> &v) { 9template<> json toJSON<std::shared_ptr<ArrayValue>>(std::shared_ptr<ArrayValue> &v) {
diff --git a/ddl/out/LambdaCube.IR.cs b/ddl/out/LambdaCube.IR.cs
new file mode 100644
index 0000000..3c603ca
--- /dev/null
+++ b/ddl/out/LambdaCube.IR.cs
@@ -0,0 +1,4444 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9
10namespace LambdaCube.IR {
11 class ArrayValue {
12 public enum Tag {
13 VBoolArray,
14 VIntArray,
15 VWordArray,
16 VFloatArray
17 };
18 public Tag tag;
19 };
20
21 namespace data {
22 class VBoolArray : LambdaCube.IR.ArrayValue {
23 public List<bool> _0;
24 public VBoolArray() { tag = LambdaCube.IR.ArrayValue.Tag.VBoolArray; }
25 };
26 class VIntArray : LambdaCube.IR.ArrayValue {
27 public List<int> _0;
28 public VIntArray() { tag = LambdaCube.IR.ArrayValue.Tag.VIntArray; }
29 };
30 class VWordArray : LambdaCube.IR.ArrayValue {
31 public List<uint> _0;
32 public VWordArray() { tag = LambdaCube.IR.ArrayValue.Tag.VWordArray; }
33 };
34 class VFloatArray : LambdaCube.IR.ArrayValue {
35 public List<float> _0;
36 public VFloatArray() { tag = LambdaCube.IR.ArrayValue.Tag.VFloatArray; }
37 };
38 }
39 class Value {
40 public enum Tag {
41 VBool,
42 VV2B,
43 VV3B,
44 VV4B,
45 VWord,
46 VV2U,
47 VV3U,
48 VV4U,
49 VInt,
50 VV2I,
51 VV3I,
52 VV4I,
53 VFloat,
54 VV2F,
55 VV3F,
56 VV4F,
57 VM22F,
58 VM23F,
59 VM24F,
60 VM32F,
61 VM33F,
62 VM34F,
63 VM42F,
64 VM43F,
65 VM44F
66 };
67 public Tag tag;
68 };
69
70 namespace data {
71 class VBool : LambdaCube.IR.Value {
72 public bool _0;
73 public VBool() { tag = LambdaCube.IR.Value.Tag.VBool; }
74 };
75 class VV2B : LambdaCube.IR.Value {
76 public V2<bool> _0;
77 public VV2B() { tag = LambdaCube.IR.Value.Tag.VV2B; }
78 };
79 class VV3B : LambdaCube.IR.Value {
80 public V3<bool> _0;
81 public VV3B() { tag = LambdaCube.IR.Value.Tag.VV3B; }
82 };
83 class VV4B : LambdaCube.IR.Value {
84 public V4<bool> _0;
85 public VV4B() { tag = LambdaCube.IR.Value.Tag.VV4B; }
86 };
87 class VWord : LambdaCube.IR.Value {
88 public uint _0;
89 public VWord() { tag = LambdaCube.IR.Value.Tag.VWord; }
90 };
91 class VV2U : LambdaCube.IR.Value {
92 public V2<uint> _0;
93 public VV2U() { tag = LambdaCube.IR.Value.Tag.VV2U; }
94 };
95 class VV3U : LambdaCube.IR.Value {
96 public V3<uint> _0;
97 public VV3U() { tag = LambdaCube.IR.Value.Tag.VV3U; }
98 };
99 class VV4U : LambdaCube.IR.Value {
100 public V4<uint> _0;
101 public VV4U() { tag = LambdaCube.IR.Value.Tag.VV4U; }
102 };
103 class VInt : LambdaCube.IR.Value {
104 public int _0;
105 public VInt() { tag = LambdaCube.IR.Value.Tag.VInt; }
106 };
107 class VV2I : LambdaCube.IR.Value {
108 public V2<int> _0;
109 public VV2I() { tag = LambdaCube.IR.Value.Tag.VV2I; }
110 };
111 class VV3I : LambdaCube.IR.Value {
112 public V3<int> _0;
113 public VV3I() { tag = LambdaCube.IR.Value.Tag.VV3I; }
114 };
115 class VV4I : LambdaCube.IR.Value {
116 public V4<int> _0;
117 public VV4I() { tag = LambdaCube.IR.Value.Tag.VV4I; }
118 };
119 class VFloat : LambdaCube.IR.Value {
120 public float _0;
121 public VFloat() { tag = LambdaCube.IR.Value.Tag.VFloat; }
122 };
123 class VV2F : LambdaCube.IR.Value {
124 public V2<float> _0;
125 public VV2F() { tag = LambdaCube.IR.Value.Tag.VV2F; }
126 };
127 class VV3F : LambdaCube.IR.Value {
128 public V3<float> _0;
129 public VV3F() { tag = LambdaCube.IR.Value.Tag.VV3F; }
130 };
131 class VV4F : LambdaCube.IR.Value {
132 public V4<float> _0;
133 public VV4F() { tag = LambdaCube.IR.Value.Tag.VV4F; }
134 };
135 class VM22F : LambdaCube.IR.Value {
136 public V2<V2<float>> _0;
137 public VM22F() { tag = LambdaCube.IR.Value.Tag.VM22F; }
138 };
139 class VM23F : LambdaCube.IR.Value {
140 public V3<V2<float>> _0;
141 public VM23F() { tag = LambdaCube.IR.Value.Tag.VM23F; }
142 };
143 class VM24F : LambdaCube.IR.Value {
144 public V4<V2<float>> _0;
145 public VM24F() { tag = LambdaCube.IR.Value.Tag.VM24F; }
146 };
147 class VM32F : LambdaCube.IR.Value {
148 public V2<V3<float>> _0;
149 public VM32F() { tag = LambdaCube.IR.Value.Tag.VM32F; }
150 };
151 class VM33F : LambdaCube.IR.Value {
152 public V3<V3<float>> _0;
153 public VM33F() { tag = LambdaCube.IR.Value.Tag.VM33F; }
154 };
155 class VM34F : LambdaCube.IR.Value {
156 public V4<V3<float>> _0;
157 public VM34F() { tag = LambdaCube.IR.Value.Tag.VM34F; }
158 };
159 class VM42F : LambdaCube.IR.Value {
160 public V2<V4<float>> _0;
161 public VM42F() { tag = LambdaCube.IR.Value.Tag.VM42F; }
162 };
163 class VM43F : LambdaCube.IR.Value {
164 public V3<V4<float>> _0;
165 public VM43F() { tag = LambdaCube.IR.Value.Tag.VM43F; }
166 };
167 class VM44F : LambdaCube.IR.Value {
168 public V4<V4<float>> _0;
169 public VM44F() { tag = LambdaCube.IR.Value.Tag.VM44F; }
170 };
171 }
172 class InputType {
173 public enum Tag {
174 Bool,
175 V2B,
176 V3B,
177 V4B,
178 Word,
179 V2U,
180 V3U,
181 V4U,
182 Int,
183 V2I,
184 V3I,
185 V4I,
186 Float,
187 V2F,
188 V3F,
189 V4F,
190 M22F,
191 M23F,
192 M24F,
193 M32F,
194 M33F,
195 M34F,
196 M42F,
197 M43F,
198 M44F,
199 STexture1D,
200 STexture2D,
201 STextureCube,
202 STexture1DArray,
203 STexture2DArray,
204 STexture2DRect,
205 FTexture1D,
206 FTexture2D,
207 FTexture3D,
208 FTextureCube,
209 FTexture1DArray,
210 FTexture2DArray,
211 FTexture2DMS,
212 FTexture2DMSArray,
213 FTextureBuffer,
214 FTexture2DRect,
215 ITexture1D,
216 ITexture2D,
217 ITexture3D,
218 ITextureCube,
219 ITexture1DArray,
220 ITexture2DArray,
221 ITexture2DMS,
222 ITexture2DMSArray,
223 ITextureBuffer,
224 ITexture2DRect,
225 UTexture1D,
226 UTexture2D,
227 UTexture3D,
228 UTextureCube,
229 UTexture1DArray,
230 UTexture2DArray,
231 UTexture2DMS,
232 UTexture2DMSArray,
233 UTextureBuffer,
234 UTexture2DRect
235 };
236 public Tag tag;
237 };
238
239 namespace data {
240 }
241 class PointSpriteCoordOrigin {
242 public enum Tag {
243 LowerLeft,
244 UpperLeft
245 };
246 public Tag tag;
247 };
248
249 namespace data {
250 }
251 class PointSize {
252 public enum Tag {
253 PointSize,
254 ProgramPointSize
255 };
256 public Tag tag;
257 };
258
259 namespace data {
260 class PointSize : LambdaCube.IR.PointSize {
261 public float _0;
262 public PointSize() { tag = LambdaCube.IR.PointSize.Tag.PointSize; }
263 };
264 }
265 class PolygonOffset {
266 public enum Tag {
267 NoOffset,
268 Offset
269 };
270 public Tag tag;
271 };
272
273 namespace data {
274 class Offset : LambdaCube.IR.PolygonOffset {
275 public float _0;
276 public float _1;
277 public Offset() { tag = LambdaCube.IR.PolygonOffset.Tag.Offset; }
278 };
279 }
280 class FrontFace {
281 public enum Tag {
282 CCW,
283 CW
284 };
285 public Tag tag;
286 };
287
288 namespace data {
289 }
290 class PolygonMode {
291 public enum Tag {
292 PolygonPoint,
293 PolygonLine,
294 PolygonFill
295 };
296 public Tag tag;
297 };
298
299 namespace data {
300 class PolygonPoint : LambdaCube.IR.PolygonMode {
301 public global::LambdaCube.IR.PointSize _0;
302 public PolygonPoint() { tag = LambdaCube.IR.PolygonMode.Tag.PolygonPoint; }
303 };
304 class PolygonLine : LambdaCube.IR.PolygonMode {
305 public float _0;
306 public PolygonLine() { tag = LambdaCube.IR.PolygonMode.Tag.PolygonLine; }
307 };
308 }
309 class ProvokingVertex {
310 public enum Tag {
311 FirstVertex,
312 LastVertex
313 };
314 public Tag tag;
315 };
316
317 namespace data {
318 }
319 class CullMode {
320 public enum Tag {
321 CullNone,
322 CullFront,
323 CullBack
324 };
325 public Tag tag;
326 };
327
328 namespace data {
329 class CullFront : LambdaCube.IR.CullMode {
330 public global::LambdaCube.IR.FrontFace _0;
331 public CullFront() { tag = LambdaCube.IR.CullMode.Tag.CullFront; }
332 };
333 class CullBack : LambdaCube.IR.CullMode {
334 public global::LambdaCube.IR.FrontFace _0;
335 public CullBack() { tag = LambdaCube.IR.CullMode.Tag.CullBack; }
336 };
337 }
338 class ComparisonFunction {
339 public enum Tag {
340 Never,
341 Less,
342 Equal,
343 Lequal,
344 Greater,
345 Notequal,
346 Gequal,
347 Always
348 };
349 public Tag tag;
350 };
351
352 namespace data {
353 }
354 class StencilOperation {
355 public enum Tag {
356 OpZero,
357 OpKeep,
358 OpReplace,
359 OpIncr,
360 OpIncrWrap,
361 OpDecr,
362 OpDecrWrap,
363 OpInvert
364 };
365 public Tag tag;
366 };
367
368 namespace data {
369 }
370 class BlendEquation {
371 public enum Tag {
372 FuncAdd,
373 FuncSubtract,
374 FuncReverseSubtract,
375 Min,
376 Max
377 };
378 public Tag tag;
379 };
380
381 namespace data {
382 }
383 class BlendingFactor {
384 public enum Tag {
385 Zero,
386 One,
387 SrcColor,
388 OneMinusSrcColor,
389 DstColor,
390 OneMinusDstColor,
391 SrcAlpha,
392 OneMinusSrcAlpha,
393 DstAlpha,
394 OneMinusDstAlpha,
395 ConstantColor,
396 OneMinusConstantColor,
397 ConstantAlpha,
398 OneMinusConstantAlpha,
399 SrcAlphaSaturate
400 };
401 public Tag tag;
402 };
403
404 namespace data {
405 }
406 class LogicOperation {
407 public enum Tag {
408 Clear,
409 And,
410 AndReverse,
411 Copy,
412 AndInverted,
413 Noop,
414 Xor,
415 Or,
416 Nor,
417 Equiv,
418 Invert,
419 OrReverse,
420 CopyInverted,
421 OrInverted,
422 Nand,
423 Set
424 };
425 public Tag tag;
426 };
427
428 namespace data {
429 }
430 class StencilOps {
431 public enum Tag {
432 StencilOps
433 };
434 public Tag tag;
435 };
436
437 namespace data {
438 class StencilOps : LambdaCube.IR.StencilOps {
439 public global::LambdaCube.IR.StencilOperation frontStencilOp;
440 public global::LambdaCube.IR.StencilOperation backStencilOp;
441 public StencilOps() { tag = LambdaCube.IR.StencilOps.Tag.StencilOps; }
442 };
443 }
444 class StencilTest {
445 public enum Tag {
446 StencilTest
447 };
448 public Tag tag;
449 };
450
451 namespace data {
452 class StencilTest : LambdaCube.IR.StencilTest {
453 public global::LambdaCube.IR.ComparisonFunction stencilComparision;
454 public int stencilReference;
455 public uint stencilMask;
456 public StencilTest() { tag = LambdaCube.IR.StencilTest.Tag.StencilTest; }
457 };
458 }
459 class StencilTests {
460 public enum Tag {
461 StencilTests
462 };
463 public Tag tag;
464 };
465
466 namespace data {
467 class StencilTests : LambdaCube.IR.StencilTests {
468 public global::LambdaCube.IR.StencilTest _0;
469 public global::LambdaCube.IR.StencilTest _1;
470 public StencilTests() { tag = LambdaCube.IR.StencilTests.Tag.StencilTests; }
471 };
472 }
473 class FetchPrimitive {
474 public enum Tag {
475 Points,
476 Lines,
477 Triangles,
478 LinesAdjacency,
479 TrianglesAdjacency
480 };
481 public Tag tag;
482 };
483
484 namespace data {
485 }
486 class OutputPrimitive {
487 public enum Tag {
488 TrianglesOutput,
489 LinesOutput,
490 PointsOutput
491 };
492 public Tag tag;
493 };
494
495 namespace data {
496 }
497 class ColorArity {
498 public enum Tag {
499 Red,
500 RG,
501 RGB,
502 RGBA
503 };
504 public Tag tag;
505 };
506
507 namespace data {
508 }
509 class Blending {
510 public enum Tag {
511 NoBlending,
512 BlendLogicOp,
513 Blend
514 };
515 public Tag tag;
516 };
517
518 namespace data {
519 class BlendLogicOp : LambdaCube.IR.Blending {
520 public global::LambdaCube.IR.LogicOperation _0;
521 public BlendLogicOp() { tag = LambdaCube.IR.Blending.Tag.BlendLogicOp; }
522 };
523 class Blend : LambdaCube.IR.Blending {
524 public global::LambdaCube.IR.BlendEquation colorEqSrc;
525 public global::LambdaCube.IR.BlendEquation alphaEqSrc;
526 public global::LambdaCube.IR.BlendingFactor colorFSrc;
527 public global::LambdaCube.IR.BlendingFactor colorFDst;
528 public global::LambdaCube.IR.BlendingFactor alphaFSrc;
529 public global::LambdaCube.IR.BlendingFactor alphaFDst;
530 public V4<float> color;
531 public Blend() { tag = LambdaCube.IR.Blending.Tag.Blend; }
532 };
533 }
534 class RasterContext {
535 public enum Tag {
536 PointCtx,
537 LineCtx,
538 TriangleCtx
539 };
540 public Tag tag;
541 };
542
543 namespace data {
544 class PointCtx : LambdaCube.IR.RasterContext {
545 public global::LambdaCube.IR.PointSize _0;
546 public float _1;
547 public global::LambdaCube.IR.PointSpriteCoordOrigin _2;
548 public PointCtx() { tag = LambdaCube.IR.RasterContext.Tag.PointCtx; }
549 };
550 class LineCtx : LambdaCube.IR.RasterContext {
551 public float _0;
552 public global::LambdaCube.IR.ProvokingVertex _1;
553 public LineCtx() { tag = LambdaCube.IR.RasterContext.Tag.LineCtx; }
554 };
555 class TriangleCtx : LambdaCube.IR.RasterContext {
556 public global::LambdaCube.IR.CullMode _0;
557 public global::LambdaCube.IR.PolygonMode _1;
558 public global::LambdaCube.IR.PolygonOffset _2;
559 public global::LambdaCube.IR.ProvokingVertex _3;
560 public TriangleCtx() { tag = LambdaCube.IR.RasterContext.Tag.TriangleCtx; }
561 };
562 }
563 class FragmentOperation {
564 public enum Tag {
565 DepthOp,
566 StencilOp,
567 ColorOp
568 };
569 public Tag tag;
570 };
571
572 namespace data {
573 class DepthOp : LambdaCube.IR.FragmentOperation {
574 public global::LambdaCube.IR.ComparisonFunction _0;
575 public bool _1;
576 public DepthOp() { tag = LambdaCube.IR.FragmentOperation.Tag.DepthOp; }
577 };
578 class StencilOp : LambdaCube.IR.FragmentOperation {
579 public global::LambdaCube.IR.StencilTests _0;
580 public global::LambdaCube.IR.StencilOps _1;
581 public global::LambdaCube.IR.StencilOps _2;
582 public StencilOp() { tag = LambdaCube.IR.FragmentOperation.Tag.StencilOp; }
583 };
584 class ColorOp : LambdaCube.IR.FragmentOperation {
585 public global::LambdaCube.IR.Blending _0;
586 public global::LambdaCube.IR.Value _1;
587 public ColorOp() { tag = LambdaCube.IR.FragmentOperation.Tag.ColorOp; }
588 };
589 }
590 class AccumulationContext {
591 public enum Tag {
592 AccumulationContext
593 };
594 public Tag tag;
595 };
596
597 namespace data {
598 class AccumulationContext : LambdaCube.IR.AccumulationContext {
599 public Maybe<string> accViewportName;
600 public List<global::LambdaCube.IR.FragmentOperation> accOperations;
601 public AccumulationContext() { tag = LambdaCube.IR.AccumulationContext.Tag.AccumulationContext; }
602 };
603 }
604 class TextureDataType {
605 public enum Tag {
606 FloatT,
607 IntT,
608 WordT,
609 ShadowT
610 };
611 public Tag tag;
612 };
613
614 namespace data {
615 class FloatT : LambdaCube.IR.TextureDataType {
616 public global::LambdaCube.IR.ColorArity _0;
617 public FloatT() { tag = LambdaCube.IR.TextureDataType.Tag.FloatT; }
618 };
619 class IntT : LambdaCube.IR.TextureDataType {
620 public global::LambdaCube.IR.ColorArity _0;
621 public IntT() { tag = LambdaCube.IR.TextureDataType.Tag.IntT; }
622 };
623 class WordT : LambdaCube.IR.TextureDataType {
624 public global::LambdaCube.IR.ColorArity _0;
625 public WordT() { tag = LambdaCube.IR.TextureDataType.Tag.WordT; }
626 };
627 }
628 class TextureType {
629 public enum Tag {
630 Texture1D,
631 Texture2D,
632 Texture3D,
633 TextureCube,
634 TextureRect,
635 Texture2DMS,
636 TextureBuffer
637 };
638 public Tag tag;
639 };
640
641 namespace data {
642 class Texture1D : LambdaCube.IR.TextureType {
643 public global::LambdaCube.IR.TextureDataType _0;
644 public int _1;
645 public Texture1D() { tag = LambdaCube.IR.TextureType.Tag.Texture1D; }
646 };
647 class Texture2D : LambdaCube.IR.TextureType {
648 public global::LambdaCube.IR.TextureDataType _0;
649 public int _1;
650 public Texture2D() { tag = LambdaCube.IR.TextureType.Tag.Texture2D; }
651 };
652 class Texture3D : LambdaCube.IR.TextureType {
653 public global::LambdaCube.IR.TextureDataType _0;
654 public Texture3D() { tag = LambdaCube.IR.TextureType.Tag.Texture3D; }
655 };
656 class TextureCube : LambdaCube.IR.TextureType {
657 public global::LambdaCube.IR.TextureDataType _0;
658 public TextureCube() { tag = LambdaCube.IR.TextureType.Tag.TextureCube; }
659 };
660 class TextureRect : LambdaCube.IR.TextureType {
661 public global::LambdaCube.IR.TextureDataType _0;
662 public TextureRect() { tag = LambdaCube.IR.TextureType.Tag.TextureRect; }
663 };
664 class Texture2DMS : LambdaCube.IR.TextureType {
665 public global::LambdaCube.IR.TextureDataType _0;
666 public int _1;
667 public int _2;
668 public bool _3;
669 public Texture2DMS() { tag = LambdaCube.IR.TextureType.Tag.Texture2DMS; }
670 };
671 class TextureBuffer : LambdaCube.IR.TextureType {
672 public global::LambdaCube.IR.TextureDataType _0;
673 public TextureBuffer() { tag = LambdaCube.IR.TextureType.Tag.TextureBuffer; }
674 };
675 }
676 class MipMap {
677 public enum Tag {
678 Mip,
679 NoMip,
680 AutoMip
681 };
682 public Tag tag;
683 };
684
685 namespace data {
686 class Mip : LambdaCube.IR.MipMap {
687 public int _0;
688 public int _1;
689 public Mip() { tag = LambdaCube.IR.MipMap.Tag.Mip; }
690 };
691 class AutoMip : LambdaCube.IR.MipMap {
692 public int _0;
693 public int _1;
694 public AutoMip() { tag = LambdaCube.IR.MipMap.Tag.AutoMip; }
695 };
696 }
697 class Filter {
698 public enum Tag {
699 Nearest,
700 Linear,
701 NearestMipmapNearest,
702 NearestMipmapLinear,
703 LinearMipmapNearest,
704 LinearMipmapLinear
705 };
706 public Tag tag;
707 };
708
709 namespace data {
710 }
711 class EdgeMode {
712 public enum Tag {
713 Repeat,
714 MirroredRepeat,
715 ClampToEdge,
716 ClampToBorder
717 };
718 public Tag tag;
719 };
720
721 namespace data {
722 }
723 class ImageSemantic {
724 public enum Tag {
725 Depth,
726 Stencil,
727 Color
728 };
729 public Tag tag;
730 };
731
732 namespace data {
733 }
734 class ImageRef {
735 public enum Tag {
736 TextureImage,
737 Framebuffer
738 };
739 public Tag tag;
740 };
741
742 namespace data {
743 class TextureImage : LambdaCube.IR.ImageRef {
744 public int _0;
745 public int _1;
746 public Maybe<int> _2;
747 public TextureImage() { tag = LambdaCube.IR.ImageRef.Tag.TextureImage; }
748 };
749 class Framebuffer : LambdaCube.IR.ImageRef {
750 public global::LambdaCube.IR.ImageSemantic _0;
751 public Framebuffer() { tag = LambdaCube.IR.ImageRef.Tag.Framebuffer; }
752 };
753 }
754 class ClearImage {
755 public enum Tag {
756 ClearImage
757 };
758 public Tag tag;
759 };
760
761 namespace data {
762 class ClearImage : LambdaCube.IR.ClearImage {
763 public global::LambdaCube.IR.ImageSemantic imageSemantic;
764 public global::LambdaCube.IR.Value clearValue;
765 public ClearImage() { tag = LambdaCube.IR.ClearImage.Tag.ClearImage; }
766 };
767 }
768 class Command {
769 public enum Tag {
770 SetRasterContext,
771 SetAccumulationContext,
772 SetRenderTarget,
773 SetProgram,
774 SetSamplerUniform,
775 SetTexture,
776 SetSampler,
777 RenderSlot,
778 RenderStream,
779 ClearRenderTarget,
780 GenerateMipMap,
781 SaveImage,
782 LoadImage
783 };
784 public Tag tag;
785 };
786
787 namespace data {
788 class SetRasterContext : LambdaCube.IR.Command {
789 public global::LambdaCube.IR.RasterContext _0;
790 public SetRasterContext() { tag = LambdaCube.IR.Command.Tag.SetRasterContext; }
791 };
792 class SetAccumulationContext : LambdaCube.IR.Command {
793 public global::LambdaCube.IR.AccumulationContext _0;
794 public SetAccumulationContext() { tag = LambdaCube.IR.Command.Tag.SetAccumulationContext; }
795 };
796 class SetRenderTarget : LambdaCube.IR.Command {
797 public int _0;
798 public SetRenderTarget() { tag = LambdaCube.IR.Command.Tag.SetRenderTarget; }
799 };
800 class SetProgram : LambdaCube.IR.Command {
801 public int _0;
802 public SetProgram() { tag = LambdaCube.IR.Command.Tag.SetProgram; }
803 };
804 class SetSamplerUniform : LambdaCube.IR.Command {
805 public string _0;
806 public int _1;
807 public SetSamplerUniform() { tag = LambdaCube.IR.Command.Tag.SetSamplerUniform; }
808 };
809 class SetTexture : LambdaCube.IR.Command {
810 public int _0;
811 public int _1;
812 public SetTexture() { tag = LambdaCube.IR.Command.Tag.SetTexture; }
813 };
814 class SetSampler : LambdaCube.IR.Command {
815 public int _0;
816 public Maybe<int> _1;
817 public SetSampler() { tag = LambdaCube.IR.Command.Tag.SetSampler; }
818 };
819 class RenderSlot : LambdaCube.IR.Command {
820 public int _0;
821 public RenderSlot() { tag = LambdaCube.IR.Command.Tag.RenderSlot; }
822 };
823 class RenderStream : LambdaCube.IR.Command {
824 public int _0;
825 public RenderStream() { tag = LambdaCube.IR.Command.Tag.RenderStream; }
826 };
827 class ClearRenderTarget : LambdaCube.IR.Command {
828 public List<global::LambdaCube.IR.ClearImage> _0;
829 public ClearRenderTarget() { tag = LambdaCube.IR.Command.Tag.ClearRenderTarget; }
830 };
831 class GenerateMipMap : LambdaCube.IR.Command {
832 public int _0;
833 public GenerateMipMap() { tag = LambdaCube.IR.Command.Tag.GenerateMipMap; }
834 };
835 class SaveImage : LambdaCube.IR.Command {
836 public int _0;
837 public global::LambdaCube.IR.ImageRef _1;
838 public SaveImage() { tag = LambdaCube.IR.Command.Tag.SaveImage; }
839 };
840 class LoadImage : LambdaCube.IR.Command {
841 public global::LambdaCube.IR.ImageRef _0;
842 public int _1;
843 public LoadImage() { tag = LambdaCube.IR.Command.Tag.LoadImage; }
844 };
845 }
846 class SamplerDescriptor {
847 public enum Tag {
848 SamplerDescriptor
849 };
850 public Tag tag;
851 };
852
853 namespace data {
854 class SamplerDescriptor : LambdaCube.IR.SamplerDescriptor {
855 public global::LambdaCube.IR.EdgeMode samplerWrapS;
856 public Maybe<global::LambdaCube.IR.EdgeMode> samplerWrapT;
857 public Maybe<global::LambdaCube.IR.EdgeMode> samplerWrapR;
858 public global::LambdaCube.IR.Filter samplerMinFilter;
859 public global::LambdaCube.IR.Filter samplerMagFilter;
860 public global::LambdaCube.IR.Value samplerBorderColor;
861 public Maybe<float> samplerMinLod;
862 public Maybe<float> samplerMaxLod;
863 public float samplerLodBias;
864 public Maybe<global::LambdaCube.IR.ComparisonFunction> samplerCompareFunc;
865 public SamplerDescriptor() { tag = LambdaCube.IR.SamplerDescriptor.Tag.SamplerDescriptor; }
866 };
867 }
868 class TextureDescriptor {
869 public enum Tag {
870 TextureDescriptor
871 };
872 public Tag tag;
873 };
874
875 namespace data {
876 class TextureDescriptor : LambdaCube.IR.TextureDescriptor {
877 public global::LambdaCube.IR.TextureType textureType;
878 public global::LambdaCube.IR.Value textureSize;
879 public global::LambdaCube.IR.ImageSemantic textureSemantic;
880 public global::LambdaCube.IR.SamplerDescriptor textureSampler;
881 public int textureBaseLevel;
882 public int textureMaxLevel;
883 public TextureDescriptor() { tag = LambdaCube.IR.TextureDescriptor.Tag.TextureDescriptor; }
884 };
885 }
886 class Parameter {
887 public enum Tag {
888 Parameter
889 };
890 public Tag tag;
891 };
892
893 namespace data {
894 class Parameter : LambdaCube.IR.Parameter {
895 public string name;
896 public global::LambdaCube.IR.InputType ty;
897 public Parameter() { tag = LambdaCube.IR.Parameter.Tag.Parameter; }
898 };
899 }
900 class Program {
901 public enum Tag {
902 Program
903 };
904 public Tag tag;
905 };
906
907 namespace data {
908 class Program : LambdaCube.IR.Program {
909 public Dictionary<string, global::LambdaCube.IR.InputType> programUniforms;
910 public Dictionary<string, global::LambdaCube.IR.Parameter> programStreams;
911 public Dictionary<string, global::LambdaCube.IR.InputType> programInTextures;
912 public List<global::LambdaCube.IR.Parameter> programOutput;
913 public string vertexShader;
914 public Maybe<string> geometryShader;
915 public string fragmentShader;
916 public Program() { tag = LambdaCube.IR.Program.Tag.Program; }
917 };
918 }
919 class Slot {
920 public enum Tag {
921 Slot
922 };
923 public Tag tag;
924 };
925
926 namespace data {
927 class Slot : LambdaCube.IR.Slot {
928 public string slotName;
929 public Dictionary<string, global::LambdaCube.IR.InputType> slotStreams;
930 public Dictionary<string, global::LambdaCube.IR.InputType> slotUniforms;
931 public global::LambdaCube.IR.FetchPrimitive slotPrimitive;
932 public List<int> slotPrograms;
933 public Slot() { tag = LambdaCube.IR.Slot.Tag.Slot; }
934 };
935 }
936 class StreamData {
937 public enum Tag {
938 StreamData
939 };
940 public Tag tag;
941 };
942
943 namespace data {
944 class StreamData : LambdaCube.IR.StreamData {
945 public Dictionary<string, global::LambdaCube.IR.ArrayValue> streamData;
946 public Dictionary<string, global::LambdaCube.IR.InputType> streamType;
947 public global::LambdaCube.IR.FetchPrimitive streamPrimitive;
948 public List<int> streamPrograms;
949 public StreamData() { tag = LambdaCube.IR.StreamData.Tag.StreamData; }
950 };
951 }
952 class TargetItem {
953 public enum Tag {
954 TargetItem
955 };
956 public Tag tag;
957 };
958
959 namespace data {
960 class TargetItem : LambdaCube.IR.TargetItem {
961 public global::LambdaCube.IR.ImageSemantic targetSemantic;
962 public Maybe<global::LambdaCube.IR.ImageRef> targetRef;
963 public TargetItem() { tag = LambdaCube.IR.TargetItem.Tag.TargetItem; }
964 };
965 }
966 class RenderTarget {
967 public enum Tag {
968 RenderTarget
969 };
970 public Tag tag;
971 };
972
973 namespace data {
974 class RenderTarget : LambdaCube.IR.RenderTarget {
975 public List<global::LambdaCube.IR.TargetItem> renderTargets;
976 public RenderTarget() { tag = LambdaCube.IR.RenderTarget.Tag.RenderTarget; }
977 };
978 }
979 class Backend {
980 public enum Tag {
981 WebGL1,
982 OpenGL33
983 };
984 public Tag tag;
985 };
986
987 namespace data {
988 }
989 class Pipeline {
990 public enum Tag {
991 Pipeline
992 };
993 public Tag tag;
994 };
995
996 namespace data {
997 class Pipeline : LambdaCube.IR.Pipeline {
998 public string info;
999 public global::LambdaCube.IR.Backend backend;
1000 public List<global::LambdaCube.IR.TextureDescriptor> textures;
1001 public List<global::LambdaCube.IR.SamplerDescriptor> samplers;
1002 public List<global::LambdaCube.IR.RenderTarget> targets;
1003 public List<global::LambdaCube.IR.Program> programs;
1004 public List<global::LambdaCube.IR.Slot> slots;
1005 public List<global::LambdaCube.IR.StreamData> streams;
1006 public List<global::LambdaCube.IR.Command> commands;
1007 public Pipeline() { tag = LambdaCube.IR.Pipeline.Tag.Pipeline; }
1008 };
1009 }
1010
1011 // JSON deserializer
1012 enum Type {
1013 Int,
1014 Int32,
1015 Word,
1016 Word32,
1017 Float,
1018 Bool,
1019 String,
1020 V2_Int,
1021 V2_Word,
1022 V2_Float,
1023 V2_Bool,
1024 V2_V2_Float,
1025 V2_V3_Float,
1026 V2_V4_Float,
1027 V3_Int,
1028 V3_Word,
1029 V3_Float,
1030 V3_Bool,
1031 V3_V2_Float,
1032 V3_V3_Float,
1033 V3_V4_Float,
1034 V4_Int,
1035 V4_Word,
1036 V4_Float,
1037 V4_Bool,
1038 V4_V2_Float,
1039 V4_V3_Float,
1040 V4_V4_Float,
1041 Array_Int,
1042 Array_Int32,
1043 Array_Word32,
1044 Array_Float,
1045 Array_Bool,
1046 Array_ClearImage,
1047 Array_Command,
1048 Array_Parameter,
1049 Array_Program,
1050 Array_RenderTarget,
1051 Array_SamplerDescriptor,
1052 Array_Slot,
1053 Array_StreamData,
1054 Array_TargetItem,
1055 Array_TextureDescriptor,
1056 List_FragmentOperation,
1057 Maybe_Int,
1058 Maybe_Float,
1059 Maybe_String,
1060 Maybe_ComparisonFunction,
1061 Maybe_EdgeMode,
1062 Maybe_ImageRef,
1063 Map_String_ArrayValue,
1064 Map_String_InputType,
1065 Map_String_Parameter,
1066 AccumulationContext,
1067 ArrayValue,
1068 Backend,
1069 BlendEquation,
1070 Blending,
1071 BlendingFactor,
1072 ClearImage,
1073 ColorArity,
1074 Command,
1075 ComparisonFunction,
1076 CullMode,
1077 EdgeMode,
1078 FetchPrimitive,
1079 Filter,
1080 FragmentOperation,
1081 FrontFace,
1082 ImageRef,
1083 ImageSemantic,
1084 InputType,
1085 LogicOperation,
1086 MipMap,
1087 OutputPrimitive,
1088 Parameter,
1089 Pipeline,
1090 PointSize,
1091 PointSpriteCoordOrigin,
1092 PolygonMode,
1093 PolygonOffset,
1094 Program,
1095 ProvokingVertex,
1096 RasterContext,
1097 RenderTarget,
1098 SamplerDescriptor,
1099 Slot,
1100 StencilOperation,
1101 StencilOps,
1102 StencilTest,
1103 StencilTests,
1104 StreamData,
1105 TargetItem,
1106 TextureDataType,
1107 TextureDescriptor,
1108 TextureType,
1109 Value
1110 }
1111
1112 class Loader {
1113 public static object fromJSON(Type type, JToken obj) {
1114 switch (type) {
1115 case Type.Int: return (int)obj;
1116 case Type.Int32: return (int)obj;
1117 case Type.Word: return (uint)obj;
1118 case Type.Word32: return (uint)obj;
1119 case Type.Float: return (float)obj;
1120 case Type.Bool: return (bool)obj;
1121 case Type.String: return (string)obj;
1122 case Type.V2_Int:
1123 return new V2<int>
1124 { x = (int)fromJSON(Type.Int,obj["x"])
1125 , y = (int)fromJSON(Type.Int,obj["y"])
1126 };
1127 case Type.V2_Word:
1128 return new V2<uint>
1129 { x = (uint)fromJSON(Type.Word,obj["x"])
1130 , y = (uint)fromJSON(Type.Word,obj["y"])
1131 };
1132 case Type.V2_Float:
1133 return new V2<float>
1134 { x = (float)fromJSON(Type.Float,obj["x"])
1135 , y = (float)fromJSON(Type.Float,obj["y"])
1136 };
1137 case Type.V2_Bool:
1138 return new V2<bool>
1139 { x = (bool)fromJSON(Type.Bool,obj["x"])
1140 , y = (bool)fromJSON(Type.Bool,obj["y"])
1141 };
1142 case Type.V2_V2_Float:
1143 return new V2<V2<float>>
1144 { x = (V2<float>)fromJSON(Type.V2_Float,obj["x"])
1145 , y = (V2<float>)fromJSON(Type.V2_Float,obj["y"])
1146 };
1147 case Type.V2_V3_Float:
1148 return new V2<V3<float>>
1149 { x = (V3<float>)fromJSON(Type.V3_Float,obj["x"])
1150 , y = (V3<float>)fromJSON(Type.V3_Float,obj["y"])
1151 };
1152 case Type.V2_V4_Float:
1153 return new V2<V4<float>>
1154 { x = (V4<float>)fromJSON(Type.V4_Float,obj["x"])
1155 , y = (V4<float>)fromJSON(Type.V4_Float,obj["y"])
1156 };
1157 case Type.V3_Int:
1158 return new V3<int>
1159 { x = (int)fromJSON(Type.Int,obj["x"])
1160 , y = (int)fromJSON(Type.Int,obj["y"])
1161 , z = (int)fromJSON(Type.Int,obj["z"])
1162 };
1163 case Type.V3_Word:
1164 return new V3<uint>
1165 { x = (uint)fromJSON(Type.Word,obj["x"])
1166 , y = (uint)fromJSON(Type.Word,obj["y"])
1167 , z = (uint)fromJSON(Type.Word,obj["z"])
1168 };
1169 case Type.V3_Float:
1170 return new V3<float>
1171 { x = (float)fromJSON(Type.Float,obj["x"])
1172 , y = (float)fromJSON(Type.Float,obj["y"])
1173 , z = (float)fromJSON(Type.Float,obj["z"])
1174 };
1175 case Type.V3_Bool:
1176 return new V3<bool>
1177 { x = (bool)fromJSON(Type.Bool,obj["x"])
1178 , y = (bool)fromJSON(Type.Bool,obj["y"])
1179 , z = (bool)fromJSON(Type.Bool,obj["z"])
1180 };
1181 case Type.V3_V2_Float:
1182 return new V3<V2<float>>
1183 { x = (V2<float>)fromJSON(Type.V2_Float,obj["x"])
1184 , y = (V2<float>)fromJSON(Type.V2_Float,obj["y"])
1185 , z = (V2<float>)fromJSON(Type.V2_Float,obj["z"])
1186 };
1187 case Type.V3_V3_Float:
1188 return new V3<V3<float>>
1189 { x = (V3<float>)fromJSON(Type.V3_Float,obj["x"])
1190 , y = (V3<float>)fromJSON(Type.V3_Float,obj["y"])
1191 , z = (V3<float>)fromJSON(Type.V3_Float,obj["z"])
1192 };
1193 case Type.V3_V4_Float:
1194 return new V3<V4<float>>
1195 { x = (V4<float>)fromJSON(Type.V4_Float,obj["x"])
1196 , y = (V4<float>)fromJSON(Type.V4_Float,obj["y"])
1197 , z = (V4<float>)fromJSON(Type.V4_Float,obj["z"])
1198 };
1199 case Type.V4_Int:
1200 return new V4<int>
1201 { x = (int)fromJSON(Type.Int,obj["x"])
1202 , y = (int)fromJSON(Type.Int,obj["y"])
1203 , z = (int)fromJSON(Type.Int,obj["z"])
1204 , w = (int)fromJSON(Type.Int,obj["w"])
1205 };
1206 case Type.V4_Word:
1207 return new V4<uint>
1208 { x = (uint)fromJSON(Type.Word,obj["x"])
1209 , y = (uint)fromJSON(Type.Word,obj["y"])
1210 , z = (uint)fromJSON(Type.Word,obj["z"])
1211 , w = (uint)fromJSON(Type.Word,obj["w"])
1212 };
1213 case Type.V4_Float:
1214 return new V4<float>
1215 { x = (float)fromJSON(Type.Float,obj["x"])
1216 , y = (float)fromJSON(Type.Float,obj["y"])
1217 , z = (float)fromJSON(Type.Float,obj["z"])
1218 , w = (float)fromJSON(Type.Float,obj["w"])
1219 };
1220 case Type.V4_Bool:
1221 return new V4<bool>
1222 { x = (bool)fromJSON(Type.Bool,obj["x"])
1223 , y = (bool)fromJSON(Type.Bool,obj["y"])
1224 , z = (bool)fromJSON(Type.Bool,obj["z"])
1225 , w = (bool)fromJSON(Type.Bool,obj["w"])
1226 };
1227 case Type.V4_V2_Float:
1228 return new V4<V2<float>>
1229 { x = (V2<float>)fromJSON(Type.V2_Float,obj["x"])
1230 , y = (V2<float>)fromJSON(Type.V2_Float,obj["y"])
1231 , z = (V2<float>)fromJSON(Type.V2_Float,obj["z"])
1232 , w = (V2<float>)fromJSON(Type.V2_Float,obj["w"])
1233 };
1234 case Type.V4_V3_Float:
1235 return new V4<V3<float>>
1236 { x = (V3<float>)fromJSON(Type.V3_Float,obj["x"])
1237 , y = (V3<float>)fromJSON(Type.V3_Float,obj["y"])
1238 , z = (V3<float>)fromJSON(Type.V3_Float,obj["z"])
1239 , w = (V3<float>)fromJSON(Type.V3_Float,obj["w"])
1240 };
1241 case Type.V4_V4_Float:
1242 return new V4<V4<float>>
1243 { x = (V4<float>)fromJSON(Type.V4_Float,obj["x"])
1244 , y = (V4<float>)fromJSON(Type.V4_Float,obj["y"])
1245 , z = (V4<float>)fromJSON(Type.V4_Float,obj["z"])
1246 , w = (V4<float>)fromJSON(Type.V4_Float,obj["w"])
1247 };
1248 case Type.Array_Int: return ((JArray)obj).Select(x => fromJSON (Type.Int, x)).ToList();
1249 case Type.Array_Int32: return ((JArray)obj).Select(x => fromJSON (Type.Int32, x)).ToList();
1250 case Type.Array_Word32: return ((JArray)obj).Select(x => fromJSON (Type.Word32, x)).ToList();
1251 case Type.Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
1252 case Type.Array_Bool: return ((JArray)obj).Select(x => fromJSON (Type.Bool, x)).ToList();
1253 case Type.Array_ClearImage: return ((JArray)obj).Select(x => fromJSON (Type.ClearImage, x)).ToList();
1254 case Type.Array_Command: return ((JArray)obj).Select(x => fromJSON (Type.Command, x)).ToList();
1255 case Type.Array_Parameter: return ((JArray)obj).Select(x => fromJSON (Type.Parameter, x)).ToList();
1256 case Type.Array_Program: return ((JArray)obj).Select(x => fromJSON (Type.Program, x)).ToList();
1257 case Type.Array_RenderTarget: return ((JArray)obj).Select(x => fromJSON (Type.RenderTarget, x)).ToList();
1258 case Type.Array_SamplerDescriptor: return ((JArray)obj).Select(x => fromJSON (Type.SamplerDescriptor, x)).ToList();
1259 case Type.Array_Slot: return ((JArray)obj).Select(x => fromJSON (Type.Slot, x)).ToList();
1260 case Type.Array_StreamData: return ((JArray)obj).Select(x => fromJSON (Type.StreamData, x)).ToList();
1261 case Type.Array_TargetItem: return ((JArray)obj).Select(x => fromJSON (Type.TargetItem, x)).ToList();
1262 case Type.Array_TextureDescriptor: return ((JArray)obj).Select(x => fromJSON (Type.TextureDescriptor, x)).ToList();
1263 case Type.List_FragmentOperation: return ((JArray)obj).Select(x => fromJSON (Type.FragmentOperation, x)).ToList();
1264 case Type.Maybe_Int: {
1265 var m = new Maybe<int> ();
1266 if (obj == null || obj.Type == JTokenType.Null) {
1267 m.valid = false;
1268 } else {
1269 m.valid = true;
1270 m.data = (int)fromJSON (Type.Int,obj);
1271 }
1272 return m;
1273 }
1274 case Type.Maybe_Float: {
1275 var m = new Maybe<float> ();
1276 if (obj == null || obj.Type == JTokenType.Null) {
1277 m.valid = false;
1278 } else {
1279 m.valid = true;
1280 m.data = (float)fromJSON (Type.Float,obj);
1281 }
1282 return m;
1283 }
1284 case Type.Maybe_String: {
1285 var m = new Maybe<string> ();
1286 if (obj == null || obj.Type == JTokenType.Null) {
1287 m.valid = false;
1288 } else {
1289 m.valid = true;
1290 m.data = (string)fromJSON (Type.String,obj);
1291 }
1292 return m;
1293 }
1294 case Type.Maybe_ComparisonFunction: {
1295 var m = new Maybe<global::LambdaCube.IR.ComparisonFunction> ();
1296 if (obj == null || obj.Type == JTokenType.Null) {
1297 m.valid = false;
1298 } else {
1299 m.valid = true;
1300 m.data = (global::LambdaCube.IR.ComparisonFunction)fromJSON (Type.ComparisonFunction,obj);
1301 }
1302 return m;
1303 }
1304 case Type.Maybe_EdgeMode: {
1305 var m = new Maybe<global::LambdaCube.IR.EdgeMode> ();
1306 if (obj == null || obj.Type == JTokenType.Null) {
1307 m.valid = false;
1308 } else {
1309 m.valid = true;
1310 m.data = (global::LambdaCube.IR.EdgeMode)fromJSON (Type.EdgeMode,obj);
1311 }
1312 return m;
1313 }
1314 case Type.Maybe_ImageRef: {
1315 var m = new Maybe<global::LambdaCube.IR.ImageRef> ();
1316 if (obj == null || obj.Type == JTokenType.Null) {
1317 m.valid = false;
1318 } else {
1319 m.valid = true;
1320 m.data = (global::LambdaCube.IR.ImageRef)fromJSON (Type.ImageRef,obj);
1321 }
1322 return m;
1323 }
1324 case Type.Map_String_ArrayValue: {
1325 var map = new Dictionary<string, global::LambdaCube.IR.ArrayValue> ();
1326 foreach(var i in (JObject)obj) {
1327 map.Add( (string)fromJSON(Type.String,i.Key)
1328 , (global::LambdaCube.IR.ArrayValue)fromJSON(Type.ArrayValue,i.Value));
1329 }
1330 return map;
1331 }
1332 case Type.Map_String_InputType: {
1333 var map = new Dictionary<string, global::LambdaCube.IR.InputType> ();
1334 foreach(var i in (JObject)obj) {
1335 map.Add( (string)fromJSON(Type.String,i.Key)
1336 , (global::LambdaCube.IR.InputType)fromJSON(Type.InputType,i.Value));
1337 }
1338 return map;
1339 }
1340 case Type.Map_String_Parameter: {
1341 var map = new Dictionary<string, global::LambdaCube.IR.Parameter> ();
1342 foreach(var i in (JObject)obj) {
1343 map.Add( (string)fromJSON(Type.String,i.Key)
1344 , (global::LambdaCube.IR.Parameter)fromJSON(Type.Parameter,i.Value));
1345 }
1346 return map;
1347 }
1348
1349 case Type.ArrayValue: {
1350 string tag = (string)obj["tag"];
1351 ArrayValue.Tag tagType;
1352 if (tag == "VBoolArray") {
1353 tagType = ArrayValue.Tag.VBoolArray;
1354 data.VBoolArray tv = new data.VBoolArray();
1355 tv._0 = (List<bool>)fromJSON(Type.Array_Bool,obj["arg0"]);
1356 return tv;
1357 }
1358 else if (tag == "VIntArray") {
1359 tagType = ArrayValue.Tag.VIntArray;
1360 data.VIntArray tv = new data.VIntArray();
1361 tv._0 = (List<int>)fromJSON(Type.Array_Int32,obj["arg0"]);
1362 return tv;
1363 }
1364 else if (tag == "VWordArray") {
1365 tagType = ArrayValue.Tag.VWordArray;
1366 data.VWordArray tv = new data.VWordArray();
1367 tv._0 = (List<uint>)fromJSON(Type.Array_Word32,obj["arg0"]);
1368 return tv;
1369 }
1370 else if (tag == "VFloatArray") {
1371 tagType = ArrayValue.Tag.VFloatArray;
1372 data.VFloatArray tv = new data.VFloatArray();
1373 tv._0 = (List<float>)fromJSON(Type.Array_Float,obj["arg0"]);
1374 return tv;
1375 }
1376 else throw new Exception("unknown constructor: " + tag);
1377 ArrayValue o = new ArrayValue();
1378 o.tag = tagType;
1379 return o;
1380 }
1381 case Type.Value: {
1382 string tag = (string)obj["tag"];
1383 Value.Tag tagType;
1384 if (tag == "VBool") {
1385 tagType = Value.Tag.VBool;
1386 data.VBool tv = new data.VBool();
1387 tv._0 = (bool)fromJSON(Type.Bool,obj["arg0"]);
1388 return tv;
1389 }
1390 else if (tag == "VV2B") {
1391 tagType = Value.Tag.VV2B;
1392 data.VV2B tv = new data.VV2B();
1393 tv._0 = (V2<bool>)fromJSON(Type.V2_Bool,obj["arg0"]);
1394 return tv;
1395 }
1396 else if (tag == "VV3B") {
1397 tagType = Value.Tag.VV3B;
1398 data.VV3B tv = new data.VV3B();
1399 tv._0 = (V3<bool>)fromJSON(Type.V3_Bool,obj["arg0"]);
1400 return tv;
1401 }
1402 else if (tag == "VV4B") {
1403 tagType = Value.Tag.VV4B;
1404 data.VV4B tv = new data.VV4B();
1405 tv._0 = (V4<bool>)fromJSON(Type.V4_Bool,obj["arg0"]);
1406 return tv;
1407 }
1408 else if (tag == "VWord") {
1409 tagType = Value.Tag.VWord;
1410 data.VWord tv = new data.VWord();
1411 tv._0 = (uint)fromJSON(Type.Word32,obj["arg0"]);
1412 return tv;
1413 }
1414 else if (tag == "VV2U") {
1415 tagType = Value.Tag.VV2U;
1416 data.VV2U tv = new data.VV2U();
1417 tv._0 = (V2<uint>)fromJSON(Type.V2_Word,obj["arg0"]);
1418 return tv;
1419 }
1420 else if (tag == "VV3U") {
1421 tagType = Value.Tag.VV3U;
1422 data.VV3U tv = new data.VV3U();
1423 tv._0 = (V3<uint>)fromJSON(Type.V3_Word,obj["arg0"]);
1424 return tv;
1425 }
1426 else if (tag == "VV4U") {
1427 tagType = Value.Tag.VV4U;
1428 data.VV4U tv = new data.VV4U();
1429 tv._0 = (V4<uint>)fromJSON(Type.V4_Word,obj["arg0"]);
1430 return tv;
1431 }
1432 else if (tag == "VInt") {
1433 tagType = Value.Tag.VInt;
1434 data.VInt tv = new data.VInt();
1435 tv._0 = (int)fromJSON(Type.Int32,obj["arg0"]);
1436 return tv;
1437 }
1438 else if (tag == "VV2I") {
1439 tagType = Value.Tag.VV2I;
1440 data.VV2I tv = new data.VV2I();
1441 tv._0 = (V2<int>)fromJSON(Type.V2_Int,obj["arg0"]);
1442 return tv;
1443 }
1444 else if (tag == "VV3I") {
1445 tagType = Value.Tag.VV3I;
1446 data.VV3I tv = new data.VV3I();
1447 tv._0 = (V3<int>)fromJSON(Type.V3_Int,obj["arg0"]);
1448 return tv;
1449 }
1450 else if (tag == "VV4I") {
1451 tagType = Value.Tag.VV4I;
1452 data.VV4I tv = new data.VV4I();
1453 tv._0 = (V4<int>)fromJSON(Type.V4_Int,obj["arg0"]);
1454 return tv;
1455 }
1456 else if (tag == "VFloat") {
1457 tagType = Value.Tag.VFloat;
1458 data.VFloat tv = new data.VFloat();
1459 tv._0 = (float)fromJSON(Type.Float,obj["arg0"]);
1460 return tv;
1461 }
1462 else if (tag == "VV2F") {
1463 tagType = Value.Tag.VV2F;
1464 data.VV2F tv = new data.VV2F();
1465 tv._0 = (V2<float>)fromJSON(Type.V2_Float,obj["arg0"]);
1466 return tv;
1467 }
1468 else if (tag == "VV3F") {
1469 tagType = Value.Tag.VV3F;
1470 data.VV3F tv = new data.VV3F();
1471 tv._0 = (V3<float>)fromJSON(Type.V3_Float,obj["arg0"]);
1472 return tv;
1473 }
1474 else if (tag == "VV4F") {
1475 tagType = Value.Tag.VV4F;
1476 data.VV4F tv = new data.VV4F();
1477 tv._0 = (V4<float>)fromJSON(Type.V4_Float,obj["arg0"]);
1478 return tv;
1479 }
1480 else if (tag == "VM22F") {
1481 tagType = Value.Tag.VM22F;
1482 data.VM22F tv = new data.VM22F();
1483 tv._0 = (V2<V2<float>>)fromJSON(Type.V2_V2_Float,obj["arg0"]);
1484 return tv;
1485 }
1486 else if (tag == "VM23F") {
1487 tagType = Value.Tag.VM23F;
1488 data.VM23F tv = new data.VM23F();
1489 tv._0 = (V3<V2<float>>)fromJSON(Type.V3_V2_Float,obj["arg0"]);
1490 return tv;
1491 }
1492 else if (tag == "VM24F") {
1493 tagType = Value.Tag.VM24F;
1494 data.VM24F tv = new data.VM24F();
1495 tv._0 = (V4<V2<float>>)fromJSON(Type.V4_V2_Float,obj["arg0"]);
1496 return tv;
1497 }
1498 else if (tag == "VM32F") {
1499 tagType = Value.Tag.VM32F;
1500 data.VM32F tv = new data.VM32F();
1501 tv._0 = (V2<V3<float>>)fromJSON(Type.V2_V3_Float,obj["arg0"]);
1502 return tv;
1503 }
1504 else if (tag == "VM33F") {
1505 tagType = Value.Tag.VM33F;
1506 data.VM33F tv = new data.VM33F();
1507 tv._0 = (V3<V3<float>>)fromJSON(Type.V3_V3_Float,obj["arg0"]);
1508 return tv;
1509 }
1510 else if (tag == "VM34F") {
1511 tagType = Value.Tag.VM34F;
1512 data.VM34F tv = new data.VM34F();
1513 tv._0 = (V4<V3<float>>)fromJSON(Type.V4_V3_Float,obj["arg0"]);
1514 return tv;
1515 }
1516 else if (tag == "VM42F") {
1517 tagType = Value.Tag.VM42F;
1518 data.VM42F tv = new data.VM42F();
1519 tv._0 = (V2<V4<float>>)fromJSON(Type.V2_V4_Float,obj["arg0"]);
1520 return tv;
1521 }
1522 else if (tag == "VM43F") {
1523 tagType = Value.Tag.VM43F;
1524 data.VM43F tv = new data.VM43F();
1525 tv._0 = (V3<V4<float>>)fromJSON(Type.V3_V4_Float,obj["arg0"]);
1526 return tv;
1527 }
1528 else if (tag == "VM44F") {
1529 tagType = Value.Tag.VM44F;
1530 data.VM44F tv = new data.VM44F();
1531 tv._0 = (V4<V4<float>>)fromJSON(Type.V4_V4_Float,obj["arg0"]);
1532 return tv;
1533 }
1534 else throw new Exception("unknown constructor: " + tag);
1535 Value o = new Value();
1536 o.tag = tagType;
1537 return o;
1538 }
1539 case Type.InputType: {
1540 string tag = (string)obj["tag"];
1541 InputType.Tag tagType;
1542 if (tag == "Bool") {
1543 tagType = InputType.Tag.Bool;
1544 }
1545 else if (tag == "V2B") {
1546 tagType = InputType.Tag.V2B;
1547 }
1548 else if (tag == "V3B") {
1549 tagType = InputType.Tag.V3B;
1550 }
1551 else if (tag == "V4B") {
1552 tagType = InputType.Tag.V4B;
1553 }
1554 else if (tag == "Word") {
1555 tagType = InputType.Tag.Word;
1556 }
1557 else if (tag == "V2U") {
1558 tagType = InputType.Tag.V2U;
1559 }
1560 else if (tag == "V3U") {
1561 tagType = InputType.Tag.V3U;
1562 }
1563 else if (tag == "V4U") {
1564 tagType = InputType.Tag.V4U;
1565 }
1566 else if (tag == "Int") {
1567 tagType = InputType.Tag.Int;
1568 }
1569 else if (tag == "V2I") {
1570 tagType = InputType.Tag.V2I;
1571 }
1572 else if (tag == "V3I") {
1573 tagType = InputType.Tag.V3I;
1574 }
1575 else if (tag == "V4I") {
1576 tagType = InputType.Tag.V4I;
1577 }
1578 else if (tag == "Float") {
1579 tagType = InputType.Tag.Float;
1580 }
1581 else if (tag == "V2F") {
1582 tagType = InputType.Tag.V2F;
1583 }
1584 else if (tag == "V3F") {
1585 tagType = InputType.Tag.V3F;
1586 }
1587 else if (tag == "V4F") {
1588 tagType = InputType.Tag.V4F;
1589 }
1590 else if (tag == "M22F") {
1591 tagType = InputType.Tag.M22F;
1592 }
1593 else if (tag == "M23F") {
1594 tagType = InputType.Tag.M23F;
1595 }
1596 else if (tag == "M24F") {
1597 tagType = InputType.Tag.M24F;
1598 }
1599 else if (tag == "M32F") {
1600 tagType = InputType.Tag.M32F;
1601 }
1602 else if (tag == "M33F") {
1603 tagType = InputType.Tag.M33F;
1604 }
1605 else if (tag == "M34F") {
1606 tagType = InputType.Tag.M34F;
1607 }
1608 else if (tag == "M42F") {
1609 tagType = InputType.Tag.M42F;
1610 }
1611 else if (tag == "M43F") {
1612 tagType = InputType.Tag.M43F;
1613 }
1614 else if (tag == "M44F") {
1615 tagType = InputType.Tag.M44F;
1616 }
1617 else if (tag == "STexture1D") {
1618 tagType = InputType.Tag.STexture1D;
1619 }
1620 else if (tag == "STexture2D") {
1621 tagType = InputType.Tag.STexture2D;
1622 }
1623 else if (tag == "STextureCube") {
1624 tagType = InputType.Tag.STextureCube;
1625 }
1626 else if (tag == "STexture1DArray") {
1627 tagType = InputType.Tag.STexture1DArray;
1628 }
1629 else if (tag == "STexture2DArray") {
1630 tagType = InputType.Tag.STexture2DArray;
1631 }
1632 else if (tag == "STexture2DRect") {
1633 tagType = InputType.Tag.STexture2DRect;
1634 }
1635 else if (tag == "FTexture1D") {
1636 tagType = InputType.Tag.FTexture1D;
1637 }
1638 else if (tag == "FTexture2D") {
1639 tagType = InputType.Tag.FTexture2D;
1640 }
1641 else if (tag == "FTexture3D") {
1642 tagType = InputType.Tag.FTexture3D;
1643 }
1644 else if (tag == "FTextureCube") {
1645 tagType = InputType.Tag.FTextureCube;
1646 }
1647 else if (tag == "FTexture1DArray") {
1648 tagType = InputType.Tag.FTexture1DArray;
1649 }
1650 else if (tag == "FTexture2DArray") {
1651 tagType = InputType.Tag.FTexture2DArray;
1652 }
1653 else if (tag == "FTexture2DMS") {
1654 tagType = InputType.Tag.FTexture2DMS;
1655 }
1656 else if (tag == "FTexture2DMSArray") {
1657 tagType = InputType.Tag.FTexture2DMSArray;
1658 }
1659 else if (tag == "FTextureBuffer") {
1660 tagType = InputType.Tag.FTextureBuffer;
1661 }
1662 else if (tag == "FTexture2DRect") {
1663 tagType = InputType.Tag.FTexture2DRect;
1664 }
1665 else if (tag == "ITexture1D") {
1666 tagType = InputType.Tag.ITexture1D;
1667 }
1668 else if (tag == "ITexture2D") {
1669 tagType = InputType.Tag.ITexture2D;
1670 }
1671 else if (tag == "ITexture3D") {
1672 tagType = InputType.Tag.ITexture3D;
1673 }
1674 else if (tag == "ITextureCube") {
1675 tagType = InputType.Tag.ITextureCube;
1676 }
1677 else if (tag == "ITexture1DArray") {
1678 tagType = InputType.Tag.ITexture1DArray;
1679 }
1680 else if (tag == "ITexture2DArray") {
1681 tagType = InputType.Tag.ITexture2DArray;
1682 }
1683 else if (tag == "ITexture2DMS") {
1684 tagType = InputType.Tag.ITexture2DMS;
1685 }
1686 else if (tag == "ITexture2DMSArray") {
1687 tagType = InputType.Tag.ITexture2DMSArray;
1688 }
1689 else if (tag == "ITextureBuffer") {
1690 tagType = InputType.Tag.ITextureBuffer;
1691 }
1692 else if (tag == "ITexture2DRect") {
1693 tagType = InputType.Tag.ITexture2DRect;
1694 }
1695 else if (tag == "UTexture1D") {
1696 tagType = InputType.Tag.UTexture1D;
1697 }
1698 else if (tag == "UTexture2D") {
1699 tagType = InputType.Tag.UTexture2D;
1700 }
1701 else if (tag == "UTexture3D") {
1702 tagType = InputType.Tag.UTexture3D;
1703 }
1704 else if (tag == "UTextureCube") {
1705 tagType = InputType.Tag.UTextureCube;
1706 }
1707 else if (tag == "UTexture1DArray") {
1708 tagType = InputType.Tag.UTexture1DArray;
1709 }
1710 else if (tag == "UTexture2DArray") {
1711 tagType = InputType.Tag.UTexture2DArray;
1712 }
1713 else if (tag == "UTexture2DMS") {
1714 tagType = InputType.Tag.UTexture2DMS;
1715 }
1716 else if (tag == "UTexture2DMSArray") {
1717 tagType = InputType.Tag.UTexture2DMSArray;
1718 }
1719 else if (tag == "UTextureBuffer") {
1720 tagType = InputType.Tag.UTextureBuffer;
1721 }
1722 else if (tag == "UTexture2DRect") {
1723 tagType = InputType.Tag.UTexture2DRect;
1724 }
1725 else throw new Exception("unknown constructor: " + tag);
1726 InputType o = new InputType();
1727 o.tag = tagType;
1728 return o;
1729 }
1730 case Type.PointSpriteCoordOrigin: {
1731 string tag = (string)obj["tag"];
1732 PointSpriteCoordOrigin.Tag tagType;
1733 if (tag == "LowerLeft") {
1734 tagType = PointSpriteCoordOrigin.Tag.LowerLeft;
1735 }
1736 else if (tag == "UpperLeft") {
1737 tagType = PointSpriteCoordOrigin.Tag.UpperLeft;
1738 }
1739 else throw new Exception("unknown constructor: " + tag);
1740 PointSpriteCoordOrigin o = new PointSpriteCoordOrigin();
1741 o.tag = tagType;
1742 return o;
1743 }
1744 case Type.PointSize: {
1745 string tag = (string)obj["tag"];
1746 PointSize.Tag tagType;
1747 if (tag == "PointSize") {
1748 tagType = PointSize.Tag.PointSize;
1749 data.PointSize tv = new data.PointSize();
1750 tv._0 = (float)fromJSON(Type.Float,obj["arg0"]);
1751 return tv;
1752 }
1753 else if (tag == "ProgramPointSize") {
1754 tagType = PointSize.Tag.ProgramPointSize;
1755 }
1756 else throw new Exception("unknown constructor: " + tag);
1757 PointSize o = new PointSize();
1758 o.tag = tagType;
1759 return o;
1760 }
1761 case Type.PolygonOffset: {
1762 string tag = (string)obj["tag"];
1763 PolygonOffset.Tag tagType;
1764 if (tag == "NoOffset") {
1765 tagType = PolygonOffset.Tag.NoOffset;
1766 }
1767 else if (tag == "Offset") {
1768 tagType = PolygonOffset.Tag.Offset;
1769 data.Offset tv = new data.Offset();
1770 tv._0 = (float)fromJSON(Type.Float,obj["arg0"]);
1771 tv._1 = (float)fromJSON(Type.Float,obj["arg1"]);
1772 return tv;
1773 }
1774 else throw new Exception("unknown constructor: " + tag);
1775 PolygonOffset o = new PolygonOffset();
1776 o.tag = tagType;
1777 return o;
1778 }
1779 case Type.FrontFace: {
1780 string tag = (string)obj["tag"];
1781 FrontFace.Tag tagType;
1782 if (tag == "CCW") {
1783 tagType = FrontFace.Tag.CCW;
1784 }
1785 else if (tag == "CW") {
1786 tagType = FrontFace.Tag.CW;
1787 }
1788 else throw new Exception("unknown constructor: " + tag);
1789 FrontFace o = new FrontFace();
1790 o.tag = tagType;
1791 return o;
1792 }
1793 case Type.PolygonMode: {
1794 string tag = (string)obj["tag"];
1795 PolygonMode.Tag tagType;
1796 if (tag == "PolygonPoint") {
1797 tagType = PolygonMode.Tag.PolygonPoint;
1798 data.PolygonPoint tv = new data.PolygonPoint();
1799 tv._0 = (global::LambdaCube.IR.PointSize)fromJSON(Type.PointSize,obj["arg0"]);
1800 return tv;
1801 }
1802 else if (tag == "PolygonLine") {
1803 tagType = PolygonMode.Tag.PolygonLine;
1804 data.PolygonLine tv = new data.PolygonLine();
1805 tv._0 = (float)fromJSON(Type.Float,obj["arg0"]);
1806 return tv;
1807 }
1808 else if (tag == "PolygonFill") {
1809 tagType = PolygonMode.Tag.PolygonFill;
1810 }
1811 else throw new Exception("unknown constructor: " + tag);
1812 PolygonMode o = new PolygonMode();
1813 o.tag = tagType;
1814 return o;
1815 }
1816 case Type.ProvokingVertex: {
1817 string tag = (string)obj["tag"];
1818 ProvokingVertex.Tag tagType;
1819 if (tag == "FirstVertex") {
1820 tagType = ProvokingVertex.Tag.FirstVertex;
1821 }
1822 else if (tag == "LastVertex") {
1823 tagType = ProvokingVertex.Tag.LastVertex;
1824 }
1825 else throw new Exception("unknown constructor: " + tag);
1826 ProvokingVertex o = new ProvokingVertex();
1827 o.tag = tagType;
1828 return o;
1829 }
1830 case Type.CullMode: {
1831 string tag = (string)obj["tag"];
1832 CullMode.Tag tagType;
1833 if (tag == "CullNone") {
1834 tagType = CullMode.Tag.CullNone;
1835 }
1836 else if (tag == "CullFront") {
1837 tagType = CullMode.Tag.CullFront;
1838 data.CullFront tv = new data.CullFront();
1839 tv._0 = (global::LambdaCube.IR.FrontFace)fromJSON(Type.FrontFace,obj["arg0"]);
1840 return tv;
1841 }
1842 else if (tag == "CullBack") {
1843 tagType = CullMode.Tag.CullBack;
1844 data.CullBack tv = new data.CullBack();
1845 tv._0 = (global::LambdaCube.IR.FrontFace)fromJSON(Type.FrontFace,obj["arg0"]);
1846 return tv;
1847 }
1848 else throw new Exception("unknown constructor: " + tag);
1849 CullMode o = new CullMode();
1850 o.tag = tagType;
1851 return o;
1852 }
1853 case Type.ComparisonFunction: {
1854 string tag = (string)obj["tag"];
1855 ComparisonFunction.Tag tagType;
1856 if (tag == "Never") {
1857 tagType = ComparisonFunction.Tag.Never;
1858 }
1859 else if (tag == "Less") {
1860 tagType = ComparisonFunction.Tag.Less;
1861 }
1862 else if (tag == "Equal") {
1863 tagType = ComparisonFunction.Tag.Equal;
1864 }
1865 else if (tag == "Lequal") {
1866 tagType = ComparisonFunction.Tag.Lequal;
1867 }
1868 else if (tag == "Greater") {
1869 tagType = ComparisonFunction.Tag.Greater;
1870 }
1871 else if (tag == "Notequal") {
1872 tagType = ComparisonFunction.Tag.Notequal;
1873 }
1874 else if (tag == "Gequal") {
1875 tagType = ComparisonFunction.Tag.Gequal;
1876 }
1877 else if (tag == "Always") {
1878 tagType = ComparisonFunction.Tag.Always;
1879 }
1880 else throw new Exception("unknown constructor: " + tag);
1881 ComparisonFunction o = new ComparisonFunction();
1882 o.tag = tagType;
1883 return o;
1884 }
1885 case Type.StencilOperation: {
1886 string tag = (string)obj["tag"];
1887 StencilOperation.Tag tagType;
1888 if (tag == "OpZero") {
1889 tagType = StencilOperation.Tag.OpZero;
1890 }
1891 else if (tag == "OpKeep") {
1892 tagType = StencilOperation.Tag.OpKeep;
1893 }
1894 else if (tag == "OpReplace") {
1895 tagType = StencilOperation.Tag.OpReplace;
1896 }
1897 else if (tag == "OpIncr") {
1898 tagType = StencilOperation.Tag.OpIncr;
1899 }
1900 else if (tag == "OpIncrWrap") {
1901 tagType = StencilOperation.Tag.OpIncrWrap;
1902 }
1903 else if (tag == "OpDecr") {
1904 tagType = StencilOperation.Tag.OpDecr;
1905 }
1906 else if (tag == "OpDecrWrap") {
1907 tagType = StencilOperation.Tag.OpDecrWrap;
1908 }
1909 else if (tag == "OpInvert") {
1910 tagType = StencilOperation.Tag.OpInvert;
1911 }
1912 else throw new Exception("unknown constructor: " + tag);
1913 StencilOperation o = new StencilOperation();
1914 o.tag = tagType;
1915 return o;
1916 }
1917 case Type.BlendEquation: {
1918 string tag = (string)obj["tag"];
1919 BlendEquation.Tag tagType;
1920 if (tag == "FuncAdd") {
1921 tagType = BlendEquation.Tag.FuncAdd;
1922 }
1923 else if (tag == "FuncSubtract") {
1924 tagType = BlendEquation.Tag.FuncSubtract;
1925 }
1926 else if (tag == "FuncReverseSubtract") {
1927 tagType = BlendEquation.Tag.FuncReverseSubtract;
1928 }
1929 else if (tag == "Min") {
1930 tagType = BlendEquation.Tag.Min;
1931 }
1932 else if (tag == "Max") {
1933 tagType = BlendEquation.Tag.Max;
1934 }
1935 else throw new Exception("unknown constructor: " + tag);
1936 BlendEquation o = new BlendEquation();
1937 o.tag = tagType;
1938 return o;
1939 }
1940 case Type.BlendingFactor: {
1941 string tag = (string)obj["tag"];
1942 BlendingFactor.Tag tagType;
1943 if (tag == "Zero") {
1944 tagType = BlendingFactor.Tag.Zero;
1945 }
1946 else if (tag == "One") {
1947 tagType = BlendingFactor.Tag.One;
1948 }
1949 else if (tag == "SrcColor") {
1950 tagType = BlendingFactor.Tag.SrcColor;
1951 }
1952 else if (tag == "OneMinusSrcColor") {
1953 tagType = BlendingFactor.Tag.OneMinusSrcColor;
1954 }
1955 else if (tag == "DstColor") {
1956 tagType = BlendingFactor.Tag.DstColor;
1957 }
1958 else if (tag == "OneMinusDstColor") {
1959 tagType = BlendingFactor.Tag.OneMinusDstColor;
1960 }
1961 else if (tag == "SrcAlpha") {
1962 tagType = BlendingFactor.Tag.SrcAlpha;
1963 }
1964 else if (tag == "OneMinusSrcAlpha") {
1965 tagType = BlendingFactor.Tag.OneMinusSrcAlpha;
1966 }
1967 else if (tag == "DstAlpha") {
1968 tagType = BlendingFactor.Tag.DstAlpha;
1969 }
1970 else if (tag == "OneMinusDstAlpha") {
1971 tagType = BlendingFactor.Tag.OneMinusDstAlpha;
1972 }
1973 else if (tag == "ConstantColor") {
1974 tagType = BlendingFactor.Tag.ConstantColor;
1975 }
1976 else if (tag == "OneMinusConstantColor") {
1977 tagType = BlendingFactor.Tag.OneMinusConstantColor;
1978 }
1979 else if (tag == "ConstantAlpha") {
1980 tagType = BlendingFactor.Tag.ConstantAlpha;
1981 }
1982 else if (tag == "OneMinusConstantAlpha") {
1983 tagType = BlendingFactor.Tag.OneMinusConstantAlpha;
1984 }
1985 else if (tag == "SrcAlphaSaturate") {
1986 tagType = BlendingFactor.Tag.SrcAlphaSaturate;
1987 }
1988 else throw new Exception("unknown constructor: " + tag);
1989 BlendingFactor o = new BlendingFactor();
1990 o.tag = tagType;
1991 return o;
1992 }
1993 case Type.LogicOperation: {
1994 string tag = (string)obj["tag"];
1995 LogicOperation.Tag tagType;
1996 if (tag == "Clear") {
1997 tagType = LogicOperation.Tag.Clear;
1998 }
1999 else if (tag == "And") {
2000 tagType = LogicOperation.Tag.And;
2001 }
2002 else if (tag == "AndReverse") {
2003 tagType = LogicOperation.Tag.AndReverse;
2004 }
2005 else if (tag == "Copy") {
2006 tagType = LogicOperation.Tag.Copy;
2007 }
2008 else if (tag == "AndInverted") {
2009 tagType = LogicOperation.Tag.AndInverted;
2010 }
2011 else if (tag == "Noop") {
2012 tagType = LogicOperation.Tag.Noop;
2013 }
2014 else if (tag == "Xor") {
2015 tagType = LogicOperation.Tag.Xor;
2016 }
2017 else if (tag == "Or") {
2018 tagType = LogicOperation.Tag.Or;
2019 }
2020 else if (tag == "Nor") {
2021 tagType = LogicOperation.Tag.Nor;
2022 }
2023 else if (tag == "Equiv") {
2024 tagType = LogicOperation.Tag.Equiv;
2025 }
2026 else if (tag == "Invert") {
2027 tagType = LogicOperation.Tag.Invert;
2028 }
2029 else if (tag == "OrReverse") {
2030 tagType = LogicOperation.Tag.OrReverse;
2031 }
2032 else if (tag == "CopyInverted") {
2033 tagType = LogicOperation.Tag.CopyInverted;
2034 }
2035 else if (tag == "OrInverted") {
2036 tagType = LogicOperation.Tag.OrInverted;
2037 }
2038 else if (tag == "Nand") {
2039 tagType = LogicOperation.Tag.Nand;
2040 }
2041 else if (tag == "Set") {
2042 tagType = LogicOperation.Tag.Set;
2043 }
2044 else throw new Exception("unknown constructor: " + tag);
2045 LogicOperation o = new LogicOperation();
2046 o.tag = tagType;
2047 return o;
2048 }
2049 case Type.StencilOps: {
2050 string tag = (string)obj["tag"];
2051 StencilOps.Tag tagType;
2052 if (tag == "StencilOps") {
2053 tagType = StencilOps.Tag.StencilOps;
2054 data.StencilOps tv = new data.StencilOps();
2055 tv.frontStencilOp = (global::LambdaCube.IR.StencilOperation)fromJSON(Type.StencilOperation,obj["frontStencilOp"]);
2056 tv.backStencilOp = (global::LambdaCube.IR.StencilOperation)fromJSON(Type.StencilOperation,obj["backStencilOp"]);
2057 return tv;
2058 }
2059 else throw new Exception("unknown constructor: " + tag);
2060 StencilOps o = new StencilOps();
2061 o.tag = tagType;
2062 return o;
2063 }
2064 case Type.StencilTest: {
2065 string tag = (string)obj["tag"];
2066 StencilTest.Tag tagType;
2067 if (tag == "StencilTest") {
2068 tagType = StencilTest.Tag.StencilTest;
2069 data.StencilTest tv = new data.StencilTest();
2070 tv.stencilComparision = (global::LambdaCube.IR.ComparisonFunction)fromJSON(Type.ComparisonFunction,obj["stencilComparision"]);
2071 tv.stencilReference = (int)fromJSON(Type.Int32,obj["stencilReference"]);
2072 tv.stencilMask = (uint)fromJSON(Type.Word32,obj["stencilMask"]);
2073 return tv;
2074 }
2075 else throw new Exception("unknown constructor: " + tag);
2076 StencilTest o = new StencilTest();
2077 o.tag = tagType;
2078 return o;
2079 }
2080 case Type.StencilTests: {
2081 string tag = (string)obj["tag"];
2082 StencilTests.Tag tagType;
2083 if (tag == "StencilTests") {
2084 tagType = StencilTests.Tag.StencilTests;
2085 data.StencilTests tv = new data.StencilTests();
2086 tv._0 = (global::LambdaCube.IR.StencilTest)fromJSON(Type.StencilTest,obj["arg0"]);
2087 tv._1 = (global::LambdaCube.IR.StencilTest)fromJSON(Type.StencilTest,obj["arg1"]);
2088 return tv;
2089 }
2090 else throw new Exception("unknown constructor: " + tag);
2091 StencilTests o = new StencilTests();
2092 o.tag = tagType;
2093 return o;
2094 }
2095 case Type.FetchPrimitive: {
2096 string tag = (string)obj["tag"];
2097 FetchPrimitive.Tag tagType;
2098 if (tag == "Points") {
2099 tagType = FetchPrimitive.Tag.Points;
2100 }
2101 else if (tag == "Lines") {
2102 tagType = FetchPrimitive.Tag.Lines;
2103 }
2104 else if (tag == "Triangles") {
2105 tagType = FetchPrimitive.Tag.Triangles;
2106 }
2107 else if (tag == "LinesAdjacency") {
2108 tagType = FetchPrimitive.Tag.LinesAdjacency;
2109 }
2110 else if (tag == "TrianglesAdjacency") {
2111 tagType = FetchPrimitive.Tag.TrianglesAdjacency;
2112 }
2113 else throw new Exception("unknown constructor: " + tag);
2114 FetchPrimitive o = new FetchPrimitive();
2115 o.tag = tagType;
2116 return o;
2117 }
2118 case Type.OutputPrimitive: {
2119 string tag = (string)obj["tag"];
2120 OutputPrimitive.Tag tagType;
2121 if (tag == "TrianglesOutput") {
2122 tagType = OutputPrimitive.Tag.TrianglesOutput;
2123 }
2124 else if (tag == "LinesOutput") {
2125 tagType = OutputPrimitive.Tag.LinesOutput;
2126 }
2127 else if (tag == "PointsOutput") {
2128 tagType = OutputPrimitive.Tag.PointsOutput;
2129 }
2130 else throw new Exception("unknown constructor: " + tag);
2131 OutputPrimitive o = new OutputPrimitive();
2132 o.tag = tagType;
2133 return o;
2134 }
2135 case Type.ColorArity: {
2136 string tag = (string)obj["tag"];
2137 ColorArity.Tag tagType;
2138 if (tag == "Red") {
2139 tagType = ColorArity.Tag.Red;
2140 }
2141 else if (tag == "RG") {
2142 tagType = ColorArity.Tag.RG;
2143 }
2144 else if (tag == "RGB") {
2145 tagType = ColorArity.Tag.RGB;
2146 }
2147 else if (tag == "RGBA") {
2148 tagType = ColorArity.Tag.RGBA;
2149 }
2150 else throw new Exception("unknown constructor: " + tag);
2151 ColorArity o = new ColorArity();
2152 o.tag = tagType;
2153 return o;
2154 }
2155 case Type.Blending: {
2156 string tag = (string)obj["tag"];
2157 Blending.Tag tagType;
2158 if (tag == "NoBlending") {
2159 tagType = Blending.Tag.NoBlending;
2160 }
2161 else if (tag == "BlendLogicOp") {
2162 tagType = Blending.Tag.BlendLogicOp;
2163 data.BlendLogicOp tv = new data.BlendLogicOp();
2164 tv._0 = (global::LambdaCube.IR.LogicOperation)fromJSON(Type.LogicOperation,obj["arg0"]);
2165 return tv;
2166 }
2167 else if (tag == "Blend") {
2168 tagType = Blending.Tag.Blend;
2169 data.Blend tv = new data.Blend();
2170 tv.colorEqSrc = (global::LambdaCube.IR.BlendEquation)fromJSON(Type.BlendEquation,obj["colorEqSrc"]);
2171 tv.alphaEqSrc = (global::LambdaCube.IR.BlendEquation)fromJSON(Type.BlendEquation,obj["alphaEqSrc"]);
2172 tv.colorFSrc = (global::LambdaCube.IR.BlendingFactor)fromJSON(Type.BlendingFactor,obj["colorFSrc"]);
2173 tv.colorFDst = (global::LambdaCube.IR.BlendingFactor)fromJSON(Type.BlendingFactor,obj["colorFDst"]);
2174 tv.alphaFSrc = (global::LambdaCube.IR.BlendingFactor)fromJSON(Type.BlendingFactor,obj["alphaFSrc"]);
2175 tv.alphaFDst = (global::LambdaCube.IR.BlendingFactor)fromJSON(Type.BlendingFactor,obj["alphaFDst"]);
2176 tv.color = (V4<float>)fromJSON(Type.V4_Float,obj["color"]);
2177 return tv;
2178 }
2179 else throw new Exception("unknown constructor: " + tag);
2180 Blending o = new Blending();
2181 o.tag = tagType;
2182 return o;
2183 }
2184 case Type.RasterContext: {
2185 string tag = (string)obj["tag"];
2186 RasterContext.Tag tagType;
2187 if (tag == "PointCtx") {
2188 tagType = RasterContext.Tag.PointCtx;
2189 data.PointCtx tv = new data.PointCtx();
2190 tv._0 = (global::LambdaCube.IR.PointSize)fromJSON(Type.PointSize,obj["arg0"]);
2191 tv._1 = (float)fromJSON(Type.Float,obj["arg1"]);
2192 tv._2 = (global::LambdaCube.IR.PointSpriteCoordOrigin)fromJSON(Type.PointSpriteCoordOrigin,obj["arg2"]);
2193 return tv;
2194 }
2195 else if (tag == "LineCtx") {
2196 tagType = RasterContext.Tag.LineCtx;
2197 data.LineCtx tv = new data.LineCtx();
2198 tv._0 = (float)fromJSON(Type.Float,obj["arg0"]);
2199 tv._1 = (global::LambdaCube.IR.ProvokingVertex)fromJSON(Type.ProvokingVertex,obj["arg1"]);
2200 return tv;
2201 }
2202 else if (tag == "TriangleCtx") {
2203 tagType = RasterContext.Tag.TriangleCtx;
2204 data.TriangleCtx tv = new data.TriangleCtx();
2205 tv._0 = (global::LambdaCube.IR.CullMode)fromJSON(Type.CullMode,obj["arg0"]);
2206 tv._1 = (global::LambdaCube.IR.PolygonMode)fromJSON(Type.PolygonMode,obj["arg1"]);
2207 tv._2 = (global::LambdaCube.IR.PolygonOffset)fromJSON(Type.PolygonOffset,obj["arg2"]);
2208 tv._3 = (global::LambdaCube.IR.ProvokingVertex)fromJSON(Type.ProvokingVertex,obj["arg3"]);
2209 return tv;
2210 }
2211 else throw new Exception("unknown constructor: " + tag);
2212 RasterContext o = new RasterContext();
2213 o.tag = tagType;
2214 return o;
2215 }
2216 case Type.FragmentOperation: {
2217 string tag = (string)obj["tag"];
2218 FragmentOperation.Tag tagType;
2219 if (tag == "DepthOp") {
2220 tagType = FragmentOperation.Tag.DepthOp;
2221 data.DepthOp tv = new data.DepthOp();
2222 tv._0 = (global::LambdaCube.IR.ComparisonFunction)fromJSON(Type.ComparisonFunction,obj["arg0"]);
2223 tv._1 = (bool)fromJSON(Type.Bool,obj["arg1"]);
2224 return tv;
2225 }
2226 else if (tag == "StencilOp") {
2227 tagType = FragmentOperation.Tag.StencilOp;
2228 data.StencilOp tv = new data.StencilOp();
2229 tv._0 = (global::LambdaCube.IR.StencilTests)fromJSON(Type.StencilTests,obj["arg0"]);
2230 tv._1 = (global::LambdaCube.IR.StencilOps)fromJSON(Type.StencilOps,obj["arg1"]);
2231 tv._2 = (global::LambdaCube.IR.StencilOps)fromJSON(Type.StencilOps,obj["arg2"]);
2232 return tv;
2233 }
2234 else if (tag == "ColorOp") {
2235 tagType = FragmentOperation.Tag.ColorOp;
2236 data.ColorOp tv = new data.ColorOp();
2237 tv._0 = (global::LambdaCube.IR.Blending)fromJSON(Type.Blending,obj["arg0"]);
2238 tv._1 = (global::LambdaCube.IR.Value)fromJSON(Type.Value,obj["arg1"]);
2239 return tv;
2240 }
2241 else throw new Exception("unknown constructor: " + tag);
2242 FragmentOperation o = new FragmentOperation();
2243 o.tag = tagType;
2244 return o;
2245 }
2246 case Type.AccumulationContext: {
2247 string tag = (string)obj["tag"];
2248 AccumulationContext.Tag tagType;
2249 if (tag == "AccumulationContext") {
2250 tagType = AccumulationContext.Tag.AccumulationContext;
2251 data.AccumulationContext tv = new data.AccumulationContext();
2252 tv.accViewportName = (Maybe<string>)fromJSON(Type.Maybe_String,obj["accViewportName"]);
2253 tv.accOperations = (List<global::LambdaCube.IR.FragmentOperation>)fromJSON(Type.List_FragmentOperation,obj["accOperations"]);
2254 return tv;
2255 }
2256 else throw new Exception("unknown constructor: " + tag);
2257 AccumulationContext o = new AccumulationContext();
2258 o.tag = tagType;
2259 return o;
2260 }
2261 case Type.TextureDataType: {
2262 string tag = (string)obj["tag"];
2263 TextureDataType.Tag tagType;
2264 if (tag == "FloatT") {
2265 tagType = TextureDataType.Tag.FloatT;
2266 data.FloatT tv = new data.FloatT();
2267 tv._0 = (global::LambdaCube.IR.ColorArity)fromJSON(Type.ColorArity,obj["arg0"]);
2268 return tv;
2269 }
2270 else if (tag == "IntT") {
2271 tagType = TextureDataType.Tag.IntT;
2272 data.IntT tv = new data.IntT();
2273 tv._0 = (global::LambdaCube.IR.ColorArity)fromJSON(Type.ColorArity,obj["arg0"]);
2274 return tv;
2275 }
2276 else if (tag == "WordT") {
2277 tagType = TextureDataType.Tag.WordT;
2278 data.WordT tv = new data.WordT();
2279 tv._0 = (global::LambdaCube.IR.ColorArity)fromJSON(Type.ColorArity,obj["arg0"]);
2280 return tv;
2281 }
2282 else if (tag == "ShadowT") {
2283 tagType = TextureDataType.Tag.ShadowT;
2284 }
2285 else throw new Exception("unknown constructor: " + tag);
2286 TextureDataType o = new TextureDataType();
2287 o.tag = tagType;
2288 return o;
2289 }
2290 case Type.TextureType: {
2291 string tag = (string)obj["tag"];
2292 TextureType.Tag tagType;
2293 if (tag == "Texture1D") {
2294 tagType = TextureType.Tag.Texture1D;
2295 data.Texture1D tv = new data.Texture1D();
2296 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2297 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2298 return tv;
2299 }
2300 else if (tag == "Texture2D") {
2301 tagType = TextureType.Tag.Texture2D;
2302 data.Texture2D tv = new data.Texture2D();
2303 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2304 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2305 return tv;
2306 }
2307 else if (tag == "Texture3D") {
2308 tagType = TextureType.Tag.Texture3D;
2309 data.Texture3D tv = new data.Texture3D();
2310 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2311 return tv;
2312 }
2313 else if (tag == "TextureCube") {
2314 tagType = TextureType.Tag.TextureCube;
2315 data.TextureCube tv = new data.TextureCube();
2316 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2317 return tv;
2318 }
2319 else if (tag == "TextureRect") {
2320 tagType = TextureType.Tag.TextureRect;
2321 data.TextureRect tv = new data.TextureRect();
2322 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2323 return tv;
2324 }
2325 else if (tag == "Texture2DMS") {
2326 tagType = TextureType.Tag.Texture2DMS;
2327 data.Texture2DMS tv = new data.Texture2DMS();
2328 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2329 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2330 tv._2 = (int)fromJSON(Type.Int,obj["arg2"]);
2331 tv._3 = (bool)fromJSON(Type.Bool,obj["arg3"]);
2332 return tv;
2333 }
2334 else if (tag == "TextureBuffer") {
2335 tagType = TextureType.Tag.TextureBuffer;
2336 data.TextureBuffer tv = new data.TextureBuffer();
2337 tv._0 = (global::LambdaCube.IR.TextureDataType)fromJSON(Type.TextureDataType,obj["arg0"]);
2338 return tv;
2339 }
2340 else throw new Exception("unknown constructor: " + tag);
2341 TextureType o = new TextureType();
2342 o.tag = tagType;
2343 return o;
2344 }
2345 case Type.MipMap: {
2346 string tag = (string)obj["tag"];
2347 MipMap.Tag tagType;
2348 if (tag == "Mip") {
2349 tagType = MipMap.Tag.Mip;
2350 data.Mip tv = new data.Mip();
2351 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2352 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2353 return tv;
2354 }
2355 else if (tag == "NoMip") {
2356 tagType = MipMap.Tag.NoMip;
2357 }
2358 else if (tag == "AutoMip") {
2359 tagType = MipMap.Tag.AutoMip;
2360 data.AutoMip tv = new data.AutoMip();
2361 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2362 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2363 return tv;
2364 }
2365 else throw new Exception("unknown constructor: " + tag);
2366 MipMap o = new MipMap();
2367 o.tag = tagType;
2368 return o;
2369 }
2370 case Type.Filter: {
2371 string tag = (string)obj["tag"];
2372 Filter.Tag tagType;
2373 if (tag == "Nearest") {
2374 tagType = Filter.Tag.Nearest;
2375 }
2376 else if (tag == "Linear") {
2377 tagType = Filter.Tag.Linear;
2378 }
2379 else if (tag == "NearestMipmapNearest") {
2380 tagType = Filter.Tag.NearestMipmapNearest;
2381 }
2382 else if (tag == "NearestMipmapLinear") {
2383 tagType = Filter.Tag.NearestMipmapLinear;
2384 }
2385 else if (tag == "LinearMipmapNearest") {
2386 tagType = Filter.Tag.LinearMipmapNearest;
2387 }
2388 else if (tag == "LinearMipmapLinear") {
2389 tagType = Filter.Tag.LinearMipmapLinear;
2390 }
2391 else throw new Exception("unknown constructor: " + tag);
2392 Filter o = new Filter();
2393 o.tag = tagType;
2394 return o;
2395 }
2396 case Type.EdgeMode: {
2397 string tag = (string)obj["tag"];
2398 EdgeMode.Tag tagType;
2399 if (tag == "Repeat") {
2400 tagType = EdgeMode.Tag.Repeat;
2401 }
2402 else if (tag == "MirroredRepeat") {
2403 tagType = EdgeMode.Tag.MirroredRepeat;
2404 }
2405 else if (tag == "ClampToEdge") {
2406 tagType = EdgeMode.Tag.ClampToEdge;
2407 }
2408 else if (tag == "ClampToBorder") {
2409 tagType = EdgeMode.Tag.ClampToBorder;
2410 }
2411 else throw new Exception("unknown constructor: " + tag);
2412 EdgeMode o = new EdgeMode();
2413 o.tag = tagType;
2414 return o;
2415 }
2416 case Type.ImageSemantic: {
2417 string tag = (string)obj["tag"];
2418 ImageSemantic.Tag tagType;
2419 if (tag == "Depth") {
2420 tagType = ImageSemantic.Tag.Depth;
2421 }
2422 else if (tag == "Stencil") {
2423 tagType = ImageSemantic.Tag.Stencil;
2424 }
2425 else if (tag == "Color") {
2426 tagType = ImageSemantic.Tag.Color;
2427 }
2428 else throw new Exception("unknown constructor: " + tag);
2429 ImageSemantic o = new ImageSemantic();
2430 o.tag = tagType;
2431 return o;
2432 }
2433 case Type.ImageRef: {
2434 string tag = (string)obj["tag"];
2435 ImageRef.Tag tagType;
2436 if (tag == "TextureImage") {
2437 tagType = ImageRef.Tag.TextureImage;
2438 data.TextureImage tv = new data.TextureImage();
2439 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2440 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2441 tv._2 = (Maybe<int>)fromJSON(Type.Maybe_Int,obj["arg2"]);
2442 return tv;
2443 }
2444 else if (tag == "Framebuffer") {
2445 tagType = ImageRef.Tag.Framebuffer;
2446 data.Framebuffer tv = new data.Framebuffer();
2447 tv._0 = (global::LambdaCube.IR.ImageSemantic)fromJSON(Type.ImageSemantic,obj["arg0"]);
2448 return tv;
2449 }
2450 else throw new Exception("unknown constructor: " + tag);
2451 ImageRef o = new ImageRef();
2452 o.tag = tagType;
2453 return o;
2454 }
2455 case Type.ClearImage: {
2456 string tag = (string)obj["tag"];
2457 ClearImage.Tag tagType;
2458 if (tag == "ClearImage") {
2459 tagType = ClearImage.Tag.ClearImage;
2460 data.ClearImage tv = new data.ClearImage();
2461 tv.imageSemantic = (global::LambdaCube.IR.ImageSemantic)fromJSON(Type.ImageSemantic,obj["imageSemantic"]);
2462 tv.clearValue = (global::LambdaCube.IR.Value)fromJSON(Type.Value,obj["clearValue"]);
2463 return tv;
2464 }
2465 else throw new Exception("unknown constructor: " + tag);
2466 ClearImage o = new ClearImage();
2467 o.tag = tagType;
2468 return o;
2469 }
2470 case Type.Command: {
2471 string tag = (string)obj["tag"];
2472 Command.Tag tagType;
2473 if (tag == "SetRasterContext") {
2474 tagType = Command.Tag.SetRasterContext;
2475 data.SetRasterContext tv = new data.SetRasterContext();
2476 tv._0 = (global::LambdaCube.IR.RasterContext)fromJSON(Type.RasterContext,obj["arg0"]);
2477 return tv;
2478 }
2479 else if (tag == "SetAccumulationContext") {
2480 tagType = Command.Tag.SetAccumulationContext;
2481 data.SetAccumulationContext tv = new data.SetAccumulationContext();
2482 tv._0 = (global::LambdaCube.IR.AccumulationContext)fromJSON(Type.AccumulationContext,obj["arg0"]);
2483 return tv;
2484 }
2485 else if (tag == "SetRenderTarget") {
2486 tagType = Command.Tag.SetRenderTarget;
2487 data.SetRenderTarget tv = new data.SetRenderTarget();
2488 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2489 return tv;
2490 }
2491 else if (tag == "SetProgram") {
2492 tagType = Command.Tag.SetProgram;
2493 data.SetProgram tv = new data.SetProgram();
2494 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2495 return tv;
2496 }
2497 else if (tag == "SetSamplerUniform") {
2498 tagType = Command.Tag.SetSamplerUniform;
2499 data.SetSamplerUniform tv = new data.SetSamplerUniform();
2500 tv._0 = (string)fromJSON(Type.String,obj["arg0"]);
2501 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2502 return tv;
2503 }
2504 else if (tag == "SetTexture") {
2505 tagType = Command.Tag.SetTexture;
2506 data.SetTexture tv = new data.SetTexture();
2507 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2508 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2509 return tv;
2510 }
2511 else if (tag == "SetSampler") {
2512 tagType = Command.Tag.SetSampler;
2513 data.SetSampler tv = new data.SetSampler();
2514 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2515 tv._1 = (Maybe<int>)fromJSON(Type.Maybe_Int,obj["arg1"]);
2516 return tv;
2517 }
2518 else if (tag == "RenderSlot") {
2519 tagType = Command.Tag.RenderSlot;
2520 data.RenderSlot tv = new data.RenderSlot();
2521 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2522 return tv;
2523 }
2524 else if (tag == "RenderStream") {
2525 tagType = Command.Tag.RenderStream;
2526 data.RenderStream tv = new data.RenderStream();
2527 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2528 return tv;
2529 }
2530 else if (tag == "ClearRenderTarget") {
2531 tagType = Command.Tag.ClearRenderTarget;
2532 data.ClearRenderTarget tv = new data.ClearRenderTarget();
2533 tv._0 = (List<global::LambdaCube.IR.ClearImage>)fromJSON(Type.Array_ClearImage,obj["arg0"]);
2534 return tv;
2535 }
2536 else if (tag == "GenerateMipMap") {
2537 tagType = Command.Tag.GenerateMipMap;
2538 data.GenerateMipMap tv = new data.GenerateMipMap();
2539 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2540 return tv;
2541 }
2542 else if (tag == "SaveImage") {
2543 tagType = Command.Tag.SaveImage;
2544 data.SaveImage tv = new data.SaveImage();
2545 tv._0 = (int)fromJSON(Type.Int,obj["arg0"]);
2546 tv._1 = (global::LambdaCube.IR.ImageRef)fromJSON(Type.ImageRef,obj["arg1"]);
2547 return tv;
2548 }
2549 else if (tag == "LoadImage") {
2550 tagType = Command.Tag.LoadImage;
2551 data.LoadImage tv = new data.LoadImage();
2552 tv._0 = (global::LambdaCube.IR.ImageRef)fromJSON(Type.ImageRef,obj["arg0"]);
2553 tv._1 = (int)fromJSON(Type.Int,obj["arg1"]);
2554 return tv;
2555 }
2556 else throw new Exception("unknown constructor: " + tag);
2557 Command o = new Command();
2558 o.tag = tagType;
2559 return o;
2560 }
2561 case Type.SamplerDescriptor: {
2562 string tag = (string)obj["tag"];
2563 SamplerDescriptor.Tag tagType;
2564 if (tag == "SamplerDescriptor") {
2565 tagType = SamplerDescriptor.Tag.SamplerDescriptor;
2566 data.SamplerDescriptor tv = new data.SamplerDescriptor();
2567 tv.samplerWrapS = (global::LambdaCube.IR.EdgeMode)fromJSON(Type.EdgeMode,obj["samplerWrapS"]);
2568 tv.samplerWrapT = (Maybe<global::LambdaCube.IR.EdgeMode>)fromJSON(Type.Maybe_EdgeMode,obj["samplerWrapT"]);
2569 tv.samplerWrapR = (Maybe<global::LambdaCube.IR.EdgeMode>)fromJSON(Type.Maybe_EdgeMode,obj["samplerWrapR"]);
2570 tv.samplerMinFilter = (global::LambdaCube.IR.Filter)fromJSON(Type.Filter,obj["samplerMinFilter"]);
2571 tv.samplerMagFilter = (global::LambdaCube.IR.Filter)fromJSON(Type.Filter,obj["samplerMagFilter"]);
2572 tv.samplerBorderColor = (global::LambdaCube.IR.Value)fromJSON(Type.Value,obj["samplerBorderColor"]);
2573 tv.samplerMinLod = (Maybe<float>)fromJSON(Type.Maybe_Float,obj["samplerMinLod"]);
2574 tv.samplerMaxLod = (Maybe<float>)fromJSON(Type.Maybe_Float,obj["samplerMaxLod"]);
2575 tv.samplerLodBias = (float)fromJSON(Type.Float,obj["samplerLodBias"]);
2576 tv.samplerCompareFunc = (Maybe<global::LambdaCube.IR.ComparisonFunction>)fromJSON(Type.Maybe_ComparisonFunction,obj["samplerCompareFunc"]);
2577 return tv;
2578 }
2579 else throw new Exception("unknown constructor: " + tag);
2580 SamplerDescriptor o = new SamplerDescriptor();
2581 o.tag = tagType;
2582 return o;
2583 }
2584 case Type.TextureDescriptor: {
2585 string tag = (string)obj["tag"];
2586 TextureDescriptor.Tag tagType;
2587 if (tag == "TextureDescriptor") {
2588 tagType = TextureDescriptor.Tag.TextureDescriptor;
2589 data.TextureDescriptor tv = new data.TextureDescriptor();
2590 tv.textureType = (global::LambdaCube.IR.TextureType)fromJSON(Type.TextureType,obj["textureType"]);
2591 tv.textureSize = (global::LambdaCube.IR.Value)fromJSON(Type.Value,obj["textureSize"]);
2592 tv.textureSemantic = (global::LambdaCube.IR.ImageSemantic)fromJSON(Type.ImageSemantic,obj["textureSemantic"]);
2593 tv.textureSampler = (global::LambdaCube.IR.SamplerDescriptor)fromJSON(Type.SamplerDescriptor,obj["textureSampler"]);
2594 tv.textureBaseLevel = (int)fromJSON(Type.Int,obj["textureBaseLevel"]);
2595 tv.textureMaxLevel = (int)fromJSON(Type.Int,obj["textureMaxLevel"]);
2596 return tv;
2597 }
2598 else throw new Exception("unknown constructor: " + tag);
2599 TextureDescriptor o = new TextureDescriptor();
2600 o.tag = tagType;
2601 return o;
2602 }
2603 case Type.Parameter: {
2604 string tag = (string)obj["tag"];
2605 Parameter.Tag tagType;
2606 if (tag == "Parameter") {
2607 tagType = Parameter.Tag.Parameter;
2608 data.Parameter tv = new data.Parameter();
2609 tv.name = (string)fromJSON(Type.String,obj["name"]);
2610 tv.ty = (global::LambdaCube.IR.InputType)fromJSON(Type.InputType,obj["ty"]);
2611 return tv;
2612 }
2613 else throw new Exception("unknown constructor: " + tag);
2614 Parameter o = new Parameter();
2615 o.tag = tagType;
2616 return o;
2617 }
2618 case Type.Program: {
2619 string tag = (string)obj["tag"];
2620 Program.Tag tagType;
2621 if (tag == "Program") {
2622 tagType = Program.Tag.Program;
2623 data.Program tv = new data.Program();
2624 tv.programUniforms = (Dictionary<string, global::LambdaCube.IR.InputType>)fromJSON(Type.Map_String_InputType,obj["programUniforms"]);
2625 tv.programStreams = (Dictionary<string, global::LambdaCube.IR.Parameter>)fromJSON(Type.Map_String_Parameter,obj["programStreams"]);
2626 tv.programInTextures = (Dictionary<string, global::LambdaCube.IR.InputType>)fromJSON(Type.Map_String_InputType,obj["programInTextures"]);
2627 tv.programOutput = (List<global::LambdaCube.IR.Parameter>)fromJSON(Type.Array_Parameter,obj["programOutput"]);
2628 tv.vertexShader = (string)fromJSON(Type.String,obj["vertexShader"]);
2629 tv.geometryShader = (Maybe<string>)fromJSON(Type.Maybe_String,obj["geometryShader"]);
2630 tv.fragmentShader = (string)fromJSON(Type.String,obj["fragmentShader"]);
2631 return tv;
2632 }
2633 else throw new Exception("unknown constructor: " + tag);
2634 Program o = new Program();
2635 o.tag = tagType;
2636 return o;
2637 }
2638 case Type.Slot: {
2639 string tag = (string)obj["tag"];
2640 Slot.Tag tagType;
2641 if (tag == "Slot") {
2642 tagType = Slot.Tag.Slot;
2643 data.Slot tv = new data.Slot();
2644 tv.slotName = (string)fromJSON(Type.String,obj["slotName"]);
2645 tv.slotStreams = (Dictionary<string, global::LambdaCube.IR.InputType>)fromJSON(Type.Map_String_InputType,obj["slotStreams"]);
2646 tv.slotUniforms = (Dictionary<string, global::LambdaCube.IR.InputType>)fromJSON(Type.Map_String_InputType,obj["slotUniforms"]);
2647 tv.slotPrimitive = (global::LambdaCube.IR.FetchPrimitive)fromJSON(Type.FetchPrimitive,obj["slotPrimitive"]);
2648 tv.slotPrograms = (List<int>)fromJSON(Type.Array_Int,obj["slotPrograms"]);
2649 return tv;
2650 }
2651 else throw new Exception("unknown constructor: " + tag);
2652 Slot o = new Slot();
2653 o.tag = tagType;
2654 return o;
2655 }
2656 case Type.StreamData: {
2657 string tag = (string)obj["tag"];
2658 StreamData.Tag tagType;
2659 if (tag == "StreamData") {
2660 tagType = StreamData.Tag.StreamData;
2661 data.StreamData tv = new data.StreamData();
2662 tv.streamData = (Dictionary<string, global::LambdaCube.IR.ArrayValue>)fromJSON(Type.Map_String_ArrayValue,obj["streamData"]);
2663 tv.streamType = (Dictionary<string, global::LambdaCube.IR.InputType>)fromJSON(Type.Map_String_InputType,obj["streamType"]);
2664 tv.streamPrimitive = (global::LambdaCube.IR.FetchPrimitive)fromJSON(Type.FetchPrimitive,obj["streamPrimitive"]);
2665 tv.streamPrograms = (List<int>)fromJSON(Type.Array_Int,obj["streamPrograms"]);
2666 return tv;
2667 }
2668 else throw new Exception("unknown constructor: " + tag);
2669 StreamData o = new StreamData();
2670 o.tag = tagType;
2671 return o;
2672 }
2673 case Type.TargetItem: {
2674 string tag = (string)obj["tag"];
2675 TargetItem.Tag tagType;
2676 if (tag == "TargetItem") {
2677 tagType = TargetItem.Tag.TargetItem;
2678 data.TargetItem tv = new data.TargetItem();
2679 tv.targetSemantic = (global::LambdaCube.IR.ImageSemantic)fromJSON(Type.ImageSemantic,obj["targetSemantic"]);
2680 tv.targetRef = (Maybe<global::LambdaCube.IR.ImageRef>)fromJSON(Type.Maybe_ImageRef,obj["targetRef"]);
2681 return tv;
2682 }
2683 else throw new Exception("unknown constructor: " + tag);
2684 TargetItem o = new TargetItem();
2685 o.tag = tagType;
2686 return o;
2687 }
2688 case Type.RenderTarget: {
2689 string tag = (string)obj["tag"];
2690 RenderTarget.Tag tagType;
2691 if (tag == "RenderTarget") {
2692 tagType = RenderTarget.Tag.RenderTarget;
2693 data.RenderTarget tv = new data.RenderTarget();
2694 tv.renderTargets = (List<global::LambdaCube.IR.TargetItem>)fromJSON(Type.Array_TargetItem,obj["renderTargets"]);
2695 return tv;
2696 }
2697 else throw new Exception("unknown constructor: " + tag);
2698 RenderTarget o = new RenderTarget();
2699 o.tag = tagType;
2700 return o;
2701 }
2702 case Type.Backend: {
2703 string tag = (string)obj["tag"];
2704 Backend.Tag tagType;
2705 if (tag == "WebGL1") {
2706 tagType = Backend.Tag.WebGL1;
2707 }
2708 else if (tag == "OpenGL33") {
2709 tagType = Backend.Tag.OpenGL33;
2710 }
2711 else throw new Exception("unknown constructor: " + tag);
2712 Backend o = new Backend();
2713 o.tag = tagType;
2714 return o;
2715 }
2716 case Type.Pipeline: {
2717 string tag = (string)obj["tag"];
2718 Pipeline.Tag tagType;
2719 if (tag == "Pipeline") {
2720 tagType = Pipeline.Tag.Pipeline;
2721 data.Pipeline tv = new data.Pipeline();
2722 tv.info = (string)fromJSON(Type.String,obj["info"]);
2723 tv.backend = (global::LambdaCube.IR.Backend)fromJSON(Type.Backend,obj["backend"]);
2724 tv.textures = (List<global::LambdaCube.IR.TextureDescriptor>)fromJSON(Type.Array_TextureDescriptor,obj["textures"]);
2725 tv.samplers = (List<global::LambdaCube.IR.SamplerDescriptor>)fromJSON(Type.Array_SamplerDescriptor,obj["samplers"]);
2726 tv.targets = (List<global::LambdaCube.IR.RenderTarget>)fromJSON(Type.Array_RenderTarget,obj["targets"]);
2727 tv.programs = (List<global::LambdaCube.IR.Program>)fromJSON(Type.Array_Program,obj["programs"]);
2728 tv.slots = (List<global::LambdaCube.IR.Slot>)fromJSON(Type.Array_Slot,obj["slots"]);
2729 tv.streams = (List<global::LambdaCube.IR.StreamData>)fromJSON(Type.Array_StreamData,obj["streams"]);
2730 tv.commands = (List<global::LambdaCube.IR.Command>)fromJSON(Type.Array_Command,obj["commands"]);
2731 return tv;
2732 }
2733 else throw new Exception("unknown constructor: " + tag);
2734 Pipeline o = new Pipeline();
2735 o.tag = tagType;
2736 return o;
2737 }
2738 }
2739 throw new Exception("unknown type");
2740 return null;
2741 }
2742
2743 JToken toJSON(ArrayValue v) {
2744 var obj = new JObject();
2745 switch (v.tag) {
2746 case ArrayValue.Tag.VBoolArray:
2747 obj["tag"] = "VBoolArray";
2748 {
2749 var tv = (data.VBoolArray)v;
2750 obj["arg0"] = toJSON(tv._0);
2751 }
2752 break;
2753 case ArrayValue.Tag.VIntArray:
2754 obj["tag"] = "VIntArray";
2755 {
2756 var tv = (data.VIntArray)v;
2757 obj["arg0"] = toJSON(tv._0);
2758 }
2759 break;
2760 case ArrayValue.Tag.VWordArray:
2761 obj["tag"] = "VWordArray";
2762 {
2763 var tv = (data.VWordArray)v;
2764 obj["arg0"] = toJSON(tv._0);
2765 }
2766 break;
2767 case ArrayValue.Tag.VFloatArray:
2768 obj["tag"] = "VFloatArray";
2769 {
2770 var tv = (data.VFloatArray)v;
2771 obj["arg0"] = toJSON(tv._0);
2772 }
2773 break;
2774 }
2775 return obj;
2776 }
2777 JToken toJSON(Value v) {
2778 var obj = new JObject();
2779 switch (v.tag) {
2780 case Value.Tag.VBool:
2781 obj["tag"] = "VBool";
2782 {
2783 var tv = (data.VBool)v;
2784 obj["arg0"] = toJSON(tv._0);
2785 }
2786 break;
2787 case Value.Tag.VV2B:
2788 obj["tag"] = "VV2B";
2789 {
2790 var tv = (data.VV2B)v;
2791 obj["arg0"] = toJSON(tv._0);
2792 }
2793 break;
2794 case Value.Tag.VV3B:
2795 obj["tag"] = "VV3B";
2796 {
2797 var tv = (data.VV3B)v;
2798 obj["arg0"] = toJSON(tv._0);
2799 }
2800 break;
2801 case Value.Tag.VV4B:
2802 obj["tag"] = "VV4B";
2803 {
2804 var tv = (data.VV4B)v;
2805 obj["arg0"] = toJSON(tv._0);
2806 }
2807 break;
2808 case Value.Tag.VWord:
2809 obj["tag"] = "VWord";
2810 {
2811 var tv = (data.VWord)v;
2812 obj["arg0"] = toJSON(tv._0);
2813 }
2814 break;
2815 case Value.Tag.VV2U:
2816 obj["tag"] = "VV2U";
2817 {
2818 var tv = (data.VV2U)v;
2819 obj["arg0"] = toJSON(tv._0);
2820 }
2821 break;
2822 case Value.Tag.VV3U:
2823 obj["tag"] = "VV3U";
2824 {
2825 var tv = (data.VV3U)v;
2826 obj["arg0"] = toJSON(tv._0);
2827 }
2828 break;
2829 case Value.Tag.VV4U:
2830 obj["tag"] = "VV4U";
2831 {
2832 var tv = (data.VV4U)v;
2833 obj["arg0"] = toJSON(tv._0);
2834 }
2835 break;
2836 case Value.Tag.VInt:
2837 obj["tag"] = "VInt";
2838 {
2839 var tv = (data.VInt)v;
2840 obj["arg0"] = toJSON(tv._0);
2841 }
2842 break;
2843 case Value.Tag.VV2I:
2844 obj["tag"] = "VV2I";
2845 {
2846 var tv = (data.VV2I)v;
2847 obj["arg0"] = toJSON(tv._0);
2848 }
2849 break;
2850 case Value.Tag.VV3I:
2851 obj["tag"] = "VV3I";
2852 {
2853 var tv = (data.VV3I)v;
2854 obj["arg0"] = toJSON(tv._0);
2855 }
2856 break;
2857 case Value.Tag.VV4I:
2858 obj["tag"] = "VV4I";
2859 {
2860 var tv = (data.VV4I)v;
2861 obj["arg0"] = toJSON(tv._0);
2862 }
2863 break;
2864 case Value.Tag.VFloat:
2865 obj["tag"] = "VFloat";
2866 {
2867 var tv = (data.VFloat)v;
2868 obj["arg0"] = toJSON(tv._0);
2869 }
2870 break;
2871 case Value.Tag.VV2F:
2872 obj["tag"] = "VV2F";
2873 {
2874 var tv = (data.VV2F)v;
2875 obj["arg0"] = toJSON(tv._0);
2876 }
2877 break;
2878 case Value.Tag.VV3F:
2879 obj["tag"] = "VV3F";
2880 {
2881 var tv = (data.VV3F)v;
2882 obj["arg0"] = toJSON(tv._0);
2883 }
2884 break;
2885 case Value.Tag.VV4F:
2886 obj["tag"] = "VV4F";
2887 {
2888 var tv = (data.VV4F)v;
2889 obj["arg0"] = toJSON(tv._0);
2890 }
2891 break;
2892 case Value.Tag.VM22F:
2893 obj["tag"] = "VM22F";
2894 {
2895 var tv = (data.VM22F)v;
2896 obj["arg0"] = toJSON(tv._0);
2897 }
2898 break;
2899 case Value.Tag.VM23F:
2900 obj["tag"] = "VM23F";
2901 {
2902 var tv = (data.VM23F)v;
2903 obj["arg0"] = toJSON(tv._0);
2904 }
2905 break;
2906 case Value.Tag.VM24F:
2907 obj["tag"] = "VM24F";
2908 {
2909 var tv = (data.VM24F)v;
2910 obj["arg0"] = toJSON(tv._0);
2911 }
2912 break;
2913 case Value.Tag.VM32F:
2914 obj["tag"] = "VM32F";
2915 {
2916 var tv = (data.VM32F)v;
2917 obj["arg0"] = toJSON(tv._0);
2918 }
2919 break;
2920 case Value.Tag.VM33F:
2921 obj["tag"] = "VM33F";
2922 {
2923 var tv = (data.VM33F)v;
2924 obj["arg0"] = toJSON(tv._0);
2925 }
2926 break;
2927 case Value.Tag.VM34F:
2928 obj["tag"] = "VM34F";
2929 {
2930 var tv = (data.VM34F)v;
2931 obj["arg0"] = toJSON(tv._0);
2932 }
2933 break;
2934 case Value.Tag.VM42F:
2935 obj["tag"] = "VM42F";
2936 {
2937 var tv = (data.VM42F)v;
2938 obj["arg0"] = toJSON(tv._0);
2939 }
2940 break;
2941 case Value.Tag.VM43F:
2942 obj["tag"] = "VM43F";
2943 {
2944 var tv = (data.VM43F)v;
2945 obj["arg0"] = toJSON(tv._0);
2946 }
2947 break;
2948 case Value.Tag.VM44F:
2949 obj["tag"] = "VM44F";
2950 {
2951 var tv = (data.VM44F)v;
2952 obj["arg0"] = toJSON(tv._0);
2953 }
2954 break;
2955 }
2956 return obj;
2957 }
2958 JToken toJSON(InputType v) {
2959 var obj = new JObject();
2960 switch (v.tag) {
2961 case InputType.Tag.Bool:
2962 obj["tag"] = "Bool";
2963 break;
2964 case InputType.Tag.V2B:
2965 obj["tag"] = "V2B";
2966 break;
2967 case InputType.Tag.V3B:
2968 obj["tag"] = "V3B";
2969 break;
2970 case InputType.Tag.V4B:
2971 obj["tag"] = "V4B";
2972 break;
2973 case InputType.Tag.Word:
2974 obj["tag"] = "Word";
2975 break;
2976 case InputType.Tag.V2U:
2977 obj["tag"] = "V2U";
2978 break;
2979 case InputType.Tag.V3U:
2980 obj["tag"] = "V3U";
2981 break;
2982 case InputType.Tag.V4U:
2983 obj["tag"] = "V4U";
2984 break;
2985 case InputType.Tag.Int:
2986 obj["tag"] = "Int";
2987 break;
2988 case InputType.Tag.V2I:
2989 obj["tag"] = "V2I";
2990 break;
2991 case InputType.Tag.V3I:
2992 obj["tag"] = "V3I";
2993 break;
2994 case InputType.Tag.V4I:
2995 obj["tag"] = "V4I";
2996 break;
2997 case InputType.Tag.Float:
2998 obj["tag"] = "Float";
2999 break;
3000 case InputType.Tag.V2F:
3001 obj["tag"] = "V2F";
3002 break;
3003 case InputType.Tag.V3F:
3004 obj["tag"] = "V3F";
3005 break;
3006 case InputType.Tag.V4F:
3007 obj["tag"] = "V4F";
3008 break;
3009 case InputType.Tag.M22F:
3010 obj["tag"] = "M22F";
3011 break;
3012 case InputType.Tag.M23F:
3013 obj["tag"] = "M23F";
3014 break;
3015 case InputType.Tag.M24F:
3016 obj["tag"] = "M24F";
3017 break;
3018 case InputType.Tag.M32F:
3019 obj["tag"] = "M32F";
3020 break;
3021 case InputType.Tag.M33F:
3022 obj["tag"] = "M33F";
3023 break;
3024 case InputType.Tag.M34F:
3025 obj["tag"] = "M34F";
3026 break;
3027 case InputType.Tag.M42F:
3028 obj["tag"] = "M42F";
3029 break;
3030 case InputType.Tag.M43F:
3031 obj["tag"] = "M43F";
3032 break;
3033 case InputType.Tag.M44F:
3034 obj["tag"] = "M44F";
3035 break;
3036 case InputType.Tag.STexture1D:
3037 obj["tag"] = "STexture1D";
3038 break;
3039 case InputType.Tag.STexture2D:
3040 obj["tag"] = "STexture2D";
3041 break;
3042 case InputType.Tag.STextureCube:
3043 obj["tag"] = "STextureCube";
3044 break;
3045 case InputType.Tag.STexture1DArray:
3046 obj["tag"] = "STexture1DArray";
3047 break;
3048 case InputType.Tag.STexture2DArray:
3049 obj["tag"] = "STexture2DArray";
3050 break;
3051 case InputType.Tag.STexture2DRect:
3052 obj["tag"] = "STexture2DRect";
3053 break;
3054 case InputType.Tag.FTexture1D:
3055 obj["tag"] = "FTexture1D";
3056 break;
3057 case InputType.Tag.FTexture2D:
3058 obj["tag"] = "FTexture2D";
3059 break;
3060 case InputType.Tag.FTexture3D:
3061 obj["tag"] = "FTexture3D";
3062 break;
3063 case InputType.Tag.FTextureCube:
3064 obj["tag"] = "FTextureCube";
3065 break;
3066 case InputType.Tag.FTexture1DArray:
3067 obj["tag"] = "FTexture1DArray";
3068 break;
3069 case InputType.Tag.FTexture2DArray:
3070 obj["tag"] = "FTexture2DArray";
3071 break;
3072 case InputType.Tag.FTexture2DMS:
3073 obj["tag"] = "FTexture2DMS";
3074 break;
3075 case InputType.Tag.FTexture2DMSArray:
3076 obj["tag"] = "FTexture2DMSArray";
3077 break;
3078 case InputType.Tag.FTextureBuffer:
3079 obj["tag"] = "FTextureBuffer";
3080 break;
3081 case InputType.Tag.FTexture2DRect:
3082 obj["tag"] = "FTexture2DRect";
3083 break;
3084 case InputType.Tag.ITexture1D:
3085 obj["tag"] = "ITexture1D";
3086 break;
3087 case InputType.Tag.ITexture2D:
3088 obj["tag"] = "ITexture2D";
3089 break;
3090 case InputType.Tag.ITexture3D:
3091 obj["tag"] = "ITexture3D";
3092 break;
3093 case InputType.Tag.ITextureCube:
3094 obj["tag"] = "ITextureCube";
3095 break;
3096 case InputType.Tag.ITexture1DArray:
3097 obj["tag"] = "ITexture1DArray";
3098 break;
3099 case InputType.Tag.ITexture2DArray:
3100 obj["tag"] = "ITexture2DArray";
3101 break;
3102 case InputType.Tag.ITexture2DMS:
3103 obj["tag"] = "ITexture2DMS";
3104 break;
3105 case InputType.Tag.ITexture2DMSArray:
3106 obj["tag"] = "ITexture2DMSArray";
3107 break;
3108 case InputType.Tag.ITextureBuffer:
3109 obj["tag"] = "ITextureBuffer";
3110 break;
3111 case InputType.Tag.ITexture2DRect:
3112 obj["tag"] = "ITexture2DRect";
3113 break;
3114 case InputType.Tag.UTexture1D:
3115 obj["tag"] = "UTexture1D";
3116 break;
3117 case InputType.Tag.UTexture2D:
3118 obj["tag"] = "UTexture2D";
3119 break;
3120 case InputType.Tag.UTexture3D:
3121 obj["tag"] = "UTexture3D";
3122 break;
3123 case InputType.Tag.UTextureCube:
3124 obj["tag"] = "UTextureCube";
3125 break;
3126 case InputType.Tag.UTexture1DArray:
3127 obj["tag"] = "UTexture1DArray";
3128 break;
3129 case InputType.Tag.UTexture2DArray:
3130 obj["tag"] = "UTexture2DArray";
3131 break;
3132 case InputType.Tag.UTexture2DMS:
3133 obj["tag"] = "UTexture2DMS";
3134 break;
3135 case InputType.Tag.UTexture2DMSArray:
3136 obj["tag"] = "UTexture2DMSArray";
3137 break;
3138 case InputType.Tag.UTextureBuffer:
3139 obj["tag"] = "UTextureBuffer";
3140 break;
3141 case InputType.Tag.UTexture2DRect:
3142 obj["tag"] = "UTexture2DRect";
3143 break;
3144 }
3145 return obj;
3146 }
3147 JToken toJSON(PointSpriteCoordOrigin v) {
3148 var obj = new JObject();
3149 switch (v.tag) {
3150 case PointSpriteCoordOrigin.Tag.LowerLeft:
3151 obj["tag"] = "LowerLeft";
3152 break;
3153 case PointSpriteCoordOrigin.Tag.UpperLeft:
3154 obj["tag"] = "UpperLeft";
3155 break;
3156 }
3157 return obj;
3158 }
3159 JToken toJSON(PointSize v) {
3160 var obj = new JObject();
3161 switch (v.tag) {
3162 case PointSize.Tag.PointSize:
3163 obj["tag"] = "PointSize";
3164 {
3165 var tv = (data.PointSize)v;
3166 obj["arg0"] = toJSON(tv._0);
3167 }
3168 break;
3169 case PointSize.Tag.ProgramPointSize:
3170 obj["tag"] = "ProgramPointSize";
3171 break;
3172 }
3173 return obj;
3174 }
3175 JToken toJSON(PolygonOffset v) {
3176 var obj = new JObject();
3177 switch (v.tag) {
3178 case PolygonOffset.Tag.NoOffset:
3179 obj["tag"] = "NoOffset";
3180 break;
3181 case PolygonOffset.Tag.Offset:
3182 obj["tag"] = "Offset";
3183 {
3184 var tv = (data.Offset)v;
3185 obj["arg0"] = toJSON(tv._0);
3186 obj["arg1"] = toJSON(tv._1);
3187 }
3188 break;
3189 }
3190 return obj;
3191 }
3192 JToken toJSON(FrontFace v) {
3193 var obj = new JObject();
3194 switch (v.tag) {
3195 case FrontFace.Tag.CCW:
3196 obj["tag"] = "CCW";
3197 break;
3198 case FrontFace.Tag.CW:
3199 obj["tag"] = "CW";
3200 break;
3201 }
3202 return obj;
3203 }
3204 JToken toJSON(PolygonMode v) {
3205 var obj = new JObject();
3206 switch (v.tag) {
3207 case PolygonMode.Tag.PolygonPoint:
3208 obj["tag"] = "PolygonPoint";
3209 {
3210 var tv = (data.PolygonPoint)v;
3211 obj["arg0"] = toJSON(tv._0);
3212 }
3213 break;
3214 case PolygonMode.Tag.PolygonLine:
3215 obj["tag"] = "PolygonLine";
3216 {
3217 var tv = (data.PolygonLine)v;
3218 obj["arg0"] = toJSON(tv._0);
3219 }
3220 break;
3221 case PolygonMode.Tag.PolygonFill:
3222 obj["tag"] = "PolygonFill";
3223 break;
3224 }
3225 return obj;
3226 }
3227 JToken toJSON(ProvokingVertex v) {
3228 var obj = new JObject();
3229 switch (v.tag) {
3230 case ProvokingVertex.Tag.FirstVertex:
3231 obj["tag"] = "FirstVertex";
3232 break;
3233 case ProvokingVertex.Tag.LastVertex:
3234 obj["tag"] = "LastVertex";
3235 break;
3236 }
3237 return obj;
3238 }
3239 JToken toJSON(CullMode v) {
3240 var obj = new JObject();
3241 switch (v.tag) {
3242 case CullMode.Tag.CullNone:
3243 obj["tag"] = "CullNone";
3244 break;
3245 case CullMode.Tag.CullFront:
3246 obj["tag"] = "CullFront";
3247 {
3248 var tv = (data.CullFront)v;
3249 obj["arg0"] = toJSON(tv._0);
3250 }
3251 break;
3252 case CullMode.Tag.CullBack:
3253 obj["tag"] = "CullBack";
3254 {
3255 var tv = (data.CullBack)v;
3256 obj["arg0"] = toJSON(tv._0);
3257 }
3258 break;
3259 }
3260 return obj;
3261 }
3262 JToken toJSON(ComparisonFunction v) {
3263 var obj = new JObject();
3264 switch (v.tag) {
3265 case ComparisonFunction.Tag.Never:
3266 obj["tag"] = "Never";
3267 break;
3268 case ComparisonFunction.Tag.Less:
3269 obj["tag"] = "Less";
3270 break;
3271 case ComparisonFunction.Tag.Equal:
3272 obj["tag"] = "Equal";
3273 break;
3274 case ComparisonFunction.Tag.Lequal:
3275 obj["tag"] = "Lequal";
3276 break;
3277 case ComparisonFunction.Tag.Greater:
3278 obj["tag"] = "Greater";
3279 break;
3280 case ComparisonFunction.Tag.Notequal:
3281 obj["tag"] = "Notequal";
3282 break;
3283 case ComparisonFunction.Tag.Gequal:
3284 obj["tag"] = "Gequal";
3285 break;
3286 case ComparisonFunction.Tag.Always:
3287 obj["tag"] = "Always";
3288 break;
3289 }
3290 return obj;
3291 }
3292 JToken toJSON(StencilOperation v) {
3293 var obj = new JObject();
3294 switch (v.tag) {
3295 case StencilOperation.Tag.OpZero:
3296 obj["tag"] = "OpZero";
3297 break;
3298 case StencilOperation.Tag.OpKeep:
3299 obj["tag"] = "OpKeep";
3300 break;
3301 case StencilOperation.Tag.OpReplace:
3302 obj["tag"] = "OpReplace";
3303 break;
3304 case StencilOperation.Tag.OpIncr:
3305 obj["tag"] = "OpIncr";
3306 break;
3307 case StencilOperation.Tag.OpIncrWrap:
3308 obj["tag"] = "OpIncrWrap";
3309 break;
3310 case StencilOperation.Tag.OpDecr:
3311 obj["tag"] = "OpDecr";
3312 break;
3313 case StencilOperation.Tag.OpDecrWrap:
3314 obj["tag"] = "OpDecrWrap";
3315 break;
3316 case StencilOperation.Tag.OpInvert:
3317 obj["tag"] = "OpInvert";
3318 break;
3319 }
3320 return obj;
3321 }
3322 JToken toJSON(BlendEquation v) {
3323 var obj = new JObject();
3324 switch (v.tag) {
3325 case BlendEquation.Tag.FuncAdd:
3326 obj["tag"] = "FuncAdd";
3327 break;
3328 case BlendEquation.Tag.FuncSubtract:
3329 obj["tag"] = "FuncSubtract";
3330 break;
3331 case BlendEquation.Tag.FuncReverseSubtract:
3332 obj["tag"] = "FuncReverseSubtract";
3333 break;
3334 case BlendEquation.Tag.Min:
3335 obj["tag"] = "Min";
3336 break;
3337 case BlendEquation.Tag.Max:
3338 obj["tag"] = "Max";
3339 break;
3340 }
3341 return obj;
3342 }
3343 JToken toJSON(BlendingFactor v) {
3344 var obj = new JObject();
3345 switch (v.tag) {
3346 case BlendingFactor.Tag.Zero:
3347 obj["tag"] = "Zero";
3348 break;
3349 case BlendingFactor.Tag.One:
3350 obj["tag"] = "One";
3351 break;
3352 case BlendingFactor.Tag.SrcColor:
3353 obj["tag"] = "SrcColor";
3354 break;
3355 case BlendingFactor.Tag.OneMinusSrcColor:
3356 obj["tag"] = "OneMinusSrcColor";
3357 break;
3358 case BlendingFactor.Tag.DstColor:
3359 obj["tag"] = "DstColor";
3360 break;
3361 case BlendingFactor.Tag.OneMinusDstColor:
3362 obj["tag"] = "OneMinusDstColor";
3363 break;
3364 case BlendingFactor.Tag.SrcAlpha:
3365 obj["tag"] = "SrcAlpha";
3366 break;
3367 case BlendingFactor.Tag.OneMinusSrcAlpha:
3368 obj["tag"] = "OneMinusSrcAlpha";
3369 break;
3370 case BlendingFactor.Tag.DstAlpha:
3371 obj["tag"] = "DstAlpha";
3372 break;
3373 case BlendingFactor.Tag.OneMinusDstAlpha:
3374 obj["tag"] = "OneMinusDstAlpha";
3375 break;
3376 case BlendingFactor.Tag.ConstantColor:
3377 obj["tag"] = "ConstantColor";
3378 break;
3379 case BlendingFactor.Tag.OneMinusConstantColor:
3380 obj["tag"] = "OneMinusConstantColor";
3381 break;
3382 case BlendingFactor.Tag.ConstantAlpha:
3383 obj["tag"] = "ConstantAlpha";
3384 break;
3385 case BlendingFactor.Tag.OneMinusConstantAlpha:
3386 obj["tag"] = "OneMinusConstantAlpha";
3387 break;
3388 case BlendingFactor.Tag.SrcAlphaSaturate:
3389 obj["tag"] = "SrcAlphaSaturate";
3390 break;
3391 }
3392 return obj;
3393 }
3394 JToken toJSON(LogicOperation v) {
3395 var obj = new JObject();
3396 switch (v.tag) {
3397 case LogicOperation.Tag.Clear:
3398 obj["tag"] = "Clear";
3399 break;
3400 case LogicOperation.Tag.And:
3401 obj["tag"] = "And";
3402 break;
3403 case LogicOperation.Tag.AndReverse:
3404 obj["tag"] = "AndReverse";
3405 break;
3406 case LogicOperation.Tag.Copy:
3407 obj["tag"] = "Copy";
3408 break;
3409 case LogicOperation.Tag.AndInverted:
3410 obj["tag"] = "AndInverted";
3411 break;
3412 case LogicOperation.Tag.Noop:
3413 obj["tag"] = "Noop";
3414 break;
3415 case LogicOperation.Tag.Xor:
3416 obj["tag"] = "Xor";
3417 break;
3418 case LogicOperation.Tag.Or:
3419 obj["tag"] = "Or";
3420 break;
3421 case LogicOperation.Tag.Nor:
3422 obj["tag"] = "Nor";
3423 break;
3424 case LogicOperation.Tag.Equiv:
3425 obj["tag"] = "Equiv";
3426 break;
3427 case LogicOperation.Tag.Invert:
3428 obj["tag"] = "Invert";
3429 break;
3430 case LogicOperation.Tag.OrReverse:
3431 obj["tag"] = "OrReverse";
3432 break;
3433 case LogicOperation.Tag.CopyInverted:
3434 obj["tag"] = "CopyInverted";
3435 break;
3436 case LogicOperation.Tag.OrInverted:
3437 obj["tag"] = "OrInverted";
3438 break;
3439 case LogicOperation.Tag.Nand:
3440 obj["tag"] = "Nand";
3441 break;
3442 case LogicOperation.Tag.Set:
3443 obj["tag"] = "Set";
3444 break;
3445 }
3446 return obj;
3447 }
3448 JToken toJSON(StencilOps v) {
3449 var obj = new JObject();
3450 switch (v.tag) {
3451 case StencilOps.Tag.StencilOps:
3452 obj["tag"] = "StencilOps";
3453 {
3454 var tv = (data.StencilOps)v;
3455 obj["frontStencilOp"] = toJSON(tv.frontStencilOp);
3456 obj["backStencilOp"] = toJSON(tv.backStencilOp);
3457 }
3458 break;
3459 }
3460 return obj;
3461 }
3462 JToken toJSON(StencilTest v) {
3463 var obj = new JObject();
3464 switch (v.tag) {
3465 case StencilTest.Tag.StencilTest:
3466 obj["tag"] = "StencilTest";
3467 {
3468 var tv = (data.StencilTest)v;
3469 obj["stencilComparision"] = toJSON(tv.stencilComparision);
3470 obj["stencilReference"] = toJSON(tv.stencilReference);
3471 obj["stencilMask"] = toJSON(tv.stencilMask);
3472 }
3473 break;
3474 }
3475 return obj;
3476 }
3477 JToken toJSON(StencilTests v) {
3478 var obj = new JObject();
3479 switch (v.tag) {
3480 case StencilTests.Tag.StencilTests:
3481 obj["tag"] = "StencilTests";
3482 {
3483 var tv = (data.StencilTests)v;
3484 obj["arg0"] = toJSON(tv._0);
3485 obj["arg1"] = toJSON(tv._1);
3486 }
3487 break;
3488 }
3489 return obj;
3490 }
3491 JToken toJSON(FetchPrimitive v) {
3492 var obj = new JObject();
3493 switch (v.tag) {
3494 case FetchPrimitive.Tag.Points:
3495 obj["tag"] = "Points";
3496 break;
3497 case FetchPrimitive.Tag.Lines:
3498 obj["tag"] = "Lines";
3499 break;
3500 case FetchPrimitive.Tag.Triangles:
3501 obj["tag"] = "Triangles";
3502 break;
3503 case FetchPrimitive.Tag.LinesAdjacency:
3504 obj["tag"] = "LinesAdjacency";
3505 break;
3506 case FetchPrimitive.Tag.TrianglesAdjacency:
3507 obj["tag"] = "TrianglesAdjacency";
3508 break;
3509 }
3510 return obj;
3511 }
3512 JToken toJSON(OutputPrimitive v) {
3513 var obj = new JObject();
3514 switch (v.tag) {
3515 case OutputPrimitive.Tag.TrianglesOutput:
3516 obj["tag"] = "TrianglesOutput";
3517 break;
3518 case OutputPrimitive.Tag.LinesOutput:
3519 obj["tag"] = "LinesOutput";
3520 break;
3521 case OutputPrimitive.Tag.PointsOutput:
3522 obj["tag"] = "PointsOutput";
3523 break;
3524 }
3525 return obj;
3526 }
3527 JToken toJSON(ColorArity v) {
3528 var obj = new JObject();
3529 switch (v.tag) {
3530 case ColorArity.Tag.Red:
3531 obj["tag"] = "Red";
3532 break;
3533 case ColorArity.Tag.RG:
3534 obj["tag"] = "RG";
3535 break;
3536 case ColorArity.Tag.RGB:
3537 obj["tag"] = "RGB";
3538 break;
3539 case ColorArity.Tag.RGBA:
3540 obj["tag"] = "RGBA";
3541 break;
3542 }
3543 return obj;
3544 }
3545 JToken toJSON(Blending v) {
3546 var obj = new JObject();
3547 switch (v.tag) {
3548 case Blending.Tag.NoBlending:
3549 obj["tag"] = "NoBlending";
3550 break;
3551 case Blending.Tag.BlendLogicOp:
3552 obj["tag"] = "BlendLogicOp";
3553 {
3554 var tv = (data.BlendLogicOp)v;
3555 obj["arg0"] = toJSON(tv._0);
3556 }
3557 break;
3558 case Blending.Tag.Blend:
3559 obj["tag"] = "Blend";
3560 {
3561 var tv = (data.Blend)v;
3562 obj["colorEqSrc"] = toJSON(tv.colorEqSrc);
3563 obj["alphaEqSrc"] = toJSON(tv.alphaEqSrc);
3564 obj["colorFSrc"] = toJSON(tv.colorFSrc);
3565 obj["colorFDst"] = toJSON(tv.colorFDst);
3566 obj["alphaFSrc"] = toJSON(tv.alphaFSrc);
3567 obj["alphaFDst"] = toJSON(tv.alphaFDst);
3568 obj["color"] = toJSON(tv.color);
3569 }
3570 break;
3571 }
3572 return obj;
3573 }
3574 JToken toJSON(RasterContext v) {
3575 var obj = new JObject();
3576 switch (v.tag) {
3577 case RasterContext.Tag.PointCtx:
3578 obj["tag"] = "PointCtx";
3579 {
3580 var tv = (data.PointCtx)v;
3581 obj["arg0"] = toJSON(tv._0);
3582 obj["arg1"] = toJSON(tv._1);
3583 obj["arg2"] = toJSON(tv._2);
3584 }
3585 break;
3586 case RasterContext.Tag.LineCtx:
3587 obj["tag"] = "LineCtx";
3588 {
3589 var tv = (data.LineCtx)v;
3590 obj["arg0"] = toJSON(tv._0);
3591 obj["arg1"] = toJSON(tv._1);
3592 }
3593 break;
3594 case RasterContext.Tag.TriangleCtx:
3595 obj["tag"] = "TriangleCtx";
3596 {
3597 var tv = (data.TriangleCtx)v;
3598 obj["arg0"] = toJSON(tv._0);
3599 obj["arg1"] = toJSON(tv._1);
3600 obj["arg2"] = toJSON(tv._2);
3601 obj["arg3"] = toJSON(tv._3);
3602 }
3603 break;
3604 }
3605 return obj;
3606 }
3607 JToken toJSON(FragmentOperation v) {
3608 var obj = new JObject();
3609 switch (v.tag) {
3610 case FragmentOperation.Tag.DepthOp:
3611 obj["tag"] = "DepthOp";
3612 {
3613 var tv = (data.DepthOp)v;
3614 obj["arg0"] = toJSON(tv._0);
3615 obj["arg1"] = toJSON(tv._1);
3616 }
3617 break;
3618 case FragmentOperation.Tag.StencilOp:
3619 obj["tag"] = "StencilOp";
3620 {
3621 var tv = (data.StencilOp)v;
3622 obj["arg0"] = toJSON(tv._0);
3623 obj["arg1"] = toJSON(tv._1);
3624 obj["arg2"] = toJSON(tv._2);
3625 }
3626 break;
3627 case FragmentOperation.Tag.ColorOp:
3628 obj["tag"] = "ColorOp";
3629 {
3630 var tv = (data.ColorOp)v;
3631 obj["arg0"] = toJSON(tv._0);
3632 obj["arg1"] = toJSON(tv._1);
3633 }
3634 break;
3635 }
3636 return obj;
3637 }
3638 JToken toJSON(AccumulationContext v) {
3639 var obj = new JObject();
3640 switch (v.tag) {
3641 case AccumulationContext.Tag.AccumulationContext:
3642 obj["tag"] = "AccumulationContext";
3643 {
3644 var tv = (data.AccumulationContext)v;
3645 obj["accViewportName"] = toJSON(tv.accViewportName);
3646 obj["accOperations"] = toJSON(tv.accOperations);
3647 }
3648 break;
3649 }
3650 return obj;
3651 }
3652 JToken toJSON(TextureDataType v) {
3653 var obj = new JObject();
3654 switch (v.tag) {
3655 case TextureDataType.Tag.FloatT:
3656 obj["tag"] = "FloatT";
3657 {
3658 var tv = (data.FloatT)v;
3659 obj["arg0"] = toJSON(tv._0);
3660 }
3661 break;
3662 case TextureDataType.Tag.IntT:
3663 obj["tag"] = "IntT";
3664 {
3665 var tv = (data.IntT)v;
3666 obj["arg0"] = toJSON(tv._0);
3667 }
3668 break;
3669 case TextureDataType.Tag.WordT:
3670 obj["tag"] = "WordT";
3671 {
3672 var tv = (data.WordT)v;
3673 obj["arg0"] = toJSON(tv._0);
3674 }
3675 break;
3676 case TextureDataType.Tag.ShadowT:
3677 obj["tag"] = "ShadowT";
3678 break;
3679 }
3680 return obj;
3681 }
3682 JToken toJSON(TextureType v) {
3683 var obj = new JObject();
3684 switch (v.tag) {
3685 case TextureType.Tag.Texture1D:
3686 obj["tag"] = "Texture1D";
3687 {
3688 var tv = (data.Texture1D)v;
3689 obj["arg0"] = toJSON(tv._0);
3690 obj["arg1"] = toJSON(tv._1);
3691 }
3692 break;
3693 case TextureType.Tag.Texture2D:
3694 obj["tag"] = "Texture2D";
3695 {
3696 var tv = (data.Texture2D)v;
3697 obj["arg0"] = toJSON(tv._0);
3698 obj["arg1"] = toJSON(tv._1);
3699 }
3700 break;
3701 case TextureType.Tag.Texture3D:
3702 obj["tag"] = "Texture3D";
3703 {
3704 var tv = (data.Texture3D)v;
3705 obj["arg0"] = toJSON(tv._0);
3706 }
3707 break;
3708 case TextureType.Tag.TextureCube:
3709 obj["tag"] = "TextureCube";
3710 {
3711 var tv = (data.TextureCube)v;
3712 obj["arg0"] = toJSON(tv._0);
3713 }
3714 break;
3715 case TextureType.Tag.TextureRect:
3716 obj["tag"] = "TextureRect";
3717 {
3718 var tv = (data.TextureRect)v;
3719 obj["arg0"] = toJSON(tv._0);
3720 }
3721 break;
3722 case TextureType.Tag.Texture2DMS:
3723 obj["tag"] = "Texture2DMS";
3724 {
3725 var tv = (data.Texture2DMS)v;
3726 obj["arg0"] = toJSON(tv._0);
3727 obj["arg1"] = toJSON(tv._1);
3728 obj["arg2"] = toJSON(tv._2);
3729 obj["arg3"] = toJSON(tv._3);
3730 }
3731 break;
3732 case TextureType.Tag.TextureBuffer:
3733 obj["tag"] = "TextureBuffer";
3734 {
3735 var tv = (data.TextureBuffer)v;
3736 obj["arg0"] = toJSON(tv._0);
3737 }
3738 break;
3739 }
3740 return obj;
3741 }
3742 JToken toJSON(MipMap v) {
3743 var obj = new JObject();
3744 switch (v.tag) {
3745 case MipMap.Tag.Mip:
3746 obj["tag"] = "Mip";
3747 {
3748 var tv = (data.Mip)v;
3749 obj["arg0"] = toJSON(tv._0);
3750 obj["arg1"] = toJSON(tv._1);
3751 }
3752 break;
3753 case MipMap.Tag.NoMip:
3754 obj["tag"] = "NoMip";
3755 break;
3756 case MipMap.Tag.AutoMip:
3757 obj["tag"] = "AutoMip";
3758 {
3759 var tv = (data.AutoMip)v;
3760 obj["arg0"] = toJSON(tv._0);
3761 obj["arg1"] = toJSON(tv._1);
3762 }
3763 break;
3764 }
3765 return obj;
3766 }
3767 JToken toJSON(Filter v) {
3768 var obj = new JObject();
3769 switch (v.tag) {
3770 case Filter.Tag.Nearest:
3771 obj["tag"] = "Nearest";
3772 break;
3773 case Filter.Tag.Linear:
3774 obj["tag"] = "Linear";
3775 break;
3776 case Filter.Tag.NearestMipmapNearest:
3777 obj["tag"] = "NearestMipmapNearest";
3778 break;
3779 case Filter.Tag.NearestMipmapLinear:
3780 obj["tag"] = "NearestMipmapLinear";
3781 break;
3782 case Filter.Tag.LinearMipmapNearest:
3783 obj["tag"] = "LinearMipmapNearest";
3784 break;
3785 case Filter.Tag.LinearMipmapLinear:
3786 obj["tag"] = "LinearMipmapLinear";
3787 break;
3788 }
3789 return obj;
3790 }
3791 JToken toJSON(EdgeMode v) {
3792 var obj = new JObject();
3793 switch (v.tag) {
3794 case EdgeMode.Tag.Repeat:
3795 obj["tag"] = "Repeat";
3796 break;
3797 case EdgeMode.Tag.MirroredRepeat:
3798 obj["tag"] = "MirroredRepeat";
3799 break;
3800 case EdgeMode.Tag.ClampToEdge:
3801 obj["tag"] = "ClampToEdge";
3802 break;
3803 case EdgeMode.Tag.ClampToBorder:
3804 obj["tag"] = "ClampToBorder";
3805 break;
3806 }
3807 return obj;
3808 }
3809 JToken toJSON(ImageSemantic v) {
3810 var obj = new JObject();
3811 switch (v.tag) {
3812 case ImageSemantic.Tag.Depth:
3813 obj["tag"] = "Depth";
3814 break;
3815 case ImageSemantic.Tag.Stencil:
3816 obj["tag"] = "Stencil";
3817 break;
3818 case ImageSemantic.Tag.Color:
3819 obj["tag"] = "Color";
3820 break;
3821 }
3822 return obj;
3823 }
3824 JToken toJSON(ImageRef v) {
3825 var obj = new JObject();
3826 switch (v.tag) {
3827 case ImageRef.Tag.TextureImage:
3828 obj["tag"] = "TextureImage";
3829 {
3830 var tv = (data.TextureImage)v;
3831 obj["arg0"] = toJSON(tv._0);
3832 obj["arg1"] = toJSON(tv._1);
3833 obj["arg2"] = toJSON(tv._2);
3834 }
3835 break;
3836 case ImageRef.Tag.Framebuffer:
3837 obj["tag"] = "Framebuffer";
3838 {
3839 var tv = (data.Framebuffer)v;
3840 obj["arg0"] = toJSON(tv._0);
3841 }
3842 break;
3843 }
3844 return obj;
3845 }
3846 JToken toJSON(ClearImage v) {
3847 var obj = new JObject();
3848 switch (v.tag) {
3849 case ClearImage.Tag.ClearImage:
3850 obj["tag"] = "ClearImage";
3851 {
3852 var tv = (data.ClearImage)v;
3853 obj["imageSemantic"] = toJSON(tv.imageSemantic);
3854 obj["clearValue"] = toJSON(tv.clearValue);
3855 }
3856 break;
3857 }
3858 return obj;
3859 }
3860 JToken toJSON(Command v) {
3861 var obj = new JObject();
3862 switch (v.tag) {
3863 case Command.Tag.SetRasterContext:
3864 obj["tag"] = "SetRasterContext";
3865 {
3866 var tv = (data.SetRasterContext)v;
3867 obj["arg0"] = toJSON(tv._0);
3868 }
3869 break;
3870 case Command.Tag.SetAccumulationContext:
3871 obj["tag"] = "SetAccumulationContext";
3872 {
3873 var tv = (data.SetAccumulationContext)v;
3874 obj["arg0"] = toJSON(tv._0);
3875 }
3876 break;
3877 case Command.Tag.SetRenderTarget:
3878 obj["tag"] = "SetRenderTarget";
3879 {
3880 var tv = (data.SetRenderTarget)v;
3881 obj["arg0"] = toJSON(tv._0);
3882 }
3883 break;
3884 case Command.Tag.SetProgram:
3885 obj["tag"] = "SetProgram";
3886 {
3887 var tv = (data.SetProgram)v;
3888 obj["arg0"] = toJSON(tv._0);
3889 }
3890 break;
3891 case Command.Tag.SetSamplerUniform:
3892 obj["tag"] = "SetSamplerUniform";
3893 {
3894 var tv = (data.SetSamplerUniform)v;
3895 obj["arg0"] = toJSON(tv._0);
3896 obj["arg1"] = toJSON(tv._1);
3897 }
3898 break;
3899 case Command.Tag.SetTexture:
3900 obj["tag"] = "SetTexture";
3901 {
3902 var tv = (data.SetTexture)v;
3903 obj["arg0"] = toJSON(tv._0);
3904 obj["arg1"] = toJSON(tv._1);
3905 }
3906 break;
3907 case Command.Tag.SetSampler:
3908 obj["tag"] = "SetSampler";
3909 {
3910 var tv = (data.SetSampler)v;
3911 obj["arg0"] = toJSON(tv._0);
3912 obj["arg1"] = toJSON(tv._1);
3913 }
3914 break;
3915 case Command.Tag.RenderSlot:
3916 obj["tag"] = "RenderSlot";
3917 {
3918 var tv = (data.RenderSlot)v;
3919 obj["arg0"] = toJSON(tv._0);
3920 }
3921 break;
3922 case Command.Tag.RenderStream:
3923 obj["tag"] = "RenderStream";
3924 {
3925 var tv = (data.RenderStream)v;
3926 obj["arg0"] = toJSON(tv._0);
3927 }
3928 break;
3929 case Command.Tag.ClearRenderTarget:
3930 obj["tag"] = "ClearRenderTarget";
3931 {
3932 var tv = (data.ClearRenderTarget)v;
3933 obj["arg0"] = toJSON(tv._0);
3934 }
3935 break;
3936 case Command.Tag.GenerateMipMap:
3937 obj["tag"] = "GenerateMipMap";
3938 {
3939 var tv = (data.GenerateMipMap)v;
3940 obj["arg0"] = toJSON(tv._0);
3941 }
3942 break;
3943 case Command.Tag.SaveImage:
3944 obj["tag"] = "SaveImage";
3945 {
3946 var tv = (data.SaveImage)v;
3947 obj["arg0"] = toJSON(tv._0);
3948 obj["arg1"] = toJSON(tv._1);
3949 }
3950 break;
3951 case Command.Tag.LoadImage:
3952 obj["tag"] = "LoadImage";
3953 {
3954 var tv = (data.LoadImage)v;
3955 obj["arg0"] = toJSON(tv._0);
3956 obj["arg1"] = toJSON(tv._1);
3957 }
3958 break;
3959 }
3960 return obj;
3961 }
3962 JToken toJSON(SamplerDescriptor v) {
3963 var obj = new JObject();
3964 switch (v.tag) {
3965 case SamplerDescriptor.Tag.SamplerDescriptor:
3966 obj["tag"] = "SamplerDescriptor";
3967 {
3968 var tv = (data.SamplerDescriptor)v;
3969 obj["samplerWrapS"] = toJSON(tv.samplerWrapS);
3970 obj["samplerWrapT"] = toJSON(tv.samplerWrapT);
3971 obj["samplerWrapR"] = toJSON(tv.samplerWrapR);
3972 obj["samplerMinFilter"] = toJSON(tv.samplerMinFilter);
3973 obj["samplerMagFilter"] = toJSON(tv.samplerMagFilter);
3974 obj["samplerBorderColor"] = toJSON(tv.samplerBorderColor);
3975 obj["samplerMinLod"] = toJSON(tv.samplerMinLod);
3976 obj["samplerMaxLod"] = toJSON(tv.samplerMaxLod);
3977 obj["samplerLodBias"] = toJSON(tv.samplerLodBias);
3978 obj["samplerCompareFunc"] = toJSON(tv.samplerCompareFunc);
3979 }
3980 break;
3981 }
3982 return obj;
3983 }
3984 JToken toJSON(TextureDescriptor v) {
3985 var obj = new JObject();
3986 switch (v.tag) {
3987 case TextureDescriptor.Tag.TextureDescriptor:
3988 obj["tag"] = "TextureDescriptor";
3989 {
3990 var tv = (data.TextureDescriptor)v;
3991 obj["textureType"] = toJSON(tv.textureType);
3992 obj["textureSize"] = toJSON(tv.textureSize);
3993 obj["textureSemantic"] = toJSON(tv.textureSemantic);
3994 obj["textureSampler"] = toJSON(tv.textureSampler);
3995 obj["textureBaseLevel"] = toJSON(tv.textureBaseLevel);
3996 obj["textureMaxLevel"] = toJSON(tv.textureMaxLevel);
3997 }
3998 break;
3999 }
4000 return obj;
4001 }
4002 JToken toJSON(Parameter v) {
4003 var obj = new JObject();
4004 switch (v.tag) {
4005 case Parameter.Tag.Parameter:
4006 obj["tag"] = "Parameter";
4007 {
4008 var tv = (data.Parameter)v;
4009 obj["name"] = toJSON(tv.name);
4010 obj["ty"] = toJSON(tv.ty);
4011 }
4012 break;
4013 }
4014 return obj;
4015 }
4016 JToken toJSON(Program v) {
4017 var obj = new JObject();
4018 switch (v.tag) {
4019 case Program.Tag.Program:
4020 obj["tag"] = "Program";
4021 {
4022 var tv = (data.Program)v;
4023 obj["programUniforms"] = toJSON(tv.programUniforms);
4024 obj["programStreams"] = toJSON(tv.programStreams);
4025 obj["programInTextures"] = toJSON(tv.programInTextures);
4026 obj["programOutput"] = toJSON(tv.programOutput);
4027 obj["vertexShader"] = toJSON(tv.vertexShader);
4028 obj["geometryShader"] = toJSON(tv.geometryShader);
4029 obj["fragmentShader"] = toJSON(tv.fragmentShader);
4030 }
4031 break;
4032 }
4033 return obj;
4034 }
4035 JToken toJSON(Slot v) {
4036 var obj = new JObject();
4037 switch (v.tag) {
4038 case Slot.Tag.Slot:
4039 obj["tag"] = "Slot";
4040 {
4041 var tv = (data.Slot)v;
4042 obj["slotName"] = toJSON(tv.slotName);
4043 obj["slotStreams"] = toJSON(tv.slotStreams);
4044 obj["slotUniforms"] = toJSON(tv.slotUniforms);
4045 obj["slotPrimitive"] = toJSON(tv.slotPrimitive);
4046 obj["slotPrograms"] = toJSON(tv.slotPrograms);
4047 }
4048 break;
4049 }
4050 return obj;
4051 }
4052 JToken toJSON(StreamData v) {
4053 var obj = new JObject();
4054 switch (v.tag) {
4055 case StreamData.Tag.StreamData:
4056 obj["tag"] = "StreamData";
4057 {
4058 var tv = (data.StreamData)v;
4059 obj["streamData"] = toJSON(tv.streamData);
4060 obj["streamType"] = toJSON(tv.streamType);
4061 obj["streamPrimitive"] = toJSON(tv.streamPrimitive);
4062 obj["streamPrograms"] = toJSON(tv.streamPrograms);
4063 }
4064 break;
4065 }
4066 return obj;
4067 }
4068 JToken toJSON(TargetItem v) {
4069 var obj = new JObject();
4070 switch (v.tag) {
4071 case TargetItem.Tag.TargetItem:
4072 obj["tag"] = "TargetItem";
4073 {
4074 var tv = (data.TargetItem)v;
4075 obj["targetSemantic"] = toJSON(tv.targetSemantic);
4076 obj["targetRef"] = toJSON(tv.targetRef);
4077 }
4078 break;
4079 }
4080 return obj;
4081 }
4082 JToken toJSON(RenderTarget v) {
4083 var obj = new JObject();
4084 switch (v.tag) {
4085 case RenderTarget.Tag.RenderTarget:
4086 obj["tag"] = "RenderTarget";
4087 {
4088 var tv = (data.RenderTarget)v;
4089 obj["renderTargets"] = toJSON(tv.renderTargets);
4090 }
4091 break;
4092 }
4093 return obj;
4094 }
4095 JToken toJSON(Backend v) {
4096 var obj = new JObject();
4097 switch (v.tag) {
4098 case Backend.Tag.WebGL1:
4099 obj["tag"] = "WebGL1";
4100 break;
4101 case Backend.Tag.OpenGL33:
4102 obj["tag"] = "OpenGL33";
4103 break;
4104 }
4105 return obj;
4106 }
4107 JToken toJSON(Pipeline v) {
4108 var obj = new JObject();
4109 switch (v.tag) {
4110 case Pipeline.Tag.Pipeline:
4111 obj["tag"] = "Pipeline";
4112 {
4113 var tv = (data.Pipeline)v;
4114 obj["info"] = toJSON(tv.info);
4115 obj["backend"] = toJSON(tv.backend);
4116 obj["textures"] = toJSON(tv.textures);
4117 obj["samplers"] = toJSON(tv.samplers);
4118 obj["targets"] = toJSON(tv.targets);
4119 obj["programs"] = toJSON(tv.programs);
4120 obj["slots"] = toJSON(tv.slots);
4121 obj["streams"] = toJSON(tv.streams);
4122 obj["commands"] = toJSON(tv.commands);
4123 }
4124 break;
4125 }
4126 return obj;
4127 }
4128
4129 JToken toJSON(int v) { return new JValue(v); }
4130 JToken toJSON(uint v) { return new JValue(v); }
4131 JToken toJSON(float v) { return new JValue(v); }
4132 JToken toJSON(bool v) { return new JValue(v); }
4133 JToken toJSON(string v) { return new JValue(v); }
4134 JToken toJSON(V2<int> v) {
4135 var obj = new JObject();
4136 obj["x"] = toJSON(v.x);
4137 obj["y"] = toJSON(v.y);
4138 return obj;
4139 }
4140 JToken toJSON(V2<uint> v) {
4141 var obj = new JObject();
4142 obj["x"] = toJSON(v.x);
4143 obj["y"] = toJSON(v.y);
4144 return obj;
4145 }
4146 JToken toJSON(V2<float> v) {
4147 var obj = new JObject();
4148 obj["x"] = toJSON(v.x);
4149 obj["y"] = toJSON(v.y);
4150 return obj;
4151 }
4152 JToken toJSON(V2<bool> v) {
4153 var obj = new JObject();
4154 obj["x"] = toJSON(v.x);
4155 obj["y"] = toJSON(v.y);
4156 return obj;
4157 }
4158 JToken toJSON(V2<V2<float>> v) {
4159 var obj = new JObject();
4160 obj["x"] = toJSON(v.x);
4161 obj["y"] = toJSON(v.y);
4162 return obj;
4163 }
4164 JToken toJSON(V2<V3<float>> v) {
4165 var obj = new JObject();
4166 obj["x"] = toJSON(v.x);
4167 obj["y"] = toJSON(v.y);
4168 return obj;
4169 }
4170 JToken toJSON(V2<V4<float>> v) {
4171 var obj = new JObject();
4172 obj["x"] = toJSON(v.x);
4173 obj["y"] = toJSON(v.y);
4174 return obj;
4175 }
4176 JToken toJSON(V3<int> v) {
4177 var obj = new JObject();
4178 obj["x"] = toJSON(v.x);
4179 obj["y"] = toJSON(v.y);
4180 obj["z"] = toJSON(v.z);
4181 return obj;
4182 }
4183 JToken toJSON(V3<uint> v) {
4184 var obj = new JObject();
4185 obj["x"] = toJSON(v.x);
4186 obj["y"] = toJSON(v.y);
4187 obj["z"] = toJSON(v.z);
4188 return obj;
4189 }
4190 JToken toJSON(V3<float> v) {
4191 var obj = new JObject();
4192 obj["x"] = toJSON(v.x);
4193 obj["y"] = toJSON(v.y);
4194 obj["z"] = toJSON(v.z);
4195 return obj;
4196 }
4197 JToken toJSON(V3<bool> v) {
4198 var obj = new JObject();
4199 obj["x"] = toJSON(v.x);
4200 obj["y"] = toJSON(v.y);
4201 obj["z"] = toJSON(v.z);
4202 return obj;
4203 }
4204 JToken toJSON(V3<V2<float>> v) {
4205 var obj = new JObject();
4206 obj["x"] = toJSON(v.x);
4207 obj["y"] = toJSON(v.y);
4208 obj["z"] = toJSON(v.z);
4209 return obj;
4210 }
4211 JToken toJSON(V3<V3<float>> v) {
4212 var obj = new JObject();
4213 obj["x"] = toJSON(v.x);
4214 obj["y"] = toJSON(v.y);
4215 obj["z"] = toJSON(v.z);
4216 return obj;
4217 }
4218 JToken toJSON(V3<V4<float>> v) {
4219 var obj = new JObject();
4220 obj["x"] = toJSON(v.x);
4221 obj["y"] = toJSON(v.y);
4222 obj["z"] = toJSON(v.z);
4223 return obj;
4224 }
4225 JToken toJSON(V4<int> v) {
4226 var obj = new JObject();
4227 obj["x"] = toJSON(v.x);
4228 obj["y"] = toJSON(v.y);
4229 obj["z"] = toJSON(v.z);
4230 obj["w"] = toJSON(v.w);
4231 return obj;
4232 }
4233 JToken toJSON(V4<uint> v) {
4234 var obj = new JObject();
4235 obj["x"] = toJSON(v.x);
4236 obj["y"] = toJSON(v.y);
4237 obj["z"] = toJSON(v.z);
4238 obj["w"] = toJSON(v.w);
4239 return obj;
4240 }
4241 JToken toJSON(V4<float> v) {
4242 var obj = new JObject();
4243 obj["x"] = toJSON(v.x);
4244 obj["y"] = toJSON(v.y);
4245 obj["z"] = toJSON(v.z);
4246 obj["w"] = toJSON(v.w);
4247 return obj;
4248 }
4249 JToken toJSON(V4<bool> v) {
4250 var obj = new JObject();
4251 obj["x"] = toJSON(v.x);
4252 obj["y"] = toJSON(v.y);
4253 obj["z"] = toJSON(v.z);
4254 obj["w"] = toJSON(v.w);
4255 return obj;
4256 }
4257 JToken toJSON(V4<V2<float>> v) {
4258 var obj = new JObject();
4259 obj["x"] = toJSON(v.x);
4260 obj["y"] = toJSON(v.y);
4261 obj["z"] = toJSON(v.z);
4262 obj["w"] = toJSON(v.w);
4263 return obj;
4264 }
4265 JToken toJSON(V4<V3<float>> v) {
4266 var obj = new JObject();
4267 obj["x"] = toJSON(v.x);
4268 obj["y"] = toJSON(v.y);
4269 obj["z"] = toJSON(v.z);
4270 obj["w"] = toJSON(v.w);
4271 return obj;
4272 }
4273 JToken toJSON(V4<V4<float>> v) {
4274 var obj = new JObject();
4275 obj["x"] = toJSON(v.x);
4276 obj["y"] = toJSON(v.y);
4277 obj["z"] = toJSON(v.z);
4278 obj["w"] = toJSON(v.w);
4279 return obj;
4280 }
4281 JToken toJSON(List<int> v) {
4282 var obj = new JArray();
4283 foreach (var i in v) {
4284 obj.Add(toJSON(i));
4285 }
4286 return obj;
4287 }
4288 JToken toJSON(List<uint> v) {
4289 var obj = new JArray();
4290 foreach (var i in v) {
4291 obj.Add(toJSON(i));
4292 }
4293 return obj;
4294 }
4295 JToken toJSON(List<float> v) {
4296 var obj = new JArray();
4297 foreach (var i in v) {
4298 obj.Add(toJSON(i));
4299 }
4300 return obj;
4301 }
4302 JToken toJSON(List<bool> v) {
4303 var obj = new JArray();
4304 foreach (var i in v) {
4305 obj.Add(toJSON(i));
4306 }
4307 return obj;
4308 }
4309 JToken toJSON(List<global::LambdaCube.IR.ClearImage> v) {
4310 var obj = new JArray();
4311 foreach (var i in v) {
4312 obj.Add(toJSON(i));
4313 }
4314 return obj;
4315 }
4316 JToken toJSON(List<global::LambdaCube.IR.Command> v) {
4317 var obj = new JArray();
4318 foreach (var i in v) {
4319 obj.Add(toJSON(i));
4320 }
4321 return obj;
4322 }
4323 JToken toJSON(List<global::LambdaCube.IR.Parameter> v) {
4324 var obj = new JArray();
4325 foreach (var i in v) {
4326 obj.Add(toJSON(i));
4327 }
4328 return obj;
4329 }
4330 JToken toJSON(List<global::LambdaCube.IR.Program> v) {
4331 var obj = new JArray();
4332 foreach (var i in v) {
4333 obj.Add(toJSON(i));
4334 }
4335 return obj;
4336 }
4337 JToken toJSON(List<global::LambdaCube.IR.RenderTarget> v) {
4338 var obj = new JArray();
4339 foreach (var i in v) {
4340 obj.Add(toJSON(i));
4341 }
4342 return obj;
4343 }
4344 JToken toJSON(List<global::LambdaCube.IR.SamplerDescriptor> v) {
4345 var obj = new JArray();
4346 foreach (var i in v) {
4347 obj.Add(toJSON(i));
4348 }
4349 return obj;
4350 }
4351 JToken toJSON(List<global::LambdaCube.IR.Slot> v) {
4352 var obj = new JArray();
4353 foreach (var i in v) {
4354 obj.Add(toJSON(i));
4355 }
4356 return obj;
4357 }
4358 JToken toJSON(List<global::LambdaCube.IR.StreamData> v) {
4359 var obj = new JArray();
4360 foreach (var i in v) {
4361 obj.Add(toJSON(i));
4362 }
4363 return obj;
4364 }
4365 JToken toJSON(List<global::LambdaCube.IR.TargetItem> v) {
4366 var obj = new JArray();
4367 foreach (var i in v) {
4368 obj.Add(toJSON(i));
4369 }
4370 return obj;
4371 }
4372 JToken toJSON(List<global::LambdaCube.IR.TextureDescriptor> v) {
4373 var obj = new JArray();
4374 foreach (var i in v) {
4375 obj.Add(toJSON(i));
4376 }
4377 return obj;
4378 }
4379 JToken toJSON(List<global::LambdaCube.IR.FragmentOperation> v) {
4380 var obj = new JArray();
4381 foreach (var i in v) {
4382 obj.Add(toJSON(i));
4383 }
4384 return obj;
4385 }
4386 JToken toJSON(Maybe<int> v) {
4387 if (v.valid) {
4388 return toJSON(v.data);
4389 }
4390 return new JValue((string)null);
4391 }
4392 JToken toJSON(Maybe<float> v) {
4393 if (v.valid) {
4394 return toJSON(v.data);
4395 }
4396 return new JValue((string)null);
4397 }
4398 JToken toJSON(Maybe<string> v) {
4399 if (v.valid) {
4400 return toJSON(v.data);
4401 }
4402 return new JValue((string)null);
4403 }
4404 JToken toJSON(Maybe<global::LambdaCube.IR.ComparisonFunction> v) {
4405 if (v.valid) {
4406 return toJSON(v.data);
4407 }
4408 return new JValue((string)null);
4409 }
4410 JToken toJSON(Maybe<global::LambdaCube.IR.EdgeMode> v) {
4411 if (v.valid) {
4412 return toJSON(v.data);
4413 }
4414 return new JValue((string)null);
4415 }
4416 JToken toJSON(Maybe<global::LambdaCube.IR.ImageRef> v) {
4417 if (v.valid) {
4418 return toJSON(v.data);
4419 }
4420 return new JValue((string)null);
4421 }
4422 JToken toJSON(Dictionary<string, global::LambdaCube.IR.ArrayValue> v) {
4423 var obj = new JObject();
4424 foreach (var i in v) {
4425 obj[i.Key] = toJSON(i.Value);
4426 }
4427 return obj;
4428 }
4429 JToken toJSON(Dictionary<string, global::LambdaCube.IR.InputType> v) {
4430 var obj = new JObject();
4431 foreach (var i in v) {
4432 obj[i.Key] = toJSON(i.Value);
4433 }
4434 return obj;
4435 }
4436 JToken toJSON(Dictionary<string, global::LambdaCube.IR.Parameter> v) {
4437 var obj = new JObject();
4438 foreach (var i in v) {
4439 obj[i.Key] = toJSON(i.Value);
4440 }
4441 return obj;
4442 }
4443 }
4444}
diff --git a/ddl/out/LambdaCube.IR.hpp b/ddl/out/LambdaCube.IR.hpp
index 0e139b1..d6d74ac 100644
--- a/ddl/out/LambdaCube.IR.hpp
+++ b/ddl/out/LambdaCube.IR.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.426854000000Z 3// 2016-03-01T13:00:40.426854000000Z
4=======
5// 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.IR_H 8#ifndef HEADER_LambdaCube.IR_H
5#define HEADER_LambdaCube.IR_H 9#define HEADER_LambdaCube.IR_H
diff --git a/ddl/out/LambdaCube.IR.hs b/ddl/out/LambdaCube.IR.hs
index 7776a6d..2a414dc 100644
--- a/ddl/out/LambdaCube.IR.hs
+++ b/ddl/out/LambdaCube.IR.hs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.426854000000Z 3-- 2016-03-01T13:00:40.426854000000Z
4=======
5-- 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 8{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module LambdaCube.IR where 9module LambdaCube.IR where
diff --git a/ddl/out/LambdaCube.IR.java b/ddl/out/LambdaCube.IR.java
new file mode 100644
index 0000000..b819bcb
--- /dev/null
+++ b/ddl/out/LambdaCube.IR.java
@@ -0,0 +1,877 @@
1// generated file, do not modify!
2// 2016-03-14T10:58:29.577511000000Z
3
4
5public class LambdaCube.IR {
6 public class ArrayValue {
7 public enum Tag {
8 VBoolArray,
9 VIntArray,
10 VWordArray,
11 VFloatArray
12 }
13 public Tag tag;
14
15 public class VBoolArray extends ArrayValue {
16 public ArrayList<Boolean> _0;
17 }
18 public class VIntArray extends ArrayValue {
19 public ArrayList<Integer> _0;
20 }
21 public class VWordArray extends ArrayValue {
22 public ArrayList<Integer> _0;
23 }
24 public class VFloatArray extends ArrayValue {
25 public ArrayList<Float> _0;
26 }
27 }
28
29 public class Value {
30 public enum Tag {
31 VBool,
32 VV2B,
33 VV3B,
34 VV4B,
35 VWord,
36 VV2U,
37 VV3U,
38 VV4U,
39 VInt,
40 VV2I,
41 VV3I,
42 VV4I,
43 VFloat,
44 VV2F,
45 VV3F,
46 VV4F,
47 VM22F,
48 VM23F,
49 VM24F,
50 VM32F,
51 VM33F,
52 VM34F,
53 VM42F,
54 VM43F,
55 VM44F
56 }
57 public Tag tag;
58
59 public class VBool extends Value {
60 public Boolean _0;
61 }
62 public class VV2B extends Value {
63 public int _0;
64 }
65 public class VV3B extends Value {
66 public int _0;
67 }
68 public class VV4B extends Value {
69 public int _0;
70 }
71 public class VWord extends Value {
72 public Integer _0;
73 }
74 public class VV2U extends Value {
75 public int _0;
76 }
77 public class VV3U extends Value {
78 public int _0;
79 }
80 public class VV4U extends Value {
81 public int _0;
82 }
83 public class VInt extends Value {
84 public Integer _0;
85 }
86 public class VV2I extends Value {
87 public int _0;
88 }
89 public class VV3I extends Value {
90 public int _0;
91 }
92 public class VV4I extends Value {
93 public int _0;
94 }
95 public class VFloat extends Value {
96 public Float _0;
97 }
98 public class VV2F extends Value {
99 public int _0;
100 }
101 public class VV3F extends Value {
102 public int _0;
103 }
104 public class VV4F extends Value {
105 public int _0;
106 }
107 public class VM22F extends Value {
108 public int _0;
109 }
110 public class VM23F extends Value {
111 public int _0;
112 }
113 public class VM24F extends Value {
114 public int _0;
115 }
116 public class VM32F extends Value {
117 public int _0;
118 }
119 public class VM33F extends Value {
120 public int _0;
121 }
122 public class VM34F extends Value {
123 public int _0;
124 }
125 public class VM42F extends Value {
126 public int _0;
127 }
128 public class VM43F extends Value {
129 public int _0;
130 }
131 public class VM44F extends Value {
132 public int _0;
133 }
134 }
135
136 public class InputType {
137 public enum Tag {
138 Bool,
139 V2B,
140 V3B,
141 V4B,
142 Word,
143 V2U,
144 V3U,
145 V4U,
146 Int,
147 V2I,
148 V3I,
149 V4I,
150 Float,
151 V2F,
152 V3F,
153 V4F,
154 M22F,
155 M23F,
156 M24F,
157 M32F,
158 M33F,
159 M34F,
160 M42F,
161 M43F,
162 M44F,
163 STexture1D,
164 STexture2D,
165 STextureCube,
166 STexture1DArray,
167 STexture2DArray,
168 STexture2DRect,
169 FTexture1D,
170 FTexture2D,
171 FTexture3D,
172 FTextureCube,
173 FTexture1DArray,
174 FTexture2DArray,
175 FTexture2DMS,
176 FTexture2DMSArray,
177 FTextureBuffer,
178 FTexture2DRect,
179 ITexture1D,
180 ITexture2D,
181 ITexture3D,
182 ITextureCube,
183 ITexture1DArray,
184 ITexture2DArray,
185 ITexture2DMS,
186 ITexture2DMSArray,
187 ITextureBuffer,
188 ITexture2DRect,
189 UTexture1D,
190 UTexture2D,
191 UTexture3D,
192 UTextureCube,
193 UTexture1DArray,
194 UTexture2DArray,
195 UTexture2DMS,
196 UTexture2DMSArray,
197 UTextureBuffer,
198 UTexture2DRect
199 }
200 public Tag tag;
201
202 }
203
204 public class PointSpriteCoordOrigin {
205 public enum Tag {
206 LowerLeft,
207 UpperLeft
208 }
209 public Tag tag;
210
211 }
212
213 public class PointSize {
214 public enum Tag {
215 PointSize,
216 ProgramPointSize
217 }
218 public Tag tag;
219
220 public class PointSize extends PointSize {
221 public Float _0;
222 }
223 }
224
225 public class PolygonOffset {
226 public enum Tag {
227 NoOffset,
228 Offset
229 }
230 public Tag tag;
231
232 public class Offset extends PolygonOffset {
233 public Float _0;
234 public Float _1;
235 }
236 }
237
238 public class FrontFace {
239 public enum Tag {
240 CCW,
241 CW
242 }
243 public Tag tag;
244
245 }
246
247 public class PolygonMode {
248 public enum Tag {
249 PolygonPoint,
250 PolygonLine,
251 PolygonFill
252 }
253 public Tag tag;
254
255 public class PolygonPoint extends PolygonMode {
256 public PointSize _0;
257 }
258 public class PolygonLine extends PolygonMode {
259 public Float _0;
260 }
261 }
262
263 public class ProvokingVertex {
264 public enum Tag {
265 FirstVertex,
266 LastVertex
267 }
268 public Tag tag;
269
270 }
271
272 public class CullMode {
273 public enum Tag {
274 CullNone,
275 CullFront,
276 CullBack
277 }
278 public Tag tag;
279
280 public class CullFront extends CullMode {
281 public FrontFace _0;
282 }
283 public class CullBack extends CullMode {
284 public FrontFace _0;
285 }
286 }
287
288 public class ComparisonFunction {
289 public enum Tag {
290 Never,
291 Less,
292 Equal,
293 Lequal,
294 Greater,
295 Notequal,
296 Gequal,
297 Always
298 }
299 public Tag tag;
300
301 }
302
303 public class StencilOperation {
304 public enum Tag {
305 OpZero,
306 OpKeep,
307 OpReplace,
308 OpIncr,
309 OpIncrWrap,
310 OpDecr,
311 OpDecrWrap,
312 OpInvert
313 }
314 public Tag tag;
315
316 }
317
318 public class BlendEquation {
319 public enum Tag {
320 FuncAdd,
321 FuncSubtract,
322 FuncReverseSubtract,
323 Min,
324 Max
325 }
326 public Tag tag;
327
328 }
329
330 public class BlendingFactor {
331 public enum Tag {
332 Zero,
333 One,
334 SrcColor,
335 OneMinusSrcColor,
336 DstColor,
337 OneMinusDstColor,
338 SrcAlpha,
339 OneMinusSrcAlpha,
340 DstAlpha,
341 OneMinusDstAlpha,
342 ConstantColor,
343 OneMinusConstantColor,
344 ConstantAlpha,
345 OneMinusConstantAlpha,
346 SrcAlphaSaturate
347 }
348 public Tag tag;
349
350 }
351
352 public class LogicOperation {
353 public enum Tag {
354 Clear,
355 And,
356 AndReverse,
357 Copy,
358 AndInverted,
359 Noop,
360 Xor,
361 Or,
362 Nor,
363 Equiv,
364 Invert,
365 OrReverse,
366 CopyInverted,
367 OrInverted,
368 Nand,
369 Set
370 }
371 public Tag tag;
372
373 }
374
375 public class StencilOps {
376 public enum Tag {
377 StencilOps
378 }
379 public Tag tag;
380
381 public class StencilOps extends StencilOps {
382 public StencilOperation frontStencilOp;
383 public StencilOperation backStencilOp;
384 }
385 }
386
387 public class StencilTest {
388 public enum Tag {
389 StencilTest
390 }
391 public Tag tag;
392
393 public class StencilTest extends StencilTest {
394 public ComparisonFunction stencilComparision;
395 public Integer stencilReference;
396 public Integer stencilMask;
397 }
398 }
399
400 public class StencilTests {
401 public enum Tag {
402 StencilTests
403 }
404 public Tag tag;
405
406 public class StencilTests extends StencilTests {
407 public StencilTest _0;
408 public StencilTest _1;
409 }
410 }
411
412 public class FetchPrimitive {
413 public enum Tag {
414 Points,
415 Lines,
416 Triangles,
417 LinesAdjacency,
418 TrianglesAdjacency
419 }
420 public Tag tag;
421
422 }
423
424 public class OutputPrimitive {
425 public enum Tag {
426 TrianglesOutput,
427 LinesOutput,
428 PointsOutput
429 }
430 public Tag tag;
431
432 }
433
434 public class ColorArity {
435 public enum Tag {
436 Red,
437 RG,
438 RGB,
439 RGBA
440 }
441 public Tag tag;
442
443 }
444
445 public class Blending {
446 public enum Tag {
447 NoBlending,
448 BlendLogicOp,
449 Blend
450 }
451 public Tag tag;
452
453 public class BlendLogicOp extends Blending {
454 public LogicOperation _0;
455 }
456 public class Blend extends Blending {
457 public BlendEquation colorEqSrc;
458 public BlendEquation alphaEqSrc;
459 public BlendingFactor colorFSrc;
460 public BlendingFactor colorFDst;
461 public BlendingFactor alphaFSrc;
462 public BlendingFactor alphaFDst;
463 public int color;
464 }
465 }
466
467 public class RasterContext {
468 public enum Tag {
469 PointCtx,
470 LineCtx,
471 TriangleCtx
472 }
473 public Tag tag;
474
475 public class PointCtx extends RasterContext {
476 public PointSize _0;
477 public Float _1;
478 public PointSpriteCoordOrigin _2;
479 }
480 public class LineCtx extends RasterContext {
481 public Float _0;
482 public ProvokingVertex _1;
483 }
484 public class TriangleCtx extends RasterContext {
485 public CullMode _0;
486 public PolygonMode _1;
487 public PolygonOffset _2;
488 public ProvokingVertex _3;
489 }
490 }
491
492 public class FragmentOperation {
493 public enum Tag {
494 DepthOp,
495 StencilOp,
496 ColorOp
497 }
498 public Tag tag;
499
500 public class DepthOp extends FragmentOperation {
501 public ComparisonFunction _0;
502 public Boolean _1;
503 }
504 public class StencilOp extends FragmentOperation {
505 public StencilTests _0;
506 public StencilOps _1;
507 public StencilOps _2;
508 }
509 public class ColorOp extends FragmentOperation {
510 public Blending _0;
511 public Value _1;
512 }
513 }
514
515 public class AccumulationContext {
516 public enum Tag {
517 AccumulationContext
518 }
519 public Tag tag;
520
521 public class AccumulationContext extends AccumulationContext {
522 public int accViewportName;
523 public ArrayList<FragmentOperation> accOperations;
524 }
525 }
526
527 public class TextureDataType {
528 public enum Tag {
529 FloatT,
530 IntT,
531 WordT,
532 ShadowT
533 }
534 public Tag tag;
535
536 public class FloatT extends TextureDataType {
537 public ColorArity _0;
538 }
539 public class IntT extends TextureDataType {
540 public ColorArity _0;
541 }
542 public class WordT extends TextureDataType {
543 public ColorArity _0;
544 }
545 }
546
547 public class TextureType {
548 public enum Tag {
549 Texture1D,
550 Texture2D,
551 Texture3D,
552 TextureCube,
553 TextureRect,
554 Texture2DMS,
555 TextureBuffer
556 }
557 public Tag tag;
558
559 public class Texture1D extends TextureType {
560 public TextureDataType _0;
561 public Integer _1;
562 }
563 public class Texture2D extends TextureType {
564 public TextureDataType _0;
565 public Integer _1;
566 }
567 public class Texture3D extends TextureType {
568 public TextureDataType _0;
569 }
570 public class TextureCube extends TextureType {
571 public TextureDataType _0;
572 }
573 public class TextureRect extends TextureType {
574 public TextureDataType _0;
575 }
576 public class Texture2DMS extends TextureType {
577 public TextureDataType _0;
578 public Integer _1;
579 public Integer _2;
580 public Boolean _3;
581 }
582 public class TextureBuffer extends TextureType {
583 public TextureDataType _0;
584 }
585 }
586
587 public class MipMap {
588 public enum Tag {
589 Mip,
590 NoMip,
591 AutoMip
592 }
593 public Tag tag;
594
595 public class Mip extends MipMap {
596 public Integer _0;
597 public Integer _1;
598 }
599 public class AutoMip extends MipMap {
600 public Integer _0;
601 public Integer _1;
602 }
603 }
604
605 public class Filter {
606 public enum Tag {
607 Nearest,
608 Linear,
609 NearestMipmapNearest,
610 NearestMipmapLinear,
611 LinearMipmapNearest,
612 LinearMipmapLinear
613 }
614 public Tag tag;
615
616 }
617
618 public class EdgeMode {
619 public enum Tag {
620 Repeat,
621 MirroredRepeat,
622 ClampToEdge,
623 ClampToBorder
624 }
625 public Tag tag;
626
627 }
628
629 public class ImageSemantic {
630 public enum Tag {
631 Depth,
632 Stencil,
633 Color
634 }
635 public Tag tag;
636
637 }
638
639 public class ImageRef {
640 public enum Tag {
641 TextureImage,
642 Framebuffer
643 }
644 public Tag tag;
645
646 public class TextureImage extends ImageRef {
647 public Integer _0;
648 public Integer _1;
649 public int _2;
650 }
651 public class Framebuffer extends ImageRef {
652 public ImageSemantic _0;
653 }
654 }
655
656 public class ClearImage {
657 public enum Tag {
658 ClearImage
659 }
660 public Tag tag;
661
662 public class ClearImage extends ClearImage {
663 public ImageSemantic imageSemantic;
664 public Value clearValue;
665 }
666 }
667
668 public class Command {
669 public enum Tag {
670 SetRasterContext,
671 SetAccumulationContext,
672 SetRenderTarget,
673 SetProgram,
674 SetSamplerUniform,
675 SetTexture,
676 SetSampler,
677 RenderSlot,
678 RenderStream,
679 ClearRenderTarget,
680 GenerateMipMap,
681 SaveImage,
682 LoadImage
683 }
684 public Tag tag;
685
686 public class SetRasterContext extends Command {
687 public RasterContext _0;
688 }
689 public class SetAccumulationContext extends Command {
690 public AccumulationContext _0;
691 }
692 public class SetRenderTarget extends Command {
693 public Integer _0;
694 }
695 public class SetProgram extends Command {
696 public Integer _0;
697 }
698 public class SetSamplerUniform extends Command {
699 public String _0;
700 public Integer _1;
701 }
702 public class SetTexture extends Command {
703 public Integer _0;
704 public Integer _1;
705 }
706 public class SetSampler extends Command {
707 public Integer _0;
708 public int _1;
709 }
710 public class RenderSlot extends Command {
711 public Integer _0;
712 }
713 public class RenderStream extends Command {
714 public Integer _0;
715 }
716 public class ClearRenderTarget extends Command {
717 public ArrayList<ClearImage> _0;
718 }
719 public class GenerateMipMap extends Command {
720 public Integer _0;
721 }
722 public class SaveImage extends Command {
723 public Integer _0;
724 public ImageRef _1;
725 }
726 public class LoadImage extends Command {
727 public ImageRef _0;
728 public Integer _1;
729 }
730 }
731
732 public class SamplerDescriptor {
733 public enum Tag {
734 SamplerDescriptor
735 }
736 public Tag tag;
737
738 public class SamplerDescriptor extends SamplerDescriptor {
739 public EdgeMode samplerWrapS;
740 public int samplerWrapT;
741 public int samplerWrapR;
742 public Filter samplerMinFilter;
743 public Filter samplerMagFilter;
744 public Value samplerBorderColor;
745 public int samplerMinLod;
746 public int samplerMaxLod;
747 public Float samplerLodBias;
748 public int samplerCompareFunc;
749 }
750 }
751
752 public class TextureDescriptor {
753 public enum Tag {
754 TextureDescriptor
755 }
756 public Tag tag;
757
758 public class TextureDescriptor extends TextureDescriptor {
759 public TextureType textureType;
760 public Value textureSize;
761 public ImageSemantic textureSemantic;
762 public SamplerDescriptor textureSampler;
763 public Integer textureBaseLevel;
764 public Integer textureMaxLevel;
765 }
766 }
767
768 public class Parameter {
769 public enum Tag {
770 Parameter
771 }
772 public Tag tag;
773
774 public class Parameter extends Parameter {
775 public String name;
776 public InputType ty;
777 }
778 }
779
780 public class Program {
781 public enum Tag {
782 Program
783 }
784 public Tag tag;
785
786 public class Program extends Program {
787 public HashMap<String, InputType> programUniforms;
788 public HashMap<String, Parameter> programStreams;
789 public HashMap<String, InputType> programInTextures;
790 public ArrayList<Parameter> programOutput;
791 public String vertexShader;
792 public int geometryShader;
793 public String fragmentShader;
794 }
795 }
796
797 public class Slot {
798 public enum Tag {
799 Slot
800 }
801 public Tag tag;
802
803 public class Slot extends Slot {
804 public String slotName;
805 public HashMap<String, InputType> slotStreams;
806 public HashMap<String, InputType> slotUniforms;
807 public FetchPrimitive slotPrimitive;
808 public ArrayList<Integer> slotPrograms;
809 }
810 }
811
812 public class StreamData {
813 public enum Tag {
814 StreamData
815 }
816 public Tag tag;
817
818 public class StreamData extends StreamData {
819 public HashMap<String, ArrayValue> streamData;
820 public HashMap<String, InputType> streamType;
821 public FetchPrimitive streamPrimitive;
822 public ArrayList<Integer> streamPrograms;
823 }
824 }
825
826 public class TargetItem {
827 public enum Tag {
828 TargetItem
829 }
830 public Tag tag;
831
832 public class TargetItem extends TargetItem {
833 public ImageSemantic targetSemantic;
834 public int targetRef;
835 }
836 }
837
838 public class RenderTarget {
839 public enum Tag {
840 RenderTarget
841 }
842 public Tag tag;
843
844 public class RenderTarget extends RenderTarget {
845 public ArrayList<TargetItem> renderTargets;
846 }
847 }
848
849 public class Backend {
850 public enum Tag {
851 WebGL1,
852 OpenGL33
853 }
854 public Tag tag;
855
856 }
857
858 public class Pipeline {
859 public enum Tag {
860 Pipeline
861 }
862 public Tag tag;
863
864 public class Pipeline extends Pipeline {
865 public String info;
866 public Backend backend;
867 public ArrayList<TextureDescriptor> textures;
868 public ArrayList<SamplerDescriptor> samplers;
869 public ArrayList<RenderTarget> targets;
870 public ArrayList<Program> programs;
871 public ArrayList<Slot> slots;
872 public ArrayList<StreamData> streams;
873 public ArrayList<Command> commands;
874 }
875 }
876
877} \ No newline at end of file
diff --git a/ddl/out/LambdaCube.IR.purs b/ddl/out/LambdaCube.IR.purs
index 5e2e548..7a36d7e 100644
--- a/ddl/out/LambdaCube.IR.purs
+++ b/ddl/out/LambdaCube.IR.purs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.426854000000Z 3-- 2016-03-01T13:00:40.426854000000Z
4=======
5-- 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4module LambdaCube.IR where 8module LambdaCube.IR where
5import Prelude 9import Prelude
diff --git a/ddl/out/LambdaCube.IR.swift b/ddl/out/LambdaCube.IR.swift
index 3131320..4cc6239 100644
--- a/ddl/out/LambdaCube.IR.swift
+++ b/ddl/out/LambdaCube.IR.swift
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.426854000000Z 3// 2016-03-01T13:00:40.426854000000Z
4=======
5// 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4typealias StreamName = Int 8typealias StreamName = Int
5 9
diff --git a/ddl/out/LambdaCube.IR2.hpp b/ddl/out/LambdaCube.IR2.hpp
index 48153e5..a2e531a 100644
--- a/ddl/out/LambdaCube.IR2.hpp
+++ b/ddl/out/LambdaCube.IR2.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.426854000000Z 3// 2016-03-01T13:00:40.426854000000Z
4=======
5// 2016-03-20T21:42:12.172652000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.IR_H 8#ifndef HEADER_LambdaCube.IR_H
5#define HEADER_LambdaCube.IR_H 9#define HEADER_LambdaCube.IR_H
diff --git a/ddl/out/LambdaCube.Mesh.cpp b/ddl/out/LambdaCube.Mesh.cpp
index ccbf035..aa1ca00 100644
--- a/ddl/out/LambdaCube.Mesh.cpp
+++ b/ddl/out/LambdaCube.Mesh.cpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.781208000000Z 3// 2016-03-01T13:00:40.781208000000Z
4=======
5// 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4#include "LambdaCube.Mesh.hpp" 8#include "LambdaCube.Mesh.hpp"
5template<> json toJSON<std::shared_ptr<MeshAttribute>>(std::shared_ptr<MeshAttribute> &v) { 9template<> json toJSON<std::shared_ptr<MeshAttribute>>(std::shared_ptr<MeshAttribute> &v) {
diff --git a/ddl/out/LambdaCube.Mesh.cs b/ddl/out/LambdaCube.Mesh.cs
new file mode 100644
index 0000000..62b8d29
--- /dev/null
+++ b/ddl/out/LambdaCube.Mesh.cs
@@ -0,0 +1,529 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.391032000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9
10namespace LambdaCube.Mesh {
11 class MeshAttribute {
12 public enum Tag {
13 A_Float,
14 A_V2F,
15 A_V3F,
16 A_V4F,
17 A_M22F,
18 A_M33F,
19 A_M44F,
20 A_Int,
21 A_Word
22 };
23 public Tag tag;
24 };
25
26 namespace data {
27 class A_Float : LambdaCube.Mesh.MeshAttribute {
28 public List<float> _0;
29 public A_Float() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_Float; }
30 };
31 class A_V2F : LambdaCube.Mesh.MeshAttribute {
32 public List<V2<float>> _0;
33 public A_V2F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_V2F; }
34 };
35 class A_V3F : LambdaCube.Mesh.MeshAttribute {
36 public List<V3<float>> _0;
37 public A_V3F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_V3F; }
38 };
39 class A_V4F : LambdaCube.Mesh.MeshAttribute {
40 public List<V4<float>> _0;
41 public A_V4F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_V4F; }
42 };
43 class A_M22F : LambdaCube.Mesh.MeshAttribute {
44 public List<V2<V2<float>>> _0;
45 public A_M22F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_M22F; }
46 };
47 class A_M33F : LambdaCube.Mesh.MeshAttribute {
48 public List<V3<V3<float>>> _0;
49 public A_M33F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_M33F; }
50 };
51 class A_M44F : LambdaCube.Mesh.MeshAttribute {
52 public List<V4<V4<float>>> _0;
53 public A_M44F() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_M44F; }
54 };
55 class A_Int : LambdaCube.Mesh.MeshAttribute {
56 public List<int> _0;
57 public A_Int() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_Int; }
58 };
59 class A_Word : LambdaCube.Mesh.MeshAttribute {
60 public List<uint> _0;
61 public A_Word() { tag = LambdaCube.Mesh.MeshAttribute.Tag.A_Word; }
62 };
63 }
64 class MeshPrimitive {
65 public enum Tag {
66 P_Points,
67 P_TriangleStrip,
68 P_Triangles,
69 P_TriangleStripI,
70 P_TrianglesI
71 };
72 public Tag tag;
73 };
74
75 namespace data {
76 class P_TriangleStripI : LambdaCube.Mesh.MeshPrimitive {
77 public List<int> _0;
78 public P_TriangleStripI() { tag = LambdaCube.Mesh.MeshPrimitive.Tag.P_TriangleStripI; }
79 };
80 class P_TrianglesI : LambdaCube.Mesh.MeshPrimitive {
81 public List<int> _0;
82 public P_TrianglesI() { tag = LambdaCube.Mesh.MeshPrimitive.Tag.P_TrianglesI; }
83 };
84 }
85 class Mesh {
86 public enum Tag {
87 Mesh
88 };
89 public Tag tag;
90 };
91
92 namespace data {
93 class Mesh : LambdaCube.Mesh.Mesh {
94 public Dictionary<string, global::LambdaCube.Mesh.MeshAttribute> mAttributes;
95 public global::LambdaCube.Mesh.MeshPrimitive mPrimitive;
96 public Mesh() { tag = LambdaCube.Mesh.Mesh.Tag.Mesh; }
97 };
98 }
99
100 // JSON deserializer
101 enum Type {
102 Int32,
103 Word32,
104 Float,
105 String,
106 V2_Float,
107 V2_V2_Float,
108 V3_Float,
109 V3_V3_Float,
110 V4_Float,
111 V4_V4_Float,
112 Array_Int32,
113 Array_Word32,
114 Array_Float,
115 Array_V2_Float,
116 Array_V2_V2_Float,
117 Array_V3_Float,
118 Array_V3_V3_Float,
119 Array_V4_Float,
120 Array_V4_V4_Float,
121 Map_String_MeshAttribute,
122 Mesh,
123 MeshAttribute,
124 MeshPrimitive
125 }
126
127 class Loader {
128 public static object fromJSON(Type type, JToken obj) {
129 switch (type) {
130 case Type.Int32: return (int)obj;
131 case Type.Word32: return (uint)obj;
132 case Type.Float: return (float)obj;
133 case Type.String: return (string)obj;
134 case Type.V2_Float:
135 return new V2<float>
136 { x = (float)fromJSON(Type.Float,obj["x"])
137 , y = (float)fromJSON(Type.Float,obj["y"])
138 };
139 case Type.V2_V2_Float:
140 return new V2<V2<float>>
141 { x = (V2<float>)fromJSON(Type.V2_Float,obj["x"])
142 , y = (V2<float>)fromJSON(Type.V2_Float,obj["y"])
143 };
144 case Type.V3_Float:
145 return new V3<float>
146 { x = (float)fromJSON(Type.Float,obj["x"])
147 , y = (float)fromJSON(Type.Float,obj["y"])
148 , z = (float)fromJSON(Type.Float,obj["z"])
149 };
150 case Type.V3_V3_Float:
151 return new V3<V3<float>>
152 { x = (V3<float>)fromJSON(Type.V3_Float,obj["x"])
153 , y = (V3<float>)fromJSON(Type.V3_Float,obj["y"])
154 , z = (V3<float>)fromJSON(Type.V3_Float,obj["z"])
155 };
156 case Type.V4_Float:
157 return new V4<float>
158 { x = (float)fromJSON(Type.Float,obj["x"])
159 , y = (float)fromJSON(Type.Float,obj["y"])
160 , z = (float)fromJSON(Type.Float,obj["z"])
161 , w = (float)fromJSON(Type.Float,obj["w"])
162 };
163 case Type.V4_V4_Float:
164 return new V4<V4<float>>
165 { x = (V4<float>)fromJSON(Type.V4_Float,obj["x"])
166 , y = (V4<float>)fromJSON(Type.V4_Float,obj["y"])
167 , z = (V4<float>)fromJSON(Type.V4_Float,obj["z"])
168 , w = (V4<float>)fromJSON(Type.V4_Float,obj["w"])
169 };
170 case Type.Array_Int32: return ((JArray)obj).Select(x => fromJSON (Type.Int32, x)).ToList();
171 case Type.Array_Word32: return ((JArray)obj).Select(x => fromJSON (Type.Word32, x)).ToList();
172 case Type.Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
173 case Type.Array_V2_Float: return ((JArray)obj).Select(x => fromJSON (Type.V2_Float, x)).ToList();
174 case Type.Array_V2_V2_Float: return ((JArray)obj).Select(x => fromJSON (Type.V2_V2_Float, x)).ToList();
175 case Type.Array_V3_Float: return ((JArray)obj).Select(x => fromJSON (Type.V3_Float, x)).ToList();
176 case Type.Array_V3_V3_Float: return ((JArray)obj).Select(x => fromJSON (Type.V3_V3_Float, x)).ToList();
177 case Type.Array_V4_Float: return ((JArray)obj).Select(x => fromJSON (Type.V4_Float, x)).ToList();
178 case Type.Array_V4_V4_Float: return ((JArray)obj).Select(x => fromJSON (Type.V4_V4_Float, x)).ToList();
179 case Type.Map_String_MeshAttribute: {
180 var map = new Dictionary<string, global::LambdaCube.Mesh.MeshAttribute> ();
181 foreach(var i in (JObject)obj) {
182 map.Add( (string)fromJSON(Type.String,i.Key)
183 , (global::LambdaCube.Mesh.MeshAttribute)fromJSON(Type.MeshAttribute,i.Value));
184 }
185 return map;
186 }
187
188 case Type.MeshAttribute: {
189 string tag = (string)obj["tag"];
190 MeshAttribute.Tag tagType;
191 if (tag == "A_Float") {
192 tagType = MeshAttribute.Tag.A_Float;
193 data.A_Float tv = new data.A_Float();
194 tv._0 = (List<float>)fromJSON(Type.Array_Float,obj["arg0"]);
195 return tv;
196 }
197 else if (tag == "A_V2F") {
198 tagType = MeshAttribute.Tag.A_V2F;
199 data.A_V2F tv = new data.A_V2F();
200 tv._0 = (List<V2<float>>)fromJSON(Type.Array_V2_Float,obj["arg0"]);
201 return tv;
202 }
203 else if (tag == "A_V3F") {
204 tagType = MeshAttribute.Tag.A_V3F;
205 data.A_V3F tv = new data.A_V3F();
206 tv._0 = (List<V3<float>>)fromJSON(Type.Array_V3_Float,obj["arg0"]);
207 return tv;
208 }
209 else if (tag == "A_V4F") {
210 tagType = MeshAttribute.Tag.A_V4F;
211 data.A_V4F tv = new data.A_V4F();
212 tv._0 = (List<V4<float>>)fromJSON(Type.Array_V4_Float,obj["arg0"]);
213 return tv;
214 }
215 else if (tag == "A_M22F") {
216 tagType = MeshAttribute.Tag.A_M22F;
217 data.A_M22F tv = new data.A_M22F();
218 tv._0 = (List<V2<V2<float>>>)fromJSON(Type.Array_V2_V2_Float,obj["arg0"]);
219 return tv;
220 }
221 else if (tag == "A_M33F") {
222 tagType = MeshAttribute.Tag.A_M33F;
223 data.A_M33F tv = new data.A_M33F();
224 tv._0 = (List<V3<V3<float>>>)fromJSON(Type.Array_V3_V3_Float,obj["arg0"]);
225 return tv;
226 }
227 else if (tag == "A_M44F") {
228 tagType = MeshAttribute.Tag.A_M44F;
229 data.A_M44F tv = new data.A_M44F();
230 tv._0 = (List<V4<V4<float>>>)fromJSON(Type.Array_V4_V4_Float,obj["arg0"]);
231 return tv;
232 }
233 else if (tag == "A_Int") {
234 tagType = MeshAttribute.Tag.A_Int;
235 data.A_Int tv = new data.A_Int();
236 tv._0 = (List<int>)fromJSON(Type.Array_Int32,obj["arg0"]);
237 return tv;
238 }
239 else if (tag == "A_Word") {
240 tagType = MeshAttribute.Tag.A_Word;
241 data.A_Word tv = new data.A_Word();
242 tv._0 = (List<uint>)fromJSON(Type.Array_Word32,obj["arg0"]);
243 return tv;
244 }
245 else throw new Exception("unknown constructor: " + tag);
246 MeshAttribute o = new MeshAttribute();
247 o.tag = tagType;
248 return o;
249 }
250 case Type.MeshPrimitive: {
251 string tag = (string)obj["tag"];
252 MeshPrimitive.Tag tagType;
253 if (tag == "P_Points") {
254 tagType = MeshPrimitive.Tag.P_Points;
255 }
256 else if (tag == "P_TriangleStrip") {
257 tagType = MeshPrimitive.Tag.P_TriangleStrip;
258 }
259 else if (tag == "P_Triangles") {
260 tagType = MeshPrimitive.Tag.P_Triangles;
261 }
262 else if (tag == "P_TriangleStripI") {
263 tagType = MeshPrimitive.Tag.P_TriangleStripI;
264 data.P_TriangleStripI tv = new data.P_TriangleStripI();
265 tv._0 = (List<int>)fromJSON(Type.Array_Int32,obj["arg0"]);
266 return tv;
267 }
268 else if (tag == "P_TrianglesI") {
269 tagType = MeshPrimitive.Tag.P_TrianglesI;
270 data.P_TrianglesI tv = new data.P_TrianglesI();
271 tv._0 = (List<int>)fromJSON(Type.Array_Int32,obj["arg0"]);
272 return tv;
273 }
274 else throw new Exception("unknown constructor: " + tag);
275 MeshPrimitive o = new MeshPrimitive();
276 o.tag = tagType;
277 return o;
278 }
279 case Type.Mesh: {
280 string tag = (string)obj["tag"];
281 Mesh.Tag tagType;
282 if (tag == "Mesh") {
283 tagType = Mesh.Tag.Mesh;
284 data.Mesh tv = new data.Mesh();
285 tv.mAttributes = (Dictionary<string, global::LambdaCube.Mesh.MeshAttribute>)fromJSON(Type.Map_String_MeshAttribute,obj["mAttributes"]);
286 tv.mPrimitive = (global::LambdaCube.Mesh.MeshPrimitive)fromJSON(Type.MeshPrimitive,obj["mPrimitive"]);
287 return tv;
288 }
289 else throw new Exception("unknown constructor: " + tag);
290 Mesh o = new Mesh();
291 o.tag = tagType;
292 return o;
293 }
294 }
295 throw new Exception("unknown type");
296 return null;
297 }
298
299 JToken toJSON(MeshAttribute v) {
300 var obj = new JObject();
301 switch (v.tag) {
302 case MeshAttribute.Tag.A_Float:
303 obj["tag"] = "A_Float";
304 {
305 var tv = (data.A_Float)v;
306 obj["arg0"] = toJSON(tv._0);
307 }
308 break;
309 case MeshAttribute.Tag.A_V2F:
310 obj["tag"] = "A_V2F";
311 {
312 var tv = (data.A_V2F)v;
313 obj["arg0"] = toJSON(tv._0);
314 }
315 break;
316 case MeshAttribute.Tag.A_V3F:
317 obj["tag"] = "A_V3F";
318 {
319 var tv = (data.A_V3F)v;
320 obj["arg0"] = toJSON(tv._0);
321 }
322 break;
323 case MeshAttribute.Tag.A_V4F:
324 obj["tag"] = "A_V4F";
325 {
326 var tv = (data.A_V4F)v;
327 obj["arg0"] = toJSON(tv._0);
328 }
329 break;
330 case MeshAttribute.Tag.A_M22F:
331 obj["tag"] = "A_M22F";
332 {
333 var tv = (data.A_M22F)v;
334 obj["arg0"] = toJSON(tv._0);
335 }
336 break;
337 case MeshAttribute.Tag.A_M33F:
338 obj["tag"] = "A_M33F";
339 {
340 var tv = (data.A_M33F)v;
341 obj["arg0"] = toJSON(tv._0);
342 }
343 break;
344 case MeshAttribute.Tag.A_M44F:
345 obj["tag"] = "A_M44F";
346 {
347 var tv = (data.A_M44F)v;
348 obj["arg0"] = toJSON(tv._0);
349 }
350 break;
351 case MeshAttribute.Tag.A_Int:
352 obj["tag"] = "A_Int";
353 {
354 var tv = (data.A_Int)v;
355 obj["arg0"] = toJSON(tv._0);
356 }
357 break;
358 case MeshAttribute.Tag.A_Word:
359 obj["tag"] = "A_Word";
360 {
361 var tv = (data.A_Word)v;
362 obj["arg0"] = toJSON(tv._0);
363 }
364 break;
365 }
366 return obj;
367 }
368 JToken toJSON(MeshPrimitive v) {
369 var obj = new JObject();
370 switch (v.tag) {
371 case MeshPrimitive.Tag.P_Points:
372 obj["tag"] = "P_Points";
373 break;
374 case MeshPrimitive.Tag.P_TriangleStrip:
375 obj["tag"] = "P_TriangleStrip";
376 break;
377 case MeshPrimitive.Tag.P_Triangles:
378 obj["tag"] = "P_Triangles";
379 break;
380 case MeshPrimitive.Tag.P_TriangleStripI:
381 obj["tag"] = "P_TriangleStripI";
382 {
383 var tv = (data.P_TriangleStripI)v;
384 obj["arg0"] = toJSON(tv._0);
385 }
386 break;
387 case MeshPrimitive.Tag.P_TrianglesI:
388 obj["tag"] = "P_TrianglesI";
389 {
390 var tv = (data.P_TrianglesI)v;
391 obj["arg0"] = toJSON(tv._0);
392 }
393 break;
394 }
395 return obj;
396 }
397 JToken toJSON(Mesh v) {
398 var obj = new JObject();
399 switch (v.tag) {
400 case Mesh.Tag.Mesh:
401 obj["tag"] = "Mesh";
402 {
403 var tv = (data.Mesh)v;
404 obj["mAttributes"] = toJSON(tv.mAttributes);
405 obj["mPrimitive"] = toJSON(tv.mPrimitive);
406 }
407 break;
408 }
409 return obj;
410 }
411
412 JToken toJSON(int v) { return new JValue(v); }
413 JToken toJSON(uint v) { return new JValue(v); }
414 JToken toJSON(float v) { return new JValue(v); }
415 JToken toJSON(string v) { return new JValue(v); }
416 JToken toJSON(V2<float> v) {
417 var obj = new JObject();
418 obj["x"] = toJSON(v.x);
419 obj["y"] = toJSON(v.y);
420 return obj;
421 }
422 JToken toJSON(V2<V2<float>> v) {
423 var obj = new JObject();
424 obj["x"] = toJSON(v.x);
425 obj["y"] = toJSON(v.y);
426 return obj;
427 }
428 JToken toJSON(V3<float> v) {
429 var obj = new JObject();
430 obj["x"] = toJSON(v.x);
431 obj["y"] = toJSON(v.y);
432 obj["z"] = toJSON(v.z);
433 return obj;
434 }
435 JToken toJSON(V3<V3<float>> v) {
436 var obj = new JObject();
437 obj["x"] = toJSON(v.x);
438 obj["y"] = toJSON(v.y);
439 obj["z"] = toJSON(v.z);
440 return obj;
441 }
442 JToken toJSON(V4<float> v) {
443 var obj = new JObject();
444 obj["x"] = toJSON(v.x);
445 obj["y"] = toJSON(v.y);
446 obj["z"] = toJSON(v.z);
447 obj["w"] = toJSON(v.w);
448 return obj;
449 }
450 JToken toJSON(V4<V4<float>> v) {
451 var obj = new JObject();
452 obj["x"] = toJSON(v.x);
453 obj["y"] = toJSON(v.y);
454 obj["z"] = toJSON(v.z);
455 obj["w"] = toJSON(v.w);
456 return obj;
457 }
458 JToken toJSON(List<int> v) {
459 var obj = new JArray();
460 foreach (var i in v) {
461 obj.Add(toJSON(i));
462 }
463 return obj;
464 }
465 JToken toJSON(List<uint> v) {
466 var obj = new JArray();
467 foreach (var i in v) {
468 obj.Add(toJSON(i));
469 }
470 return obj;
471 }
472 JToken toJSON(List<float> v) {
473 var obj = new JArray();
474 foreach (var i in v) {
475 obj.Add(toJSON(i));
476 }
477 return obj;
478 }
479 JToken toJSON(List<V2<float>> v) {
480 var obj = new JArray();
481 foreach (var i in v) {
482 obj.Add(toJSON(i));
483 }
484 return obj;
485 }
486 JToken toJSON(List<V2<V2<float>>> v) {
487 var obj = new JArray();
488 foreach (var i in v) {
489 obj.Add(toJSON(i));
490 }
491 return obj;
492 }
493 JToken toJSON(List<V3<float>> v) {
494 var obj = new JArray();
495 foreach (var i in v) {
496 obj.Add(toJSON(i));
497 }
498 return obj;
499 }
500 JToken toJSON(List<V3<V3<float>>> v) {
501 var obj = new JArray();
502 foreach (var i in v) {
503 obj.Add(toJSON(i));
504 }
505 return obj;
506 }
507 JToken toJSON(List<V4<float>> v) {
508 var obj = new JArray();
509 foreach (var i in v) {
510 obj.Add(toJSON(i));
511 }
512 return obj;
513 }
514 JToken toJSON(List<V4<V4<float>>> v) {
515 var obj = new JArray();
516 foreach (var i in v) {
517 obj.Add(toJSON(i));
518 }
519 return obj;
520 }
521 JToken toJSON(Dictionary<string, global::LambdaCube.Mesh.MeshAttribute> v) {
522 var obj = new JObject();
523 foreach (var i in v) {
524 obj[i.Key] = toJSON(i.Value);
525 }
526 return obj;
527 }
528 }
529}
diff --git a/ddl/out/LambdaCube.Mesh.hpp b/ddl/out/LambdaCube.Mesh.hpp
index 29bb2ba..d0899fd 100644
--- a/ddl/out/LambdaCube.Mesh.hpp
+++ b/ddl/out/LambdaCube.Mesh.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.781208000000Z 3// 2016-03-01T13:00:40.781208000000Z
4=======
5// 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.Mesh_H 8#ifndef HEADER_LambdaCube.Mesh_H
5#define HEADER_LambdaCube.Mesh_H 9#define HEADER_LambdaCube.Mesh_H
diff --git a/ddl/out/LambdaCube.Mesh.hs b/ddl/out/LambdaCube.Mesh.hs
index 1e7926a..ddf90c9 100644
--- a/ddl/out/LambdaCube.Mesh.hs
+++ b/ddl/out/LambdaCube.Mesh.hs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.781208000000Z 3-- 2016-03-01T13:00:40.781208000000Z
4=======
5-- 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 8{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module LambdaCube.Mesh where 9module LambdaCube.Mesh where
diff --git a/ddl/out/LambdaCube.Mesh.java b/ddl/out/LambdaCube.Mesh.java
new file mode 100644
index 0000000..2cf85c7
--- /dev/null
+++ b/ddl/out/LambdaCube.Mesh.java
@@ -0,0 +1,79 @@
1// generated file, do not modify!
2// 2016-03-14T10:58:29.976813000000Z
3
4
5public class LambdaCube.Mesh {
6 public class MeshAttribute {
7 public enum Tag {
8 A_Float,
9 A_V2F,
10 A_V3F,
11 A_V4F,
12 A_M22F,
13 A_M33F,
14 A_M44F,
15 A_Int,
16 A_Word
17 }
18 public Tag tag;
19
20 public class A_Float extends MeshAttribute {
21 public ArrayList<Float> _0;
22 }
23 public class A_V2F extends MeshAttribute {
24 public ArrayList<int> _0;
25 }
26 public class A_V3F extends MeshAttribute {
27 public ArrayList<int> _0;
28 }
29 public class A_V4F extends MeshAttribute {
30 public ArrayList<int> _0;
31 }
32 public class A_M22F extends MeshAttribute {
33 public ArrayList<int> _0;
34 }
35 public class A_M33F extends MeshAttribute {
36 public ArrayList<int> _0;
37 }
38 public class A_M44F extends MeshAttribute {
39 public ArrayList<int> _0;
40 }
41 public class A_Int extends MeshAttribute {
42 public ArrayList<Integer> _0;
43 }
44 public class A_Word extends MeshAttribute {
45 public ArrayList<Integer> _0;
46 }
47 }
48
49 public class MeshPrimitive {
50 public enum Tag {
51 P_Points,
52 P_TriangleStrip,
53 P_Triangles,
54 P_TriangleStripI,
55 P_TrianglesI
56 }
57 public Tag tag;
58
59 public class P_TriangleStripI extends MeshPrimitive {
60 public ArrayList<Integer> _0;
61 }
62 public class P_TrianglesI extends MeshPrimitive {
63 public ArrayList<Integer> _0;
64 }
65 }
66
67 public class Mesh {
68 public enum Tag {
69 Mesh
70 }
71 public Tag tag;
72
73 public class Mesh extends Mesh {
74 public HashMap<String, MeshAttribute> mAttributes;
75 public MeshPrimitive mPrimitive;
76 }
77 }
78
79} \ No newline at end of file
diff --git a/ddl/out/LambdaCube.Mesh.purs b/ddl/out/LambdaCube.Mesh.purs
index 22a8380..60a61e2 100644
--- a/ddl/out/LambdaCube.Mesh.purs
+++ b/ddl/out/LambdaCube.Mesh.purs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.781208000000Z 3-- 2016-03-01T13:00:40.781208000000Z
4=======
5-- 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4module LambdaCube.Mesh where 8module LambdaCube.Mesh where
5import Prelude 9import Prelude
diff --git a/ddl/out/LambdaCube.Mesh.swift b/ddl/out/LambdaCube.Mesh.swift
index e300c0f..ff4ac52 100644
--- a/ddl/out/LambdaCube.Mesh.swift
+++ b/ddl/out/LambdaCube.Mesh.swift
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.781208000000Z 3// 2016-03-01T13:00:40.781208000000Z
4=======
5// 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4enum MeshAttribute { 8enum MeshAttribute {
5 case A_Float(Array<Float>) 9 case A_Float(Array<Float>)
diff --git a/ddl/out/LambdaCube.Mesh2.hpp b/ddl/out/LambdaCube.Mesh2.hpp
index 56cf730..fc84a17 100644
--- a/ddl/out/LambdaCube.Mesh2.hpp
+++ b/ddl/out/LambdaCube.Mesh2.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.781208000000Z 3// 2016-03-01T13:00:40.781208000000Z
4=======
5// 2016-03-20T21:42:12.936741000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.Mesh_H 8#ifndef HEADER_LambdaCube.Mesh_H
5#define HEADER_LambdaCube.Mesh_H 9#define HEADER_LambdaCube.Mesh_H
diff --git a/ddl/out/LambdaCube.PipelineSchema.cpp b/ddl/out/LambdaCube.PipelineSchema.cpp
index 9e2604a..450bf72 100644
--- a/ddl/out/LambdaCube.PipelineSchema.cpp
+++ b/ddl/out/LambdaCube.PipelineSchema.cpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.761274000000Z 3// 2016-03-01T13:00:40.761274000000Z
4=======
5// 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4#include "LambdaCube.PipelineSchema.hpp" 8#include "LambdaCube.PipelineSchema.hpp"
5template<> json toJSON<std::shared_ptr<StreamType>>(std::shared_ptr<StreamType> &v) { 9template<> json toJSON<std::shared_ptr<StreamType>>(std::shared_ptr<StreamType> &v) {
diff --git a/ddl/out/LambdaCube.PipelineSchema.cs b/ddl/out/LambdaCube.PipelineSchema.cs
new file mode 100644
index 0000000..945ae0c
--- /dev/null
+++ b/ddl/out/LambdaCube.PipelineSchema.cs
@@ -0,0 +1,339 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9using LambdaCube.IR;
10
11namespace LambdaCube.PipelineSchema {
12 class StreamType {
13 public enum Tag {
14 Attribute_Word,
15 Attribute_V2U,
16 Attribute_V3U,
17 Attribute_V4U,
18 Attribute_Int,
19 Attribute_V2I,
20 Attribute_V3I,
21 Attribute_V4I,
22 Attribute_Float,
23 Attribute_V2F,
24 Attribute_V3F,
25 Attribute_V4F,
26 Attribute_M22F,
27 Attribute_M23F,
28 Attribute_M24F,
29 Attribute_M32F,
30 Attribute_M33F,
31 Attribute_M34F,
32 Attribute_M42F,
33 Attribute_M43F,
34 Attribute_M44F
35 };
36 public Tag tag;
37 };
38
39 namespace data {
40 }
41 class ObjectArraySchema {
42 public enum Tag {
43 ObjectArraySchema
44 };
45 public Tag tag;
46 };
47
48 namespace data {
49 class ObjectArraySchema : LambdaCube.PipelineSchema.ObjectArraySchema {
50 public global::LambdaCube.PipelineSchema.FetchPrimitive primitive;
51 public Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> attributes;
52 public ObjectArraySchema() { tag = LambdaCube.PipelineSchema.ObjectArraySchema.Tag.ObjectArraySchema; }
53 };
54 }
55 class PipelineSchema {
56 public enum Tag {
57 PipelineSchema
58 };
59 public Tag tag;
60 };
61
62 namespace data {
63 class PipelineSchema : LambdaCube.PipelineSchema.PipelineSchema {
64 public Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> objectArrays;
65 public Dictionary<string, global::LambdaCube.PipelineSchema.InputType> uniforms;
66 public PipelineSchema() { tag = LambdaCube.PipelineSchema.PipelineSchema.Tag.PipelineSchema; }
67 };
68 }
69
70 // JSON deserializer
71 enum Type {
72 String,
73 Map_String_InputType,
74 Map_String_ObjectArraySchema,
75 Map_String_StreamType,
76 FetchPrimitive,
77 InputType,
78 ObjectArraySchema,
79 PipelineSchema,
80 StreamType
81 }
82
83 class Loader {
84 public static object fromJSON(Type type, JToken obj) {
85 switch (type) {
86 case Type.String: return (string)obj;
87 case Type.Map_String_InputType: {
88 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.InputType> ();
89 foreach(var i in (JObject)obj) {
90 map.Add( (string)fromJSON(Type.String,i.Key)
91 , (global::LambdaCube.PipelineSchema.InputType)fromJSON(Type.InputType,i.Value));
92 }
93 return map;
94 }
95 case Type.Map_String_ObjectArraySchema: {
96 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> ();
97 foreach(var i in (JObject)obj) {
98 map.Add( (string)fromJSON(Type.String,i.Key)
99 , (global::LambdaCube.PipelineSchema.ObjectArraySchema)fromJSON(Type.ObjectArraySchema,i.Value));
100 }
101 return map;
102 }
103 case Type.Map_String_StreamType: {
104 var map = new Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> ();
105 foreach(var i in (JObject)obj) {
106 map.Add( (string)fromJSON(Type.String,i.Key)
107 , (global::LambdaCube.PipelineSchema.StreamType)fromJSON(Type.StreamType,i.Value));
108 }
109 return map;
110 }
111
112 case Type.StreamType: {
113 string tag = (string)obj["tag"];
114 StreamType.Tag tagType;
115 if (tag == "Attribute_Word") {
116 tagType = StreamType.Tag.Attribute_Word;
117 }
118 else if (tag == "Attribute_V2U") {
119 tagType = StreamType.Tag.Attribute_V2U;
120 }
121 else if (tag == "Attribute_V3U") {
122 tagType = StreamType.Tag.Attribute_V3U;
123 }
124 else if (tag == "Attribute_V4U") {
125 tagType = StreamType.Tag.Attribute_V4U;
126 }
127 else if (tag == "Attribute_Int") {
128 tagType = StreamType.Tag.Attribute_Int;
129 }
130 else if (tag == "Attribute_V2I") {
131 tagType = StreamType.Tag.Attribute_V2I;
132 }
133 else if (tag == "Attribute_V3I") {
134 tagType = StreamType.Tag.Attribute_V3I;
135 }
136 else if (tag == "Attribute_V4I") {
137 tagType = StreamType.Tag.Attribute_V4I;
138 }
139 else if (tag == "Attribute_Float") {
140 tagType = StreamType.Tag.Attribute_Float;
141 }
142 else if (tag == "Attribute_V2F") {
143 tagType = StreamType.Tag.Attribute_V2F;
144 }
145 else if (tag == "Attribute_V3F") {
146 tagType = StreamType.Tag.Attribute_V3F;
147 }
148 else if (tag == "Attribute_V4F") {
149 tagType = StreamType.Tag.Attribute_V4F;
150 }
151 else if (tag == "Attribute_M22F") {
152 tagType = StreamType.Tag.Attribute_M22F;
153 }
154 else if (tag == "Attribute_M23F") {
155 tagType = StreamType.Tag.Attribute_M23F;
156 }
157 else if (tag == "Attribute_M24F") {
158 tagType = StreamType.Tag.Attribute_M24F;
159 }
160 else if (tag == "Attribute_M32F") {
161 tagType = StreamType.Tag.Attribute_M32F;
162 }
163 else if (tag == "Attribute_M33F") {
164 tagType = StreamType.Tag.Attribute_M33F;
165 }
166 else if (tag == "Attribute_M34F") {
167 tagType = StreamType.Tag.Attribute_M34F;
168 }
169 else if (tag == "Attribute_M42F") {
170 tagType = StreamType.Tag.Attribute_M42F;
171 }
172 else if (tag == "Attribute_M43F") {
173 tagType = StreamType.Tag.Attribute_M43F;
174 }
175 else if (tag == "Attribute_M44F") {
176 tagType = StreamType.Tag.Attribute_M44F;
177 }
178 else throw new Exception("unknown constructor: " + tag);
179 StreamType o = new StreamType();
180 o.tag = tagType;
181 return o;
182 }
183 case Type.ObjectArraySchema: {
184 string tag = (string)obj["tag"];
185 ObjectArraySchema.Tag tagType;
186 if (tag == "ObjectArraySchema") {
187 tagType = ObjectArraySchema.Tag.ObjectArraySchema;
188 data.ObjectArraySchema tv = new data.ObjectArraySchema();
189 tv.primitive = (global::LambdaCube.PipelineSchema.FetchPrimitive)fromJSON(Type.FetchPrimitive,obj["primitive"]);
190 tv.attributes = (Dictionary<string, global::LambdaCube.PipelineSchema.StreamType>)fromJSON(Type.Map_String_StreamType,obj["attributes"]);
191 return tv;
192 }
193 else throw new Exception("unknown constructor: " + tag);
194 ObjectArraySchema o = new ObjectArraySchema();
195 o.tag = tagType;
196 return o;
197 }
198 case Type.PipelineSchema: {
199 string tag = (string)obj["tag"];
200 PipelineSchema.Tag tagType;
201 if (tag == "PipelineSchema") {
202 tagType = PipelineSchema.Tag.PipelineSchema;
203 data.PipelineSchema tv = new data.PipelineSchema();
204 tv.objectArrays = (Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema>)fromJSON(Type.Map_String_ObjectArraySchema,obj["objectArrays"]);
205 tv.uniforms = (Dictionary<string, global::LambdaCube.PipelineSchema.InputType>)fromJSON(Type.Map_String_InputType,obj["uniforms"]);
206 return tv;
207 }
208 else throw new Exception("unknown constructor: " + tag);
209 PipelineSchema o = new PipelineSchema();
210 o.tag = tagType;
211 return o;
212 }
213 }
214 throw new Exception("unknown type");
215 return null;
216 }
217
218 JToken toJSON(StreamType v) {
219 var obj = new JObject();
220 switch (v.tag) {
221 case StreamType.Tag.Attribute_Word:
222 obj["tag"] = "Attribute_Word";
223 break;
224 case StreamType.Tag.Attribute_V2U:
225 obj["tag"] = "Attribute_V2U";
226 break;
227 case StreamType.Tag.Attribute_V3U:
228 obj["tag"] = "Attribute_V3U";
229 break;
230 case StreamType.Tag.Attribute_V4U:
231 obj["tag"] = "Attribute_V4U";
232 break;
233 case StreamType.Tag.Attribute_Int:
234 obj["tag"] = "Attribute_Int";
235 break;
236 case StreamType.Tag.Attribute_V2I:
237 obj["tag"] = "Attribute_V2I";
238 break;
239 case StreamType.Tag.Attribute_V3I:
240 obj["tag"] = "Attribute_V3I";
241 break;
242 case StreamType.Tag.Attribute_V4I:
243 obj["tag"] = "Attribute_V4I";
244 break;
245 case StreamType.Tag.Attribute_Float:
246 obj["tag"] = "Attribute_Float";
247 break;
248 case StreamType.Tag.Attribute_V2F:
249 obj["tag"] = "Attribute_V2F";
250 break;
251 case StreamType.Tag.Attribute_V3F:
252 obj["tag"] = "Attribute_V3F";
253 break;
254 case StreamType.Tag.Attribute_V4F:
255 obj["tag"] = "Attribute_V4F";
256 break;
257 case StreamType.Tag.Attribute_M22F:
258 obj["tag"] = "Attribute_M22F";
259 break;
260 case StreamType.Tag.Attribute_M23F:
261 obj["tag"] = "Attribute_M23F";
262 break;
263 case StreamType.Tag.Attribute_M24F:
264 obj["tag"] = "Attribute_M24F";
265 break;
266 case StreamType.Tag.Attribute_M32F:
267 obj["tag"] = "Attribute_M32F";
268 break;
269 case StreamType.Tag.Attribute_M33F:
270 obj["tag"] = "Attribute_M33F";
271 break;
272 case StreamType.Tag.Attribute_M34F:
273 obj["tag"] = "Attribute_M34F";
274 break;
275 case StreamType.Tag.Attribute_M42F:
276 obj["tag"] = "Attribute_M42F";
277 break;
278 case StreamType.Tag.Attribute_M43F:
279 obj["tag"] = "Attribute_M43F";
280 break;
281 case StreamType.Tag.Attribute_M44F:
282 obj["tag"] = "Attribute_M44F";
283 break;
284 }
285 return obj;
286 }
287 JToken toJSON(ObjectArraySchema v) {
288 var obj = new JObject();
289 switch (v.tag) {
290 case ObjectArraySchema.Tag.ObjectArraySchema:
291 obj["tag"] = "ObjectArraySchema";
292 {
293 var tv = (data.ObjectArraySchema)v;
294 obj["primitive"] = toJSON(tv.primitive);
295 obj["attributes"] = toJSON(tv.attributes);
296 }
297 break;
298 }
299 return obj;
300 }
301 JToken toJSON(PipelineSchema v) {
302 var obj = new JObject();
303 switch (v.tag) {
304 case PipelineSchema.Tag.PipelineSchema:
305 obj["tag"] = "PipelineSchema";
306 {
307 var tv = (data.PipelineSchema)v;
308 obj["objectArrays"] = toJSON(tv.objectArrays);
309 obj["uniforms"] = toJSON(tv.uniforms);
310 }
311 break;
312 }
313 return obj;
314 }
315
316 JToken toJSON(string v) { return new JValue(v); }
317 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.InputType> v) {
318 var obj = new JObject();
319 foreach (var i in v) {
320 obj[i.Key] = toJSON(i.Value);
321 }
322 return obj;
323 }
324 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.ObjectArraySchema> v) {
325 var obj = new JObject();
326 foreach (var i in v) {
327 obj[i.Key] = toJSON(i.Value);
328 }
329 return obj;
330 }
331 JToken toJSON(Dictionary<string, global::LambdaCube.PipelineSchema.StreamType> v) {
332 var obj = new JObject();
333 foreach (var i in v) {
334 obj[i.Key] = toJSON(i.Value);
335 }
336 return obj;
337 }
338 }
339}
diff --git a/ddl/out/LambdaCube.PipelineSchema.hpp b/ddl/out/LambdaCube.PipelineSchema.hpp
index 82e9853..afddf06 100644
--- a/ddl/out/LambdaCube.PipelineSchema.hpp
+++ b/ddl/out/LambdaCube.PipelineSchema.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.761274000000Z 3// 2016-03-01T13:00:40.761274000000Z
4=======
5// 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.PipelineSchema_H 8#ifndef HEADER_LambdaCube.PipelineSchema_H
5#define HEADER_LambdaCube.PipelineSchema_H 9#define HEADER_LambdaCube.PipelineSchema_H
diff --git a/ddl/out/LambdaCube.PipelineSchema.hs b/ddl/out/LambdaCube.PipelineSchema.hs
index ba83200..90ad67a 100644
--- a/ddl/out/LambdaCube.PipelineSchema.hs
+++ b/ddl/out/LambdaCube.PipelineSchema.hs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.761274000000Z 3-- 2016-03-01T13:00:40.761274000000Z
4=======
5-- 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 8{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module LambdaCube.PipelineSchema where 9module LambdaCube.PipelineSchema where
diff --git a/ddl/out/LambdaCube.PipelineSchema.java b/ddl/out/LambdaCube.PipelineSchema.java
new file mode 100644
index 0000000..c71e7c0
--- /dev/null
+++ b/ddl/out/LambdaCube.PipelineSchema.java
@@ -0,0 +1,59 @@
1// generated file, do not modify!
2// 2016-03-14T10:58:29.954220000000Z
3
4import LambdaCube.IR;
5
6public class LambdaCube.PipelineSchema {
7 public class StreamType {
8 public enum Tag {
9 Attribute_Word,
10 Attribute_V2U,
11 Attribute_V3U,
12 Attribute_V4U,
13 Attribute_Int,
14 Attribute_V2I,
15 Attribute_V3I,
16 Attribute_V4I,
17 Attribute_Float,
18 Attribute_V2F,
19 Attribute_V3F,
20 Attribute_V4F,
21 Attribute_M22F,
22 Attribute_M23F,
23 Attribute_M24F,
24 Attribute_M32F,
25 Attribute_M33F,
26 Attribute_M34F,
27 Attribute_M42F,
28 Attribute_M43F,
29 Attribute_M44F
30 }
31 public Tag tag;
32
33 }
34
35 public class ObjectArraySchema {
36 public enum Tag {
37 ObjectArraySchema
38 }
39 public Tag tag;
40
41 public class ObjectArraySchema extends ObjectArraySchema {
42 public FetchPrimitive primitive;
43 public HashMap<String, StreamType> attributes;
44 }
45 }
46
47 public class PipelineSchema {
48 public enum Tag {
49 PipelineSchema
50 }
51 public Tag tag;
52
53 public class PipelineSchema extends PipelineSchema {
54 public HashMap<String, ObjectArraySchema> objectArrays;
55 public HashMap<String, InputType> uniforms;
56 }
57 }
58
59} \ No newline at end of file
diff --git a/ddl/out/LambdaCube.PipelineSchema.purs b/ddl/out/LambdaCube.PipelineSchema.purs
index 1f741cb..a1919a1 100644
--- a/ddl/out/LambdaCube.PipelineSchema.purs
+++ b/ddl/out/LambdaCube.PipelineSchema.purs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.761274000000Z 3-- 2016-03-01T13:00:40.761274000000Z
4=======
5-- 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4module LambdaCube.PipelineSchema where 8module LambdaCube.PipelineSchema where
5import Prelude 9import Prelude
diff --git a/ddl/out/LambdaCube.PipelineSchema.swift b/ddl/out/LambdaCube.PipelineSchema.swift
index 0c48df8..418ed7b 100644
--- a/ddl/out/LambdaCube.PipelineSchema.swift
+++ b/ddl/out/LambdaCube.PipelineSchema.swift
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.761274000000Z 3// 2016-03-01T13:00:40.761274000000Z
4=======
5// 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4enum StreamType { 8enum StreamType {
5 case Attribute_Word 9 case Attribute_Word
diff --git a/ddl/out/LambdaCube.PipelineSchema2.hpp b/ddl/out/LambdaCube.PipelineSchema2.hpp
index 691aa9b..9d5acfe 100644
--- a/ddl/out/LambdaCube.PipelineSchema2.hpp
+++ b/ddl/out/LambdaCube.PipelineSchema2.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.761274000000Z 3// 2016-03-01T13:00:40.761274000000Z
4=======
5// 2016-03-20T21:42:12.892571000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.PipelineSchema_H 8#ifndef HEADER_LambdaCube.PipelineSchema_H
5#define HEADER_LambdaCube.PipelineSchema_H 9#define HEADER_LambdaCube.PipelineSchema_H
diff --git a/ddl/out/LambdaCube.TypeInfo.cpp b/ddl/out/LambdaCube.TypeInfo.cpp
index bf793c3..a32436c 100644
--- a/ddl/out/LambdaCube.TypeInfo.cpp
+++ b/ddl/out/LambdaCube.TypeInfo.cpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.810157000000Z 3// 2016-03-01T13:00:40.810157000000Z
4=======
5// 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4#include "LambdaCube.TypeInfo.hpp" 8#include "LambdaCube.TypeInfo.hpp"
5template<> json toJSON<std::shared_ptr<Range>>(std::shared_ptr<Range> &v) { 9template<> json toJSON<std::shared_ptr<Range>>(std::shared_ptr<Range> &v) {
diff --git a/ddl/out/LambdaCube.TypeInfo.cs b/ddl/out/LambdaCube.TypeInfo.cs
new file mode 100644
index 0000000..967aa01
--- /dev/null
+++ b/ddl/out/LambdaCube.TypeInfo.cs
@@ -0,0 +1,218 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.460562000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9using LambdaCube.IR;
10
11namespace LambdaCube.TypeInfo {
12 class Range {
13 public enum Tag {
14 Range
15 };
16 public Tag tag;
17 };
18
19 namespace data {
20 class Range : LambdaCube.TypeInfo.Range {
21 public int startLine;
22 public int startColumn;
23 public int endLine;
24 public int endColumn;
25 public Range() { tag = LambdaCube.TypeInfo.Range.Tag.Range; }
26 };
27 }
28 class TypeInfo {
29 public enum Tag {
30 TypeInfo
31 };
32 public Tag tag;
33 };
34
35 namespace data {
36 class TypeInfo : LambdaCube.TypeInfo.TypeInfo {
37 public global::LambdaCube.TypeInfo.Range range;
38 public string text;
39 public TypeInfo() { tag = LambdaCube.TypeInfo.TypeInfo.Tag.TypeInfo; }
40 };
41 }
42 class CompileResult {
43 public enum Tag {
44 CompileError,
45 Compiled
46 };
47 public Tag tag;
48 };
49
50 namespace data {
51 class CompileError : LambdaCube.TypeInfo.CompileResult {
52 public List<global::LambdaCube.TypeInfo.Range> _0;
53 public string _1;
54 public List<global::LambdaCube.TypeInfo.TypeInfo> _2;
55 public CompileError() { tag = LambdaCube.TypeInfo.CompileResult.Tag.CompileError; }
56 };
57 class Compiled : LambdaCube.TypeInfo.CompileResult {
58 public string _0;
59 public global::LambdaCube.TypeInfo.Pipeline _1;
60 public List<global::LambdaCube.TypeInfo.TypeInfo> _2;
61 public Compiled() { tag = LambdaCube.TypeInfo.CompileResult.Tag.Compiled; }
62 };
63 }
64
65 // JSON deserializer
66 enum Type {
67 Int,
68 String,
69 Array_Range,
70 Array_TypeInfo,
71 CompileResult,
72 Pipeline,
73 Range,
74 TypeInfo
75 }
76
77 class Loader {
78 public static object fromJSON(Type type, JToken obj) {
79 switch (type) {
80 case Type.Int: return (int)obj;
81 case Type.String: return (string)obj;
82 case Type.Array_Range: return ((JArray)obj).Select(x => fromJSON (Type.Range, x)).ToList();
83 case Type.Array_TypeInfo: return ((JArray)obj).Select(x => fromJSON (Type.TypeInfo, x)).ToList();
84
85 case Type.Range: {
86 string tag = (string)obj["tag"];
87 Range.Tag tagType;
88 if (tag == "Range") {
89 tagType = Range.Tag.Range;
90 data.Range tv = new data.Range();
91 tv.startLine = (int)fromJSON(Type.Int,obj["startLine"]);
92 tv.startColumn = (int)fromJSON(Type.Int,obj["startColumn"]);
93 tv.endLine = (int)fromJSON(Type.Int,obj["endLine"]);
94 tv.endColumn = (int)fromJSON(Type.Int,obj["endColumn"]);
95 return tv;
96 }
97 else throw new Exception("unknown constructor: " + tag);
98 Range o = new Range();
99 o.tag = tagType;
100 return o;
101 }
102 case Type.TypeInfo: {
103 string tag = (string)obj["tag"];
104 TypeInfo.Tag tagType;
105 if (tag == "TypeInfo") {
106 tagType = TypeInfo.Tag.TypeInfo;
107 data.TypeInfo tv = new data.TypeInfo();
108 tv.range = (global::LambdaCube.TypeInfo.Range)fromJSON(Type.Range,obj["range"]);
109 tv.text = (string)fromJSON(Type.String,obj["text"]);
110 return tv;
111 }
112 else throw new Exception("unknown constructor: " + tag);
113 TypeInfo o = new TypeInfo();
114 o.tag = tagType;
115 return o;
116 }
117 case Type.CompileResult: {
118 string tag = (string)obj["tag"];
119 CompileResult.Tag tagType;
120 if (tag == "CompileError") {
121 tagType = CompileResult.Tag.CompileError;
122 data.CompileError tv = new data.CompileError();
123 tv._0 = (List<global::LambdaCube.TypeInfo.Range>)fromJSON(Type.Array_Range,obj["arg0"]);
124 tv._1 = (string)fromJSON(Type.String,obj["arg1"]);
125 tv._2 = (List<global::LambdaCube.TypeInfo.TypeInfo>)fromJSON(Type.Array_TypeInfo,obj["arg2"]);
126 return tv;
127 }
128 else if (tag == "Compiled") {
129 tagType = CompileResult.Tag.Compiled;
130 data.Compiled tv = new data.Compiled();
131 tv._0 = (string)fromJSON(Type.String,obj["arg0"]);
132 tv._1 = (global::LambdaCube.TypeInfo.Pipeline)fromJSON(Type.Pipeline,obj["arg1"]);
133 tv._2 = (List<global::LambdaCube.TypeInfo.TypeInfo>)fromJSON(Type.Array_TypeInfo,obj["arg2"]);
134 return tv;
135 }
136 else throw new Exception("unknown constructor: " + tag);
137 CompileResult o = new CompileResult();
138 o.tag = tagType;
139 return o;
140 }
141 }
142 throw new Exception("unknown type");
143 return null;
144 }
145
146 JToken toJSON(Range v) {
147 var obj = new JObject();
148 switch (v.tag) {
149 case Range.Tag.Range:
150 obj["tag"] = "Range";
151 {
152 var tv = (data.Range)v;
153 obj["startLine"] = toJSON(tv.startLine);
154 obj["startColumn"] = toJSON(tv.startColumn);
155 obj["endLine"] = toJSON(tv.endLine);
156 obj["endColumn"] = toJSON(tv.endColumn);
157 }
158 break;
159 }
160 return obj;
161 }
162 JToken toJSON(TypeInfo v) {
163 var obj = new JObject();
164 switch (v.tag) {
165 case TypeInfo.Tag.TypeInfo:
166 obj["tag"] = "TypeInfo";
167 {
168 var tv = (data.TypeInfo)v;
169 obj["range"] = toJSON(tv.range);
170 obj["text"] = toJSON(tv.text);
171 }
172 break;
173 }
174 return obj;
175 }
176 JToken toJSON(CompileResult v) {
177 var obj = new JObject();
178 switch (v.tag) {
179 case CompileResult.Tag.CompileError:
180 obj["tag"] = "CompileError";
181 {
182 var tv = (data.CompileError)v;
183 obj["arg0"] = toJSON(tv._0);
184 obj["arg1"] = toJSON(tv._1);
185 obj["arg2"] = toJSON(tv._2);
186 }
187 break;
188 case CompileResult.Tag.Compiled:
189 obj["tag"] = "Compiled";
190 {
191 var tv = (data.Compiled)v;
192 obj["arg0"] = toJSON(tv._0);
193 obj["arg1"] = toJSON(tv._1);
194 obj["arg2"] = toJSON(tv._2);
195 }
196 break;
197 }
198 return obj;
199 }
200
201 JToken toJSON(int v) { return new JValue(v); }
202 JToken toJSON(string v) { return new JValue(v); }
203 JToken toJSON(List<global::LambdaCube.TypeInfo.Range> v) {
204 var obj = new JArray();
205 foreach (var i in v) {
206 obj.Add(toJSON(i));
207 }
208 return obj;
209 }
210 JToken toJSON(List<global::LambdaCube.TypeInfo.TypeInfo> v) {
211 var obj = new JArray();
212 foreach (var i in v) {
213 obj.Add(toJSON(i));
214 }
215 return obj;
216 }
217 }
218}
diff --git a/ddl/out/LambdaCube.TypeInfo.hpp b/ddl/out/LambdaCube.TypeInfo.hpp
index 66a4eba..05fbd45 100644
--- a/ddl/out/LambdaCube.TypeInfo.hpp
+++ b/ddl/out/LambdaCube.TypeInfo.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.810157000000Z 3// 2016-03-01T13:00:40.810157000000Z
4=======
5// 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.TypeInfo_H 8#ifndef HEADER_LambdaCube.TypeInfo_H
5#define HEADER_LambdaCube.TypeInfo_H 9#define HEADER_LambdaCube.TypeInfo_H
diff --git a/ddl/out/LambdaCube.TypeInfo.hs b/ddl/out/LambdaCube.TypeInfo.hs
index 77ccbfd..fa8ddc6 100644
--- a/ddl/out/LambdaCube.TypeInfo.hs
+++ b/ddl/out/LambdaCube.TypeInfo.hs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.810157000000Z 3-- 2016-03-01T13:00:40.810157000000Z
4=======
5-- 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 8{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module LambdaCube.TypeInfo where 9module LambdaCube.TypeInfo where
diff --git a/ddl/out/LambdaCube.TypeInfo.java b/ddl/out/LambdaCube.TypeInfo.java
new file mode 100644
index 0000000..59c2a26
--- /dev/null
+++ b/ddl/out/LambdaCube.TypeInfo.java
@@ -0,0 +1,52 @@
1// generated file, do not modify!
2// 2016-03-14T10:58:30.014693000000Z
3
4import LambdaCube.IR;
5
6public class LambdaCube.TypeInfo {
7 public class Range {
8 public enum Tag {
9 Range
10 }
11 public Tag tag;
12
13 public class Range extends Range {
14 public Integer startLine;
15 public Integer startColumn;
16 public Integer endLine;
17 public Integer endColumn;
18 }
19 }
20
21 public class TypeInfo {
22 public enum Tag {
23 TypeInfo
24 }
25 public Tag tag;
26
27 public class TypeInfo extends TypeInfo {
28 public Range range;
29 public String text;
30 }
31 }
32
33 public class CompileResult {
34 public enum Tag {
35 CompileError,
36 Compiled
37 }
38 public Tag tag;
39
40 public class CompileError extends CompileResult {
41 public ArrayList<Range> _0;
42 public String _1;
43 public ArrayList<TypeInfo> _2;
44 }
45 public class Compiled extends CompileResult {
46 public String _0;
47 public Pipeline _1;
48 public ArrayList<TypeInfo> _2;
49 }
50 }
51
52} \ No newline at end of file
diff --git a/ddl/out/LambdaCube.TypeInfo.purs b/ddl/out/LambdaCube.TypeInfo.purs
index 1b7cef8..b33afda 100644
--- a/ddl/out/LambdaCube.TypeInfo.purs
+++ b/ddl/out/LambdaCube.TypeInfo.purs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.810157000000Z 3-- 2016-03-01T13:00:40.810157000000Z
4=======
5-- 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4module LambdaCube.TypeInfo where 8module LambdaCube.TypeInfo where
5import Prelude 9import Prelude
diff --git a/ddl/out/LambdaCube.TypeInfo.swift b/ddl/out/LambdaCube.TypeInfo.swift
index 8bb041f..e4776e9 100644
--- a/ddl/out/LambdaCube.TypeInfo.swift
+++ b/ddl/out/LambdaCube.TypeInfo.swift
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.810157000000Z 3// 2016-03-01T13:00:40.810157000000Z
4=======
5// 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4enum Range { 8enum Range {
5 case Range(Range_Data) 9 case Range(Range_Data)
diff --git a/ddl/out/LambdaCube.TypeInfo2.hpp b/ddl/out/LambdaCube.TypeInfo2.hpp
index f80978f..8a69dcf 100644
--- a/ddl/out/LambdaCube.TypeInfo2.hpp
+++ b/ddl/out/LambdaCube.TypeInfo2.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.810157000000Z 3// 2016-03-01T13:00:40.810157000000Z
4=======
5// 2016-03-20T21:42:12.996366000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_LambdaCube.TypeInfo_H 8#ifndef HEADER_LambdaCube.TypeInfo_H
5#define HEADER_LambdaCube.TypeInfo_H 9#define HEADER_LambdaCube.TypeInfo_H
diff --git a/ddl/out/TestData.cpp b/ddl/out/TestData.cpp
index 8b2cdf5..b7d4d31 100644
--- a/ddl/out/TestData.cpp
+++ b/ddl/out/TestData.cpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.829757000000Z 3// 2016-03-01T13:00:40.829757000000Z
4=======
5// 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4#include "TestData.hpp" 8#include "TestData.hpp"
5template<> json toJSON<std::shared_ptr<ClientInfo>>(std::shared_ptr<ClientInfo> &v) { 9template<> json toJSON<std::shared_ptr<ClientInfo>>(std::shared_ptr<ClientInfo> &v) {
diff --git a/ddl/out/TestData.cs b/ddl/out/TestData.cs
new file mode 100644
index 0000000..0ea14a3
--- /dev/null
+++ b/ddl/out/TestData.cs
@@ -0,0 +1,499 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4using System;
5using System.Linq;
6using System.Collections.Generic;
7using Newtonsoft.Json.Linq;
8
9using LambdaCube.IR;
10using LambdaCube.Mesh;
11using LambdaCube.PipelineSchema;
12
13namespace TestData {
14 class ClientInfo {
15 public enum Tag {
16 ClientInfo
17 };
18 public Tag tag;
19 };
20
21 namespace data {
22 class ClientInfo : TestData.ClientInfo {
23 public string clientName;
24 public global::TestData.Backend clientBackend;
25 public ClientInfo() { tag = TestData.ClientInfo.Tag.ClientInfo; }
26 };
27 }
28 class Frame {
29 public enum Tag {
30 Frame
31 };
32 public Tag tag;
33 };
34
35 namespace data {
36 class Frame : TestData.Frame {
37 public int renderCount;
38 public Dictionary<string, global::TestData.Value> frameUniforms;
39 public Dictionary<string, int> frameTextures;
40 public Frame() { tag = TestData.Frame.Tag.Frame; }
41 };
42 }
43 class Scene {
44 public enum Tag {
45 Scene
46 };
47 public Tag tag;
48 };
49
50 namespace data {
51 class Scene : TestData.Scene {
52 public Dictionary<string, List<int>> objectArrays;
53 public int renderTargetWidth;
54 public int renderTargetHeight;
55 public List<global::TestData.Frame> frames;
56 public Scene() { tag = TestData.Scene.Tag.Scene; }
57 };
58 }
59 class PipelineInfo {
60 public enum Tag {
61 PipelineInfo
62 };
63 public Tag tag;
64 };
65
66 namespace data {
67 class PipelineInfo : TestData.PipelineInfo {
68 public string pipelineName;
69 public global::TestData.Pipeline pipeline;
70 public PipelineInfo() { tag = TestData.PipelineInfo.Tag.PipelineInfo; }
71 };
72 }
73 class RenderJob {
74 public enum Tag {
75 RenderJob
76 };
77 public Tag tag;
78 };
79
80 namespace data {
81 class RenderJob : TestData.RenderJob {
82 public List<global::TestData.Mesh> meshes;
83 public List<string> textures;
84 public global::TestData.PipelineSchema schema;
85 public List<global::TestData.Scene> scenes;
86 public List<global::TestData.PipelineInfo> pipelines;
87 public RenderJob() { tag = TestData.RenderJob.Tag.RenderJob; }
88 };
89 }
90 class FrameResult {
91 public enum Tag {
92 FrameResult
93 };
94 public Tag tag;
95 };
96
97 namespace data {
98 class FrameResult : TestData.FrameResult {
99 public List<float> frRenderTimes;
100 public int frImageWidth;
101 public int frImageHeight;
102 public FrameResult() { tag = TestData.FrameResult.Tag.FrameResult; }
103 };
104 }
105 class RenderJobResult {
106 public enum Tag {
107 RenderJobResult,
108 RenderJobError
109 };
110 public Tag tag;
111 };
112
113 namespace data {
114 class RenderJobResult : TestData.RenderJobResult {
115 public global::TestData.FrameResult _0;
116 public RenderJobResult() { tag = TestData.RenderJobResult.Tag.RenderJobResult; }
117 };
118 class RenderJobError : TestData.RenderJobResult {
119 public string _0;
120 public RenderJobError() { tag = TestData.RenderJobResult.Tag.RenderJobError; }
121 };
122 }
123
124 // JSON deserializer
125 enum Type {
126 Int,
127 Float,
128 String,
129 Array_Int,
130 Array_Float,
131 Array_String,
132 Array_Frame,
133 Array_Mesh,
134 Array_PipelineInfo,
135 Array_Scene,
136 Map_String_Int,
137 Map_String_Array_Int,
138 Map_String_Value,
139 Backend,
140 ClientInfo,
141 Frame,
142 FrameResult,
143 Mesh,
144 Pipeline,
145 PipelineInfo,
146 PipelineSchema,
147 RenderJob,
148 RenderJobResult,
149 Scene,
150 Value
151 }
152
153 class Loader {
154 public static object fromJSON(Type type, JToken obj) {
155 switch (type) {
156 case Type.Int: return (int)obj;
157 case Type.Float: return (float)obj;
158 case Type.String: return (string)obj;
159 case Type.Array_Int: return ((JArray)obj).Select(x => fromJSON (Type.Int, x)).ToList();
160 case Type.Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
161 case Type.Array_String: return ((JArray)obj).Select(x => fromJSON (Type.String, x)).ToList();
162 case Type.Array_Frame: return ((JArray)obj).Select(x => fromJSON (Type.Frame, x)).ToList();
163 case Type.Array_Mesh: return ((JArray)obj).Select(x => fromJSON (Type.Mesh, x)).ToList();
164 case Type.Array_PipelineInfo: return ((JArray)obj).Select(x => fromJSON (Type.PipelineInfo, x)).ToList();
165 case Type.Array_Scene: return ((JArray)obj).Select(x => fromJSON (Type.Scene, x)).ToList();
166 case Type.Map_String_Int: {
167 var map = new Dictionary<string, int> ();
168 foreach(var i in (JObject)obj) {
169 map.Add( (string)fromJSON(Type.String,i.Key)
170 , (int)fromJSON(Type.Int,i.Value));
171 }
172 return map;
173 }
174 case Type.Map_String_Array_Int: {
175 var map = new Dictionary<string, List<int>> ();
176 foreach(var i in (JObject)obj) {
177 map.Add( (string)fromJSON(Type.String,i.Key)
178 , (List<int>)fromJSON(Type.Array_Int,i.Value));
179 }
180 return map;
181 }
182 case Type.Map_String_Value: {
183 var map = new Dictionary<string, global::TestData.Value> ();
184 foreach(var i in (JObject)obj) {
185 map.Add( (string)fromJSON(Type.String,i.Key)
186 , (global::TestData.Value)fromJSON(Type.Value,i.Value));
187 }
188 return map;
189 }
190
191 case Type.ClientInfo: {
192 string tag = (string)obj["tag"];
193 ClientInfo.Tag tagType;
194 if (tag == "ClientInfo") {
195 tagType = ClientInfo.Tag.ClientInfo;
196 data.ClientInfo tv = new data.ClientInfo();
197 tv.clientName = (string)fromJSON(Type.String,obj["clientName"]);
198 tv.clientBackend = (global::TestData.Backend)fromJSON(Type.Backend,obj["clientBackend"]);
199 return tv;
200 }
201 else throw new Exception("unknown constructor: " + tag);
202 ClientInfo o = new ClientInfo();
203 o.tag = tagType;
204 return o;
205 }
206 case Type.Frame: {
207 string tag = (string)obj["tag"];
208 Frame.Tag tagType;
209 if (tag == "Frame") {
210 tagType = Frame.Tag.Frame;
211 data.Frame tv = new data.Frame();
212 tv.renderCount = (int)fromJSON(Type.Int,obj["renderCount"]);
213 tv.frameUniforms = (Dictionary<string, global::TestData.Value>)fromJSON(Type.Map_String_Value,obj["frameUniforms"]);
214 tv.frameTextures = (Dictionary<string, int>)fromJSON(Type.Map_String_Int,obj["frameTextures"]);
215 return tv;
216 }
217 else throw new Exception("unknown constructor: " + tag);
218 Frame o = new Frame();
219 o.tag = tagType;
220 return o;
221 }
222 case Type.Scene: {
223 string tag = (string)obj["tag"];
224 Scene.Tag tagType;
225 if (tag == "Scene") {
226 tagType = Scene.Tag.Scene;
227 data.Scene tv = new data.Scene();
228 tv.objectArrays = (Dictionary<string, List<int>>)fromJSON(Type.Map_String_Array_Int,obj["objectArrays"]);
229 tv.renderTargetWidth = (int)fromJSON(Type.Int,obj["renderTargetWidth"]);
230 tv.renderTargetHeight = (int)fromJSON(Type.Int,obj["renderTargetHeight"]);
231 tv.frames = (List<global::TestData.Frame>)fromJSON(Type.Array_Frame,obj["frames"]);
232 return tv;
233 }
234 else throw new Exception("unknown constructor: " + tag);
235 Scene o = new Scene();
236 o.tag = tagType;
237 return o;
238 }
239 case Type.PipelineInfo: {
240 string tag = (string)obj["tag"];
241 PipelineInfo.Tag tagType;
242 if (tag == "PipelineInfo") {
243 tagType = PipelineInfo.Tag.PipelineInfo;
244 data.PipelineInfo tv = new data.PipelineInfo();
245 tv.pipelineName = (string)fromJSON(Type.String,obj["pipelineName"]);
246 tv.pipeline = (global::TestData.Pipeline)fromJSON(Type.Pipeline,obj["pipeline"]);
247 return tv;
248 }
249 else throw new Exception("unknown constructor: " + tag);
250 PipelineInfo o = new PipelineInfo();
251 o.tag = tagType;
252 return o;
253 }
254 case Type.RenderJob: {
255 string tag = (string)obj["tag"];
256 RenderJob.Tag tagType;
257 if (tag == "RenderJob") {
258 tagType = RenderJob.Tag.RenderJob;
259 data.RenderJob tv = new data.RenderJob();
260 tv.meshes = (List<global::TestData.Mesh>)fromJSON(Type.Array_Mesh,obj["meshes"]);
261 tv.textures = (List<string>)fromJSON(Type.Array_String,obj["textures"]);
262 tv.schema = (global::TestData.PipelineSchema)fromJSON(Type.PipelineSchema,obj["schema"]);
263 tv.scenes = (List<global::TestData.Scene>)fromJSON(Type.Array_Scene,obj["scenes"]);
264 tv.pipelines = (List<global::TestData.PipelineInfo>)fromJSON(Type.Array_PipelineInfo,obj["pipelines"]);
265 return tv;
266 }
267 else throw new Exception("unknown constructor: " + tag);
268 RenderJob o = new RenderJob();
269 o.tag = tagType;
270 return o;
271 }
272 case Type.FrameResult: {
273 string tag = (string)obj["tag"];
274 FrameResult.Tag tagType;
275 if (tag == "FrameResult") {
276 tagType = FrameResult.Tag.FrameResult;
277 data.FrameResult tv = new data.FrameResult();
278 tv.frRenderTimes = (List<float>)fromJSON(Type.Array_Float,obj["frRenderTimes"]);
279 tv.frImageWidth = (int)fromJSON(Type.Int,obj["frImageWidth"]);
280 tv.frImageHeight = (int)fromJSON(Type.Int,obj["frImageHeight"]);
281 return tv;
282 }
283 else throw new Exception("unknown constructor: " + tag);
284 FrameResult o = new FrameResult();
285 o.tag = tagType;
286 return o;
287 }
288 case Type.RenderJobResult: {
289 string tag = (string)obj["tag"];
290 RenderJobResult.Tag tagType;
291 if (tag == "RenderJobResult") {
292 tagType = RenderJobResult.Tag.RenderJobResult;
293 data.RenderJobResult tv = new data.RenderJobResult();
294 tv._0 = (global::TestData.FrameResult)fromJSON(Type.FrameResult,obj["arg0"]);
295 return tv;
296 }
297 else if (tag == "RenderJobError") {
298 tagType = RenderJobResult.Tag.RenderJobError;
299 data.RenderJobError tv = new data.RenderJobError();
300 tv._0 = (string)fromJSON(Type.String,obj["arg0"]);
301 return tv;
302 }
303 else throw new Exception("unknown constructor: " + tag);
304 RenderJobResult o = new RenderJobResult();
305 o.tag = tagType;
306 return o;
307 }
308 }
309 throw new Exception("unknown type");
310 return null;
311 }
312
313 JToken toJSON(ClientInfo v) {
314 var obj = new JObject();
315 switch (v.tag) {
316 case ClientInfo.Tag.ClientInfo:
317 obj["tag"] = "ClientInfo";
318 {
319 var tv = (data.ClientInfo)v;
320 obj["clientName"] = toJSON(tv.clientName);
321 obj["clientBackend"] = toJSON(tv.clientBackend);
322 }
323 break;
324 }
325 return obj;
326 }
327 JToken toJSON(Frame v) {
328 var obj = new JObject();
329 switch (v.tag) {
330 case Frame.Tag.Frame:
331 obj["tag"] = "Frame";
332 {
333 var tv = (data.Frame)v;
334 obj["renderCount"] = toJSON(tv.renderCount);
335 obj["frameUniforms"] = toJSON(tv.frameUniforms);
336 obj["frameTextures"] = toJSON(tv.frameTextures);
337 }
338 break;
339 }
340 return obj;
341 }
342 JToken toJSON(Scene v) {
343 var obj = new JObject();
344 switch (v.tag) {
345 case Scene.Tag.Scene:
346 obj["tag"] = "Scene";
347 {
348 var tv = (data.Scene)v;
349 obj["objectArrays"] = toJSON(tv.objectArrays);
350 obj["renderTargetWidth"] = toJSON(tv.renderTargetWidth);
351 obj["renderTargetHeight"] = toJSON(tv.renderTargetHeight);
352 obj["frames"] = toJSON(tv.frames);
353 }
354 break;
355 }
356 return obj;
357 }
358 JToken toJSON(PipelineInfo v) {
359 var obj = new JObject();
360 switch (v.tag) {
361 case PipelineInfo.Tag.PipelineInfo:
362 obj["tag"] = "PipelineInfo";
363 {
364 var tv = (data.PipelineInfo)v;
365 obj["pipelineName"] = toJSON(tv.pipelineName);
366 obj["pipeline"] = toJSON(tv.pipeline);
367 }
368 break;
369 }
370 return obj;
371 }
372 JToken toJSON(RenderJob v) {
373 var obj = new JObject();
374 switch (v.tag) {
375 case RenderJob.Tag.RenderJob:
376 obj["tag"] = "RenderJob";
377 {
378 var tv = (data.RenderJob)v;
379 obj["meshes"] = toJSON(tv.meshes);
380 obj["textures"] = toJSON(tv.textures);
381 obj["schema"] = toJSON(tv.schema);
382 obj["scenes"] = toJSON(tv.scenes);
383 obj["pipelines"] = toJSON(tv.pipelines);
384 }
385 break;
386 }
387 return obj;
388 }
389 JToken toJSON(FrameResult v) {
390 var obj = new JObject();
391 switch (v.tag) {
392 case FrameResult.Tag.FrameResult:
393 obj["tag"] = "FrameResult";
394 {
395 var tv = (data.FrameResult)v;
396 obj["frRenderTimes"] = toJSON(tv.frRenderTimes);
397 obj["frImageWidth"] = toJSON(tv.frImageWidth);
398 obj["frImageHeight"] = toJSON(tv.frImageHeight);
399 }
400 break;
401 }
402 return obj;
403 }
404 JToken toJSON(RenderJobResult v) {
405 var obj = new JObject();
406 switch (v.tag) {
407 case RenderJobResult.Tag.RenderJobResult:
408 obj["tag"] = "RenderJobResult";
409 {
410 var tv = (data.RenderJobResult)v;
411 obj["arg0"] = toJSON(tv._0);
412 }
413 break;
414 case RenderJobResult.Tag.RenderJobError:
415 obj["tag"] = "RenderJobError";
416 {
417 var tv = (data.RenderJobError)v;
418 obj["arg0"] = toJSON(tv._0);
419 }
420 break;
421 }
422 return obj;
423 }
424
425 JToken toJSON(int v) { return new JValue(v); }
426 JToken toJSON(float v) { return new JValue(v); }
427 JToken toJSON(string v) { return new JValue(v); }
428 JToken toJSON(List<int> v) {
429 var obj = new JArray();
430 foreach (var i in v) {
431 obj.Add(toJSON(i));
432 }
433 return obj;
434 }
435 JToken toJSON(List<float> v) {
436 var obj = new JArray();
437 foreach (var i in v) {
438 obj.Add(toJSON(i));
439 }
440 return obj;
441 }
442 JToken toJSON(List<string> v) {
443 var obj = new JArray();
444 foreach (var i in v) {
445 obj.Add(toJSON(i));
446 }
447 return obj;
448 }
449 JToken toJSON(List<global::TestData.Frame> v) {
450 var obj = new JArray();
451 foreach (var i in v) {
452 obj.Add(toJSON(i));
453 }
454 return obj;
455 }
456 JToken toJSON(List<global::TestData.Mesh> v) {
457 var obj = new JArray();
458 foreach (var i in v) {
459 obj.Add(toJSON(i));
460 }
461 return obj;
462 }
463 JToken toJSON(List<global::TestData.PipelineInfo> v) {
464 var obj = new JArray();
465 foreach (var i in v) {
466 obj.Add(toJSON(i));
467 }
468 return obj;
469 }
470 JToken toJSON(List<global::TestData.Scene> v) {
471 var obj = new JArray();
472 foreach (var i in v) {
473 obj.Add(toJSON(i));
474 }
475 return obj;
476 }
477 JToken toJSON(Dictionary<string, int> v) {
478 var obj = new JObject();
479 foreach (var i in v) {
480 obj[i.Key] = toJSON(i.Value);
481 }
482 return obj;
483 }
484 JToken toJSON(Dictionary<string, List<int>> v) {
485 var obj = new JObject();
486 foreach (var i in v) {
487 obj[i.Key] = toJSON(i.Value);
488 }
489 return obj;
490 }
491 JToken toJSON(Dictionary<string, global::TestData.Value> v) {
492 var obj = new JObject();
493 foreach (var i in v) {
494 obj[i.Key] = toJSON(i.Value);
495 }
496 return obj;
497 }
498 }
499}
diff --git a/ddl/out/TestData.hpp b/ddl/out/TestData.hpp
index bf90d88..00cdfda 100644
--- a/ddl/out/TestData.hpp
+++ b/ddl/out/TestData.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.829757000000Z 3// 2016-03-01T13:00:40.829757000000Z
4=======
5// 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_TestData_H 8#ifndef HEADER_TestData_H
5#define HEADER_TestData_H 9#define HEADER_TestData_H
diff --git a/ddl/out/TestData.hs b/ddl/out/TestData.hs
index 489e3c3..60f8ff9 100644
--- a/ddl/out/TestData.hs
+++ b/ddl/out/TestData.hs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.829757000000Z 3-- 2016-03-01T13:00:40.829757000000Z
4=======
5-- 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4{-# LANGUAGE OverloadedStrings, RecordWildCards #-} 8{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
5module TestData where 9module TestData where
diff --git a/ddl/out/TestData.java b/ddl/out/TestData.java
new file mode 100644
index 0000000..aa6b656
--- /dev/null
+++ b/ddl/out/TestData.java
@@ -0,0 +1,103 @@
1// generated file, do not modify!
2// 2016-03-14T10:58:30.042864000000Z
3
4import LambdaCube.IR;
5import LambdaCube.Mesh;
6import LambdaCube.PipelineSchema;
7
8public class TestData {
9 public class ClientInfo {
10 public enum Tag {
11 ClientInfo
12 }
13 public Tag tag;
14
15 public class ClientInfo extends ClientInfo {
16 public String clientName;
17 public Backend clientBackend;
18 }
19 }
20
21 public class Frame {
22 public enum Tag {
23 Frame
24 }
25 public Tag tag;
26
27 public class Frame extends Frame {
28 public Integer renderCount;
29 public HashMap<String, Value> frameUniforms;
30 public HashMap<String, Integer> frameTextures;
31 }
32 }
33
34 public class Scene {
35 public enum Tag {
36 Scene
37 }
38 public Tag tag;
39
40 public class Scene extends Scene {
41 public HashMap<String, ArrayList<Integer>> objectArrays;
42 public Integer renderTargetWidth;
43 public Integer renderTargetHeight;
44 public ArrayList<Frame> frames;
45 }
46 }
47
48 public class PipelineInfo {
49 public enum Tag {
50 PipelineInfo
51 }
52 public Tag tag;
53
54 public class PipelineInfo extends PipelineInfo {
55 public String pipelineName;
56 public Pipeline pipeline;
57 }
58 }
59
60 public class RenderJob {
61 public enum Tag {
62 RenderJob
63 }
64 public Tag tag;
65
66 public class RenderJob extends RenderJob {
67 public ArrayList<Mesh> meshes;
68 public ArrayList<String> textures;
69 public PipelineSchema schema;
70 public ArrayList<Scene> scenes;
71 public ArrayList<PipelineInfo> pipelines;
72 }
73 }
74
75 public class FrameResult {
76 public enum Tag {
77 FrameResult
78 }
79 public Tag tag;
80
81 public class FrameResult extends FrameResult {
82 public ArrayList<Float> frRenderTimes;
83 public Integer frImageWidth;
84 public Integer frImageHeight;
85 }
86 }
87
88 public class RenderJobResult {
89 public enum Tag {
90 RenderJobResult,
91 RenderJobError
92 }
93 public Tag tag;
94
95 public class RenderJobResult extends RenderJobResult {
96 public FrameResult _0;
97 }
98 public class RenderJobError extends RenderJobResult {
99 public String _0;
100 }
101 }
102
103} \ No newline at end of file
diff --git a/ddl/out/TestData.purs b/ddl/out/TestData.purs
index e4da3b2..47f46ca 100644
--- a/ddl/out/TestData.purs
+++ b/ddl/out/TestData.purs
@@ -1,5 +1,9 @@
1-- generated file, do not modify! 1-- generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2-- 2016-03-01T13:00:40.829757000000Z 3-- 2016-03-01T13:00:40.829757000000Z
4=======
5-- 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4module TestData where 8module TestData where
5import Prelude 9import Prelude
diff --git a/ddl/out/TestData.swift b/ddl/out/TestData.swift
index adb9e25..6e31913 100644
--- a/ddl/out/TestData.swift
+++ b/ddl/out/TestData.swift
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.829757000000Z 3// 2016-03-01T13:00:40.829757000000Z
4=======
5// 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4enum ClientInfo { 8enum ClientInfo {
5 case ClientInfo(ClientInfo_Data) 9 case ClientInfo(ClientInfo_Data)
diff --git a/ddl/out/TestData2.hpp b/ddl/out/TestData2.hpp
index 49ac46e..a88050a 100644
--- a/ddl/out/TestData2.hpp
+++ b/ddl/out/TestData2.hpp
@@ -1,5 +1,9 @@
1// generated file, do not modify! 1// generated file, do not modify!
2<<<<<<< 3b50722f433ec5ecc515ea1441fd633d85118cb9
2// 2016-03-01T13:00:40.829757000000Z 3// 2016-03-01T13:00:40.829757000000Z
4=======
5// 2016-03-20T21:42:13.043021000000Z
6>>>>>>> working c# backend
3 7
4#ifndef HEADER_TestData_H 8#ifndef HEADER_TestData_H
5#define HEADER_TestData_H 9#define HEADER_TestData_H
diff --git a/ddl/out/java/LambdaCube/IR/AccumulationContext.java b/ddl/out/java/LambdaCube/IR/AccumulationContext.java
new file mode 100644
index 0000000..a190597
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/AccumulationContext.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class AccumulationContext {
12 public enum Tag {
13 AccumulationContext
14 }
15 public Tag tag;
16
17 public class AccumulationContext_ extends AccumulationContext {
18 public Maybe<String> accViewportName;
19 public ArrayList<FragmentOperation> accOperations;
20 public AccumulationContext_() { tag = AccumulationContext.Tag.AccumulationContext; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/ArrayValue.java b/ddl/out/java/LambdaCube/IR/ArrayValue.java
new file mode 100644
index 0000000..b176300
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ArrayValue.java
@@ -0,0 +1,37 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ArrayValue {
12 public enum Tag {
13 VBoolArray,
14 VIntArray,
15 VWordArray,
16 VFloatArray
17 }
18 public Tag tag;
19
20 public class VBoolArray_ extends ArrayValue {
21 public ArrayList<Boolean> _0;
22 public VBoolArray_() { tag = ArrayValue.Tag.VBoolArray; }
23 }
24 public class VIntArray_ extends ArrayValue {
25 public ArrayList<Integer> _0;
26 public VIntArray_() { tag = ArrayValue.Tag.VIntArray; }
27 }
28 public class VWordArray_ extends ArrayValue {
29 public ArrayList<Integer> _0;
30 public VWordArray_() { tag = ArrayValue.Tag.VWordArray; }
31 }
32 public class VFloatArray_ extends ArrayValue {
33 public ArrayList<Float> _0;
34 public VFloatArray_() { tag = ArrayValue.Tag.VFloatArray; }
35 }
36}
37
diff --git a/ddl/out/java/LambdaCube/IR/Backend.java b/ddl/out/java/LambdaCube/IR/Backend.java
new file mode 100644
index 0000000..bbe74b8
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Backend.java
@@ -0,0 +1,19 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Backend {
12 public enum Tag {
13 WebGL1,
14 OpenGL33
15 }
16 public Tag tag;
17
18}
19
diff --git a/ddl/out/java/LambdaCube/IR/BlendEquation.java b/ddl/out/java/LambdaCube/IR/BlendEquation.java
new file mode 100644
index 0000000..6dd1523
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/BlendEquation.java
@@ -0,0 +1,22 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class BlendEquation {
12 public enum Tag {
13 FuncAdd,
14 FuncSubtract,
15 FuncReverseSubtract,
16 Min,
17 Max
18 }
19 public Tag tag;
20
21}
22
diff --git a/ddl/out/java/LambdaCube/IR/Blending.java b/ddl/out/java/LambdaCube/IR/Blending.java
new file mode 100644
index 0000000..331ae4e
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Blending.java
@@ -0,0 +1,34 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Blending {
12 public enum Tag {
13 NoBlending,
14 BlendLogicOp,
15 Blend
16 }
17 public Tag tag;
18
19 public class BlendLogicOp_ extends Blending {
20 public LogicOperation _0;
21 public BlendLogicOp_() { tag = Blending.Tag.BlendLogicOp; }
22 }
23 public class Blend_ extends Blending {
24 public BlendEquation colorEqSrc;
25 public BlendEquation alphaEqSrc;
26 public BlendingFactor colorFSrc;
27 public BlendingFactor colorFDst;
28 public BlendingFactor alphaFSrc;
29 public BlendingFactor alphaFDst;
30 public V4<Float> color;
31 public Blend_() { tag = Blending.Tag.Blend; }
32 }
33}
34
diff --git a/ddl/out/java/LambdaCube/IR/BlendingFactor.java b/ddl/out/java/LambdaCube/IR/BlendingFactor.java
new file mode 100644
index 0000000..fe73075
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/BlendingFactor.java
@@ -0,0 +1,32 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class BlendingFactor {
12 public enum Tag {
13 Zero,
14 One,
15 SrcColor,
16 OneMinusSrcColor,
17 DstColor,
18 OneMinusDstColor,
19 SrcAlpha,
20 OneMinusSrcAlpha,
21 DstAlpha,
22 OneMinusDstAlpha,
23 ConstantColor,
24 OneMinusConstantColor,
25 ConstantAlpha,
26 OneMinusConstantAlpha,
27 SrcAlphaSaturate
28 }
29 public Tag tag;
30
31}
32
diff --git a/ddl/out/java/LambdaCube/IR/ClearImage.java b/ddl/out/java/LambdaCube/IR/ClearImage.java
new file mode 100644
index 0000000..64491e9
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ClearImage.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ClearImage {
12 public enum Tag {
13 ClearImage
14 }
15 public Tag tag;
16
17 public class ClearImage_ extends ClearImage {
18 public ImageSemantic imageSemantic;
19 public Value clearValue;
20 public ClearImage_() { tag = ClearImage.Tag.ClearImage; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/ColorArity.java b/ddl/out/java/LambdaCube/IR/ColorArity.java
new file mode 100644
index 0000000..77ba1a0
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ColorArity.java
@@ -0,0 +1,21 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ColorArity {
12 public enum Tag {
13 Red,
14 RG,
15 RGB,
16 RGBA
17 }
18 public Tag tag;
19
20}
21
diff --git a/ddl/out/java/LambdaCube/IR/Command.java b/ddl/out/java/LambdaCube/IR/Command.java
new file mode 100644
index 0000000..90ec2c5
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Command.java
@@ -0,0 +1,87 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Command {
12 public enum Tag {
13 SetRasterContext,
14 SetAccumulationContext,
15 SetRenderTarget,
16 SetProgram,
17 SetSamplerUniform,
18 SetTexture,
19 SetSampler,
20 RenderSlot,
21 RenderStream,
22 ClearRenderTarget,
23 GenerateMipMap,
24 SaveImage,
25 LoadImage
26 }
27 public Tag tag;
28
29 public class SetRasterContext_ extends Command {
30 public RasterContext _0;
31 public SetRasterContext_() { tag = Command.Tag.SetRasterContext; }
32 }
33 public class SetAccumulationContext_ extends Command {
34 public AccumulationContext _0;
35 public SetAccumulationContext_() { tag = Command.Tag.SetAccumulationContext; }
36 }
37 public class SetRenderTarget_ extends Command {
38 public Integer _0;
39 public SetRenderTarget_() { tag = Command.Tag.SetRenderTarget; }
40 }
41 public class SetProgram_ extends Command {
42 public Integer _0;
43 public SetProgram_() { tag = Command.Tag.SetProgram; }
44 }
45 public class SetSamplerUniform_ extends Command {
46 public String _0;
47 public Integer _1;
48 public SetSamplerUniform_() { tag = Command.Tag.SetSamplerUniform; }
49 }
50 public class SetTexture_ extends Command {
51 public Integer _0;
52 public Integer _1;
53 public SetTexture_() { tag = Command.Tag.SetTexture; }
54 }
55 public class SetSampler_ extends Command {
56 public Integer _0;
57 public Maybe<Integer> _1;
58 public SetSampler_() { tag = Command.Tag.SetSampler; }
59 }
60 public class RenderSlot_ extends Command {
61 public Integer _0;
62 public RenderSlot_() { tag = Command.Tag.RenderSlot; }
63 }
64 public class RenderStream_ extends Command {
65 public Integer _0;
66 public RenderStream_() { tag = Command.Tag.RenderStream; }
67 }
68 public class ClearRenderTarget_ extends Command {
69 public ArrayList<ClearImage> _0;
70 public ClearRenderTarget_() { tag = Command.Tag.ClearRenderTarget; }
71 }
72 public class GenerateMipMap_ extends Command {
73 public Integer _0;
74 public GenerateMipMap_() { tag = Command.Tag.GenerateMipMap; }
75 }
76 public class SaveImage_ extends Command {
77 public Integer _0;
78 public ImageRef _1;
79 public SaveImage_() { tag = Command.Tag.SaveImage; }
80 }
81 public class LoadImage_ extends Command {
82 public ImageRef _0;
83 public Integer _1;
84 public LoadImage_() { tag = Command.Tag.LoadImage; }
85 }
86}
87
diff --git a/ddl/out/java/LambdaCube/IR/ComparisonFunction.java b/ddl/out/java/LambdaCube/IR/ComparisonFunction.java
new file mode 100644
index 0000000..d3c5112
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ComparisonFunction.java
@@ -0,0 +1,25 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ComparisonFunction {
12 public enum Tag {
13 Never,
14 Less,
15 Equal,
16 Lequal,
17 Greater,
18 Notequal,
19 Gequal,
20 Always
21 }
22 public Tag tag;
23
24}
25
diff --git a/ddl/out/java/LambdaCube/IR/CullMode.java b/ddl/out/java/LambdaCube/IR/CullMode.java
new file mode 100644
index 0000000..f2ce3a8
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/CullMode.java
@@ -0,0 +1,28 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class CullMode {
12 public enum Tag {
13 CullNone,
14 CullFront,
15 CullBack
16 }
17 public Tag tag;
18
19 public class CullFront_ extends CullMode {
20 public FrontFace _0;
21 public CullFront_() { tag = CullMode.Tag.CullFront; }
22 }
23 public class CullBack_ extends CullMode {
24 public FrontFace _0;
25 public CullBack_() { tag = CullMode.Tag.CullBack; }
26 }
27}
28
diff --git a/ddl/out/java/LambdaCube/IR/EdgeMode.java b/ddl/out/java/LambdaCube/IR/EdgeMode.java
new file mode 100644
index 0000000..19a8eba
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/EdgeMode.java
@@ -0,0 +1,21 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class EdgeMode {
12 public enum Tag {
13 Repeat,
14 MirroredRepeat,
15 ClampToEdge,
16 ClampToBorder
17 }
18 public Tag tag;
19
20}
21
diff --git a/ddl/out/java/LambdaCube/IR/FetchPrimitive.java b/ddl/out/java/LambdaCube/IR/FetchPrimitive.java
new file mode 100644
index 0000000..16453bc
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/FetchPrimitive.java
@@ -0,0 +1,22 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class FetchPrimitive {
12 public enum Tag {
13 Points,
14 Lines,
15 Triangles,
16 LinesAdjacency,
17 TrianglesAdjacency
18 }
19 public Tag tag;
20
21}
22
diff --git a/ddl/out/java/LambdaCube/IR/Filter.java b/ddl/out/java/LambdaCube/IR/Filter.java
new file mode 100644
index 0000000..4bd3b7c
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Filter.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Filter {
12 public enum Tag {
13 Nearest,
14 Linear,
15 NearestMipmapNearest,
16 NearestMipmapLinear,
17 LinearMipmapNearest,
18 LinearMipmapLinear
19 }
20 public Tag tag;
21
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/FragmentOperation.java b/ddl/out/java/LambdaCube/IR/FragmentOperation.java
new file mode 100644
index 0000000..35aa5a9
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/FragmentOperation.java
@@ -0,0 +1,36 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class FragmentOperation {
12 public enum Tag {
13 DepthOp,
14 StencilOp,
15 ColorOp
16 }
17 public Tag tag;
18
19 public class DepthOp_ extends FragmentOperation {
20 public ComparisonFunction _0;
21 public Boolean _1;
22 public DepthOp_() { tag = FragmentOperation.Tag.DepthOp; }
23 }
24 public class StencilOp_ extends FragmentOperation {
25 public StencilTests _0;
26 public StencilOps _1;
27 public StencilOps _2;
28 public StencilOp_() { tag = FragmentOperation.Tag.StencilOp; }
29 }
30 public class ColorOp_ extends FragmentOperation {
31 public Blending _0;
32 public Value _1;
33 public ColorOp_() { tag = FragmentOperation.Tag.ColorOp; }
34 }
35}
36
diff --git a/ddl/out/java/LambdaCube/IR/FrontFace.java b/ddl/out/java/LambdaCube/IR/FrontFace.java
new file mode 100644
index 0000000..dff345f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/FrontFace.java
@@ -0,0 +1,19 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class FrontFace {
12 public enum Tag {
13 CCW,
14 CW
15 }
16 public Tag tag;
17
18}
19
diff --git a/ddl/out/java/LambdaCube/IR/ImageRef.java b/ddl/out/java/LambdaCube/IR/ImageRef.java
new file mode 100644
index 0000000..51385dc
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ImageRef.java
@@ -0,0 +1,29 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ImageRef {
12 public enum Tag {
13 TextureImage,
14 Framebuffer
15 }
16 public Tag tag;
17
18 public class TextureImage_ extends ImageRef {
19 public Integer _0;
20 public Integer _1;
21 public Maybe<Integer> _2;
22 public TextureImage_() { tag = ImageRef.Tag.TextureImage; }
23 }
24 public class Framebuffer_ extends ImageRef {
25 public ImageSemantic _0;
26 public Framebuffer_() { tag = ImageRef.Tag.Framebuffer; }
27 }
28}
29
diff --git a/ddl/out/java/LambdaCube/IR/ImageSemantic.java b/ddl/out/java/LambdaCube/IR/ImageSemantic.java
new file mode 100644
index 0000000..22aea08
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ImageSemantic.java
@@ -0,0 +1,20 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ImageSemantic {
12 public enum Tag {
13 Depth,
14 Stencil,
15 Color
16 }
17 public Tag tag;
18
19}
20
diff --git a/ddl/out/java/LambdaCube/IR/InputType.java b/ddl/out/java/LambdaCube/IR/InputType.java
new file mode 100644
index 0000000..f8764d1
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/InputType.java
@@ -0,0 +1,78 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class InputType {
12 public enum Tag {
13 Bool,
14 V2B,
15 V3B,
16 V4B,
17 Word,
18 V2U,
19 V3U,
20 V4U,
21 Int,
22 V2I,
23 V3I,
24 V4I,
25 Float,
26 V2F,
27 V3F,
28 V4F,
29 M22F,
30 M23F,
31 M24F,
32 M32F,
33 M33F,
34 M34F,
35 M42F,
36 M43F,
37 M44F,
38 STexture1D,
39 STexture2D,
40 STextureCube,
41 STexture1DArray,
42 STexture2DArray,
43 STexture2DRect,
44 FTexture1D,
45 FTexture2D,
46 FTexture3D,
47 FTextureCube,
48 FTexture1DArray,
49 FTexture2DArray,
50 FTexture2DMS,
51 FTexture2DMSArray,
52 FTextureBuffer,
53 FTexture2DRect,
54 ITexture1D,
55 ITexture2D,
56 ITexture3D,
57 ITextureCube,
58 ITexture1DArray,
59 ITexture2DArray,
60 ITexture2DMS,
61 ITexture2DMSArray,
62 ITextureBuffer,
63 ITexture2DRect,
64 UTexture1D,
65 UTexture2D,
66 UTexture3D,
67 UTextureCube,
68 UTexture1DArray,
69 UTexture2DArray,
70 UTexture2DMS,
71 UTexture2DMSArray,
72 UTextureBuffer,
73 UTexture2DRect
74 }
75 public Tag tag;
76
77}
78
diff --git a/ddl/out/java/LambdaCube/IR/JSON.java b/ddl/out/java/LambdaCube/IR/JSON.java
new file mode 100644
index 0000000..3515e25
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/JSON.java
@@ -0,0 +1,1460 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import org.json.*;
9import RT.*;
10
11
12public class JSON {
13 // JSON deserializer
14 public enum Type {
15 Int,
16 Int32,
17 Word,
18 Word32,
19 Float,
20 Bool,
21 String,
22 V2_Int,
23 V2_Word,
24 V2_Float,
25 V2_Bool,
26 V2_V2_Float,
27 V2_V3_Float,
28 V2_V4_Float,
29 V3_Int,
30 V3_Word,
31 V3_Float,
32 V3_Bool,
33 V3_V2_Float,
34 V3_V3_Float,
35 V3_V4_Float,
36 V4_Int,
37 V4_Word,
38 V4_Float,
39 V4_Bool,
40 V4_V2_Float,
41 V4_V3_Float,
42 V4_V4_Float,
43 Array_Int,
44 Array_Int32,
45 Array_Word32,
46 Array_Float,
47 Array_Bool,
48 Array_ClearImage,
49 Array_Command,
50 Array_Parameter,
51 Array_Program,
52 Array_RenderTarget,
53 Array_SamplerDescriptor,
54 Array_Slot,
55 Array_StreamData,
56 Array_TargetItem,
57 Array_TextureDescriptor,
58 List_FragmentOperation,
59 Maybe_Int,
60 Maybe_Float,
61 Maybe_String,
62 Maybe_ComparisonFunction,
63 Maybe_EdgeMode,
64 Maybe_ImageRef,
65 Map_String_ArrayValue,
66 Map_String_InputType,
67 Map_String_Parameter,
68 AccumulationContext,
69 ArrayValue,
70 Backend,
71 BlendEquation,
72 Blending,
73 BlendingFactor,
74 ClearImage,
75 ColorArity,
76 Command,
77 ComparisonFunction,
78 CullMode,
79 EdgeMode,
80 FetchPrimitive,
81 Filter,
82 FragmentOperation,
83 FrontFace,
84 ImageRef,
85 ImageSemantic,
86 InputType,
87 LogicOperation,
88 MipMap,
89 OutputPrimitive,
90 Parameter,
91 Pipeline,
92 PointSize,
93 PointSpriteCoordOrigin,
94 PolygonMode,
95 PolygonOffset,
96 Program,
97 ProvokingVertex,
98 RasterContext,
99 RenderTarget,
100 SamplerDescriptor,
101 Slot,
102 StencilOperation,
103 StencilOps,
104 StencilTest,
105 StencilTests,
106 StreamData,
107 TargetItem,
108 TextureDataType,
109 TextureDescriptor,
110 TextureType,
111 Value
112 }
113
114 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
115 switch (type) {
116 case Int: return (Integer)rawObj;
117 case Int32: return (Integer)rawObj;
118 case Word: return (Integer)rawObj;
119 case Word32: return (Integer)rawObj;
120 case Float: return (Float)rawObj;
121 case Bool: return (Boolean)rawObj;
122 case String: return (String)rawObj;
123 case V2_Int: {
124 JSONObject obj = (JSONObject)rawObj;
125 return new V2<Integer>
126 ( (Integer)fromJSON(Type.Int,obj.get("x"))
127 , (Integer)fromJSON(Type.Int,obj.get("y"))
128 );
129 }
130 case V2_Word: {
131 JSONObject obj = (JSONObject)rawObj;
132 return new V2<Integer>
133 ( (Integer)fromJSON(Type.Word,obj.get("x"))
134 , (Integer)fromJSON(Type.Word,obj.get("y"))
135 );
136 }
137 case V2_Float: {
138 JSONObject obj = (JSONObject)rawObj;
139 return new V2<Float>
140 ( (Float)fromJSON(Type.Float,obj.get("x"))
141 , (Float)fromJSON(Type.Float,obj.get("y"))
142 );
143 }
144 case V2_Bool: {
145 JSONObject obj = (JSONObject)rawObj;
146 return new V2<Boolean>
147 ( (Boolean)fromJSON(Type.Bool,obj.get("x"))
148 , (Boolean)fromJSON(Type.Bool,obj.get("y"))
149 );
150 }
151 case V2_V2_Float: {
152 JSONObject obj = (JSONObject)rawObj;
153 return new V2<V2<Float>>
154 ( (V2<Float>)fromJSON(Type.V2_Float,obj.get("x"))
155 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("y"))
156 );
157 }
158 case V2_V3_Float: {
159 JSONObject obj = (JSONObject)rawObj;
160 return new V2<V3<Float>>
161 ( (V3<Float>)fromJSON(Type.V3_Float,obj.get("x"))
162 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("y"))
163 );
164 }
165 case V2_V4_Float: {
166 JSONObject obj = (JSONObject)rawObj;
167 return new V2<V4<Float>>
168 ( (V4<Float>)fromJSON(Type.V4_Float,obj.get("x"))
169 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("y"))
170 );
171 }
172 case V3_Int: {
173 JSONObject obj = (JSONObject)rawObj;
174 return new V3<Integer>
175 ( (Integer)fromJSON(Type.Int,obj.get("x"))
176 , (Integer)fromJSON(Type.Int,obj.get("y"))
177 , (Integer)fromJSON(Type.Int,obj.get("z"))
178 );
179 }
180 case V3_Word: {
181 JSONObject obj = (JSONObject)rawObj;
182 return new V3<Integer>
183 ( (Integer)fromJSON(Type.Word,obj.get("x"))
184 , (Integer)fromJSON(Type.Word,obj.get("y"))
185 , (Integer)fromJSON(Type.Word,obj.get("z"))
186 );
187 }
188 case V3_Float: {
189 JSONObject obj = (JSONObject)rawObj;
190 return new V3<Float>
191 ( (Float)fromJSON(Type.Float,obj.get("x"))
192 , (Float)fromJSON(Type.Float,obj.get("y"))
193 , (Float)fromJSON(Type.Float,obj.get("z"))
194 );
195 }
196 case V3_Bool: {
197 JSONObject obj = (JSONObject)rawObj;
198 return new V3<Boolean>
199 ( (Boolean)fromJSON(Type.Bool,obj.get("x"))
200 , (Boolean)fromJSON(Type.Bool,obj.get("y"))
201 , (Boolean)fromJSON(Type.Bool,obj.get("z"))
202 );
203 }
204 case V3_V2_Float: {
205 JSONObject obj = (JSONObject)rawObj;
206 return new V3<V2<Float>>
207 ( (V2<Float>)fromJSON(Type.V2_Float,obj.get("x"))
208 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("y"))
209 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("z"))
210 );
211 }
212 case V3_V3_Float: {
213 JSONObject obj = (JSONObject)rawObj;
214 return new V3<V3<Float>>
215 ( (V3<Float>)fromJSON(Type.V3_Float,obj.get("x"))
216 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("y"))
217 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("z"))
218 );
219 }
220 case V3_V4_Float: {
221 JSONObject obj = (JSONObject)rawObj;
222 return new V3<V4<Float>>
223 ( (V4<Float>)fromJSON(Type.V4_Float,obj.get("x"))
224 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("y"))
225 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("z"))
226 );
227 }
228 case V4_Int: {
229 JSONObject obj = (JSONObject)rawObj;
230 return new V4<Integer>
231 ( (Integer)fromJSON(Type.Int,obj.get("x"))
232 , (Integer)fromJSON(Type.Int,obj.get("y"))
233 , (Integer)fromJSON(Type.Int,obj.get("z"))
234 , (Integer)fromJSON(Type.Int,obj.get("w"))
235 );
236 }
237 case V4_Word: {
238 JSONObject obj = (JSONObject)rawObj;
239 return new V4<Integer>
240 ( (Integer)fromJSON(Type.Word,obj.get("x"))
241 , (Integer)fromJSON(Type.Word,obj.get("y"))
242 , (Integer)fromJSON(Type.Word,obj.get("z"))
243 , (Integer)fromJSON(Type.Word,obj.get("w"))
244 );
245 }
246 case V4_Float: {
247 JSONObject obj = (JSONObject)rawObj;
248 return new V4<Float>
249 ( (Float)fromJSON(Type.Float,obj.get("x"))
250 , (Float)fromJSON(Type.Float,obj.get("y"))
251 , (Float)fromJSON(Type.Float,obj.get("z"))
252 , (Float)fromJSON(Type.Float,obj.get("w"))
253 );
254 }
255 case V4_Bool: {
256 JSONObject obj = (JSONObject)rawObj;
257 return new V4<Boolean>
258 ( (Boolean)fromJSON(Type.Bool,obj.get("x"))
259 , (Boolean)fromJSON(Type.Bool,obj.get("y"))
260 , (Boolean)fromJSON(Type.Bool,obj.get("z"))
261 , (Boolean)fromJSON(Type.Bool,obj.get("w"))
262 );
263 }
264 case V4_V2_Float: {
265 JSONObject obj = (JSONObject)rawObj;
266 return new V4<V2<Float>>
267 ( (V2<Float>)fromJSON(Type.V2_Float,obj.get("x"))
268 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("y"))
269 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("z"))
270 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("w"))
271 );
272 }
273 case V4_V3_Float: {
274 JSONObject obj = (JSONObject)rawObj;
275 return new V4<V3<Float>>
276 ( (V3<Float>)fromJSON(Type.V3_Float,obj.get("x"))
277 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("y"))
278 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("z"))
279 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("w"))
280 );
281 }
282 case V4_V4_Float: {
283 JSONObject obj = (JSONObject)rawObj;
284 return new V4<V4<Float>>
285 ( (V4<Float>)fromJSON(Type.V4_Float,obj.get("x"))
286 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("y"))
287 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("z"))
288 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("w"))
289 );
290 }
291// case Array_Int: return ((JArray)obj).Select(x => fromJSON (Type.Int, x)).ToList();
292// case Array_Int32: return ((JArray)obj).Select(x => fromJSON (Type.Int32, x)).ToList();
293// case Array_Word32: return ((JArray)obj).Select(x => fromJSON (Type.Word32, x)).ToList();
294// case Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
295// case Array_Bool: return ((JArray)obj).Select(x => fromJSON (Type.Bool, x)).ToList();
296// case Array_ClearImage: return ((JArray)obj).Select(x => fromJSON (Type.ClearImage, x)).ToList();
297// case Array_Command: return ((JArray)obj).Select(x => fromJSON (Type.Command, x)).ToList();
298// case Array_Parameter: return ((JArray)obj).Select(x => fromJSON (Type.Parameter, x)).ToList();
299// case Array_Program: return ((JArray)obj).Select(x => fromJSON (Type.Program, x)).ToList();
300// case Array_RenderTarget: return ((JArray)obj).Select(x => fromJSON (Type.RenderTarget, x)).ToList();
301// case Array_SamplerDescriptor: return ((JArray)obj).Select(x => fromJSON (Type.SamplerDescriptor, x)).ToList();
302// case Array_Slot: return ((JArray)obj).Select(x => fromJSON (Type.Slot, x)).ToList();
303// case Array_StreamData: return ((JArray)obj).Select(x => fromJSON (Type.StreamData, x)).ToList();
304// case Array_TargetItem: return ((JArray)obj).Select(x => fromJSON (Type.TargetItem, x)).ToList();
305// case Array_TextureDescriptor: return ((JArray)obj).Select(x => fromJSON (Type.TextureDescriptor, x)).ToList();
306// case List_FragmentOperation: return ((JArray)obj).Select(x => fromJSON (Type.FragmentOperation, x)).ToList();
307/*
308 case Maybe_Int: {
309 var m = new Maybe<Integer> ();
310 if (obj == null || obj.Type == JTokenType.Null) {
311 m.valid = false;
312 } else {
313 m.valid = true;
314 m.data = (Integer)fromJSON (Type.Int,obj);
315 }
316 return m;
317 }
318*/
319/*
320 case Maybe_Float: {
321 var m = new Maybe<Float> ();
322 if (obj == null || obj.Type == JTokenType.Null) {
323 m.valid = false;
324 } else {
325 m.valid = true;
326 m.data = (Float)fromJSON (Type.Float,obj);
327 }
328 return m;
329 }
330*/
331/*
332 case Maybe_String: {
333 var m = new Maybe<String> ();
334 if (obj == null || obj.Type == JTokenType.Null) {
335 m.valid = false;
336 } else {
337 m.valid = true;
338 m.data = (String)fromJSON (Type.String,obj);
339 }
340 return m;
341 }
342*/
343/*
344 case Maybe_ComparisonFunction: {
345 var m = new Maybe<ComparisonFunction> ();
346 if (obj == null || obj.Type == JTokenType.Null) {
347 m.valid = false;
348 } else {
349 m.valid = true;
350 m.data = (ComparisonFunction)fromJSON (Type.ComparisonFunction,obj);
351 }
352 return m;
353 }
354*/
355/*
356 case Maybe_EdgeMode: {
357 var m = new Maybe<EdgeMode> ();
358 if (obj == null || obj.Type == JTokenType.Null) {
359 m.valid = false;
360 } else {
361 m.valid = true;
362 m.data = (EdgeMode)fromJSON (Type.EdgeMode,obj);
363 }
364 return m;
365 }
366*/
367/*
368 case Maybe_ImageRef: {
369 var m = new Maybe<ImageRef> ();
370 if (obj == null || obj.Type == JTokenType.Null) {
371 m.valid = false;
372 } else {
373 m.valid = true;
374 m.data = (ImageRef)fromJSON (Type.ImageRef,obj);
375 }
376 return m;
377 }
378*/
379/*
380 case Map_String_ArrayValue: {
381 var map = new HashMap<String, ArrayValue> ();
382 foreach(var i in (JSONObject)rawObj) {
383 map.Add( (String)fromJSON(Type.String,i.Key)
384 , (ArrayValue)fromJSON(Type.ArrayValue,i.Value));
385 }
386 return map;
387 }
388*/
389/*
390 case Map_String_InputType: {
391 var map = new HashMap<String, InputType> ();
392 foreach(var i in (JSONObject)rawObj) {
393 map.Add( (String)fromJSON(Type.String,i.Key)
394 , (InputType)fromJSON(Type.InputType,i.Value));
395 }
396 return map;
397 }
398*/
399/*
400 case Map_String_Parameter: {
401 var map = new HashMap<String, Parameter> ();
402 foreach(var i in (JSONObject)rawObj) {
403 map.Add( (String)fromJSON(Type.String,i.Key)
404 , (Parameter)fromJSON(Type.Parameter,i.Value));
405 }
406 return map;
407 }
408*/
409
410 case ArrayValue: {
411 JSONObject obj = (JSONObject)rawObj;
412 String tag = obj.getString("tag");
413 switch (tag) {
414 case "VBoolArray": {
415 ArrayValue.VBoolArray_ tv = new ArrayValue().new VBoolArray_();
416 tv._0 = (ArrayList<Boolean>)fromJSON(Type.Array_Bool,obj.get("arg0"));
417 return tv;
418 }
419 case "VIntArray": {
420 ArrayValue.VIntArray_ tv = new ArrayValue().new VIntArray_();
421 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Int32,obj.get("arg0"));
422 return tv;
423 }
424 case "VWordArray": {
425 ArrayValue.VWordArray_ tv = new ArrayValue().new VWordArray_();
426 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Word32,obj.get("arg0"));
427 return tv;
428 }
429 case "VFloatArray": {
430 ArrayValue.VFloatArray_ tv = new ArrayValue().new VFloatArray_();
431 tv._0 = (ArrayList<Float>)fromJSON(Type.Array_Float,obj.get("arg0"));
432 return tv;
433 }
434 default: throw new Exception("unknown constructor: " + tag);
435 }
436 }
437 case Value: {
438 JSONObject obj = (JSONObject)rawObj;
439 String tag = obj.getString("tag");
440 switch (tag) {
441 case "VBool": {
442 Value.VBool_ tv = new Value().new VBool_();
443 tv._0 = (Boolean)fromJSON(Type.Bool,obj.get("arg0"));
444 return tv;
445 }
446 case "VV2B": {
447 Value.VV2B_ tv = new Value().new VV2B_();
448 tv._0 = (V2<Boolean>)fromJSON(Type.V2_Bool,obj.get("arg0"));
449 return tv;
450 }
451 case "VV3B": {
452 Value.VV3B_ tv = new Value().new VV3B_();
453 tv._0 = (V3<Boolean>)fromJSON(Type.V3_Bool,obj.get("arg0"));
454 return tv;
455 }
456 case "VV4B": {
457 Value.VV4B_ tv = new Value().new VV4B_();
458 tv._0 = (V4<Boolean>)fromJSON(Type.V4_Bool,obj.get("arg0"));
459 return tv;
460 }
461 case "VWord": {
462 Value.VWord_ tv = new Value().new VWord_();
463 tv._0 = (Integer)fromJSON(Type.Word32,obj.get("arg0"));
464 return tv;
465 }
466 case "VV2U": {
467 Value.VV2U_ tv = new Value().new VV2U_();
468 tv._0 = (V2<Integer>)fromJSON(Type.V2_Word,obj.get("arg0"));
469 return tv;
470 }
471 case "VV3U": {
472 Value.VV3U_ tv = new Value().new VV3U_();
473 tv._0 = (V3<Integer>)fromJSON(Type.V3_Word,obj.get("arg0"));
474 return tv;
475 }
476 case "VV4U": {
477 Value.VV4U_ tv = new Value().new VV4U_();
478 tv._0 = (V4<Integer>)fromJSON(Type.V4_Word,obj.get("arg0"));
479 return tv;
480 }
481 case "VInt": {
482 Value.VInt_ tv = new Value().new VInt_();
483 tv._0 = (Integer)fromJSON(Type.Int32,obj.get("arg0"));
484 return tv;
485 }
486 case "VV2I": {
487 Value.VV2I_ tv = new Value().new VV2I_();
488 tv._0 = (V2<Integer>)fromJSON(Type.V2_Int,obj.get("arg0"));
489 return tv;
490 }
491 case "VV3I": {
492 Value.VV3I_ tv = new Value().new VV3I_();
493 tv._0 = (V3<Integer>)fromJSON(Type.V3_Int,obj.get("arg0"));
494 return tv;
495 }
496 case "VV4I": {
497 Value.VV4I_ tv = new Value().new VV4I_();
498 tv._0 = (V4<Integer>)fromJSON(Type.V4_Int,obj.get("arg0"));
499 return tv;
500 }
501 case "VFloat": {
502 Value.VFloat_ tv = new Value().new VFloat_();
503 tv._0 = (Float)fromJSON(Type.Float,obj.get("arg0"));
504 return tv;
505 }
506 case "VV2F": {
507 Value.VV2F_ tv = new Value().new VV2F_();
508 tv._0 = (V2<Float>)fromJSON(Type.V2_Float,obj.get("arg0"));
509 return tv;
510 }
511 case "VV3F": {
512 Value.VV3F_ tv = new Value().new VV3F_();
513 tv._0 = (V3<Float>)fromJSON(Type.V3_Float,obj.get("arg0"));
514 return tv;
515 }
516 case "VV4F": {
517 Value.VV4F_ tv = new Value().new VV4F_();
518 tv._0 = (V4<Float>)fromJSON(Type.V4_Float,obj.get("arg0"));
519 return tv;
520 }
521 case "VM22F": {
522 Value.VM22F_ tv = new Value().new VM22F_();
523 tv._0 = (V2<V2<Float>>)fromJSON(Type.V2_V2_Float,obj.get("arg0"));
524 return tv;
525 }
526 case "VM23F": {
527 Value.VM23F_ tv = new Value().new VM23F_();
528 tv._0 = (V3<V2<Float>>)fromJSON(Type.V3_V2_Float,obj.get("arg0"));
529 return tv;
530 }
531 case "VM24F": {
532 Value.VM24F_ tv = new Value().new VM24F_();
533 tv._0 = (V4<V2<Float>>)fromJSON(Type.V4_V2_Float,obj.get("arg0"));
534 return tv;
535 }
536 case "VM32F": {
537 Value.VM32F_ tv = new Value().new VM32F_();
538 tv._0 = (V2<V3<Float>>)fromJSON(Type.V2_V3_Float,obj.get("arg0"));
539 return tv;
540 }
541 case "VM33F": {
542 Value.VM33F_ tv = new Value().new VM33F_();
543 tv._0 = (V3<V3<Float>>)fromJSON(Type.V3_V3_Float,obj.get("arg0"));
544 return tv;
545 }
546 case "VM34F": {
547 Value.VM34F_ tv = new Value().new VM34F_();
548 tv._0 = (V4<V3<Float>>)fromJSON(Type.V4_V3_Float,obj.get("arg0"));
549 return tv;
550 }
551 case "VM42F": {
552 Value.VM42F_ tv = new Value().new VM42F_();
553 tv._0 = (V2<V4<Float>>)fromJSON(Type.V2_V4_Float,obj.get("arg0"));
554 return tv;
555 }
556 case "VM43F": {
557 Value.VM43F_ tv = new Value().new VM43F_();
558 tv._0 = (V3<V4<Float>>)fromJSON(Type.V3_V4_Float,obj.get("arg0"));
559 return tv;
560 }
561 case "VM44F": {
562 Value.VM44F_ tv = new Value().new VM44F_();
563 tv._0 = (V4<V4<Float>>)fromJSON(Type.V4_V4_Float,obj.get("arg0"));
564 return tv;
565 }
566 default: throw new Exception("unknown constructor: " + tag);
567 }
568 }
569 case InputType: {
570 JSONObject obj = (JSONObject)rawObj;
571 String tag = obj.getString("tag");
572 InputType.Tag tagType;
573 switch (tag) {
574 case "Bool": tagType = InputType.Tag.Bool; break;
575 case "V2B": tagType = InputType.Tag.V2B; break;
576 case "V3B": tagType = InputType.Tag.V3B; break;
577 case "V4B": tagType = InputType.Tag.V4B; break;
578 case "Word": tagType = InputType.Tag.Word; break;
579 case "V2U": tagType = InputType.Tag.V2U; break;
580 case "V3U": tagType = InputType.Tag.V3U; break;
581 case "V4U": tagType = InputType.Tag.V4U; break;
582 case "Int": tagType = InputType.Tag.Int; break;
583 case "V2I": tagType = InputType.Tag.V2I; break;
584 case "V3I": tagType = InputType.Tag.V3I; break;
585 case "V4I": tagType = InputType.Tag.V4I; break;
586 case "Float": tagType = InputType.Tag.Float; break;
587 case "V2F": tagType = InputType.Tag.V2F; break;
588 case "V3F": tagType = InputType.Tag.V3F; break;
589 case "V4F": tagType = InputType.Tag.V4F; break;
590 case "M22F": tagType = InputType.Tag.M22F; break;
591 case "M23F": tagType = InputType.Tag.M23F; break;
592 case "M24F": tagType = InputType.Tag.M24F; break;
593 case "M32F": tagType = InputType.Tag.M32F; break;
594 case "M33F": tagType = InputType.Tag.M33F; break;
595 case "M34F": tagType = InputType.Tag.M34F; break;
596 case "M42F": tagType = InputType.Tag.M42F; break;
597 case "M43F": tagType = InputType.Tag.M43F; break;
598 case "M44F": tagType = InputType.Tag.M44F; break;
599 case "STexture1D": tagType = InputType.Tag.STexture1D; break;
600 case "STexture2D": tagType = InputType.Tag.STexture2D; break;
601 case "STextureCube": tagType = InputType.Tag.STextureCube; break;
602 case "STexture1DArray": tagType = InputType.Tag.STexture1DArray; break;
603 case "STexture2DArray": tagType = InputType.Tag.STexture2DArray; break;
604 case "STexture2DRect": tagType = InputType.Tag.STexture2DRect; break;
605 case "FTexture1D": tagType = InputType.Tag.FTexture1D; break;
606 case "FTexture2D": tagType = InputType.Tag.FTexture2D; break;
607 case "FTexture3D": tagType = InputType.Tag.FTexture3D; break;
608 case "FTextureCube": tagType = InputType.Tag.FTextureCube; break;
609 case "FTexture1DArray": tagType = InputType.Tag.FTexture1DArray; break;
610 case "FTexture2DArray": tagType = InputType.Tag.FTexture2DArray; break;
611 case "FTexture2DMS": tagType = InputType.Tag.FTexture2DMS; break;
612 case "FTexture2DMSArray": tagType = InputType.Tag.FTexture2DMSArray; break;
613 case "FTextureBuffer": tagType = InputType.Tag.FTextureBuffer; break;
614 case "FTexture2DRect": tagType = InputType.Tag.FTexture2DRect; break;
615 case "ITexture1D": tagType = InputType.Tag.ITexture1D; break;
616 case "ITexture2D": tagType = InputType.Tag.ITexture2D; break;
617 case "ITexture3D": tagType = InputType.Tag.ITexture3D; break;
618 case "ITextureCube": tagType = InputType.Tag.ITextureCube; break;
619 case "ITexture1DArray": tagType = InputType.Tag.ITexture1DArray; break;
620 case "ITexture2DArray": tagType = InputType.Tag.ITexture2DArray; break;
621 case "ITexture2DMS": tagType = InputType.Tag.ITexture2DMS; break;
622 case "ITexture2DMSArray": tagType = InputType.Tag.ITexture2DMSArray; break;
623 case "ITextureBuffer": tagType = InputType.Tag.ITextureBuffer; break;
624 case "ITexture2DRect": tagType = InputType.Tag.ITexture2DRect; break;
625 case "UTexture1D": tagType = InputType.Tag.UTexture1D; break;
626 case "UTexture2D": tagType = InputType.Tag.UTexture2D; break;
627 case "UTexture3D": tagType = InputType.Tag.UTexture3D; break;
628 case "UTextureCube": tagType = InputType.Tag.UTextureCube; break;
629 case "UTexture1DArray": tagType = InputType.Tag.UTexture1DArray; break;
630 case "UTexture2DArray": tagType = InputType.Tag.UTexture2DArray; break;
631 case "UTexture2DMS": tagType = InputType.Tag.UTexture2DMS; break;
632 case "UTexture2DMSArray": tagType = InputType.Tag.UTexture2DMSArray; break;
633 case "UTextureBuffer": tagType = InputType.Tag.UTextureBuffer; break;
634 case "UTexture2DRect": tagType = InputType.Tag.UTexture2DRect; break;
635 default: throw new Exception("unknown constructor: " + tag);
636 }
637 InputType o = new InputType();
638 o.tag = tagType;
639 return o;
640 }
641 case PointSpriteCoordOrigin: {
642 JSONObject obj = (JSONObject)rawObj;
643 String tag = obj.getString("tag");
644 PointSpriteCoordOrigin.Tag tagType;
645 switch (tag) {
646 case "LowerLeft": tagType = PointSpriteCoordOrigin.Tag.LowerLeft; break;
647 case "UpperLeft": tagType = PointSpriteCoordOrigin.Tag.UpperLeft; break;
648 default: throw new Exception("unknown constructor: " + tag);
649 }
650 PointSpriteCoordOrigin o = new PointSpriteCoordOrigin();
651 o.tag = tagType;
652 return o;
653 }
654 case PointSize: {
655 JSONObject obj = (JSONObject)rawObj;
656 String tag = obj.getString("tag");
657 PointSize.Tag tagType;
658 switch (tag) {
659 case "PointSize": {
660 PointSize.PointSize_ tv = new PointSize().new PointSize_();
661 tv._0 = (Float)fromJSON(Type.Float,obj.get("arg0"));
662 return tv;
663 }
664 case "ProgramPointSize": tagType = PointSize.Tag.ProgramPointSize; break;
665 default: throw new Exception("unknown constructor: " + tag);
666 }
667 PointSize o = new PointSize();
668 o.tag = tagType;
669 return o;
670 }
671 case PolygonOffset: {
672 JSONObject obj = (JSONObject)rawObj;
673 String tag = obj.getString("tag");
674 PolygonOffset.Tag tagType;
675 switch (tag) {
676 case "NoOffset": tagType = PolygonOffset.Tag.NoOffset; break;
677 case "Offset": {
678 PolygonOffset.Offset_ tv = new PolygonOffset().new Offset_();
679 tv._0 = (Float)fromJSON(Type.Float,obj.get("arg0"));
680 tv._1 = (Float)fromJSON(Type.Float,obj.get("arg1"));
681 return tv;
682 }
683 default: throw new Exception("unknown constructor: " + tag);
684 }
685 PolygonOffset o = new PolygonOffset();
686 o.tag = tagType;
687 return o;
688 }
689 case FrontFace: {
690 JSONObject obj = (JSONObject)rawObj;
691 String tag = obj.getString("tag");
692 FrontFace.Tag tagType;
693 switch (tag) {
694 case "CCW": tagType = FrontFace.Tag.CCW; break;
695 case "CW": tagType = FrontFace.Tag.CW; break;
696 default: throw new Exception("unknown constructor: " + tag);
697 }
698 FrontFace o = new FrontFace();
699 o.tag = tagType;
700 return o;
701 }
702 case PolygonMode: {
703 JSONObject obj = (JSONObject)rawObj;
704 String tag = obj.getString("tag");
705 PolygonMode.Tag tagType;
706 switch (tag) {
707 case "PolygonPoint": {
708 PolygonMode.PolygonPoint_ tv = new PolygonMode().new PolygonPoint_();
709 tv._0 = (PointSize)fromJSON(Type.PointSize,obj.get("arg0"));
710 return tv;
711 }
712 case "PolygonLine": {
713 PolygonMode.PolygonLine_ tv = new PolygonMode().new PolygonLine_();
714 tv._0 = (Float)fromJSON(Type.Float,obj.get("arg0"));
715 return tv;
716 }
717 case "PolygonFill": tagType = PolygonMode.Tag.PolygonFill; break;
718 default: throw new Exception("unknown constructor: " + tag);
719 }
720 PolygonMode o = new PolygonMode();
721 o.tag = tagType;
722 return o;
723 }
724 case ProvokingVertex: {
725 JSONObject obj = (JSONObject)rawObj;
726 String tag = obj.getString("tag");
727 ProvokingVertex.Tag tagType;
728 switch (tag) {
729 case "FirstVertex": tagType = ProvokingVertex.Tag.FirstVertex; break;
730 case "LastVertex": tagType = ProvokingVertex.Tag.LastVertex; break;
731 default: throw new Exception("unknown constructor: " + tag);
732 }
733 ProvokingVertex o = new ProvokingVertex();
734 o.tag = tagType;
735 return o;
736 }
737 case CullMode: {
738 JSONObject obj = (JSONObject)rawObj;
739 String tag = obj.getString("tag");
740 CullMode.Tag tagType;
741 switch (tag) {
742 case "CullNone": tagType = CullMode.Tag.CullNone; break;
743 case "CullFront": {
744 CullMode.CullFront_ tv = new CullMode().new CullFront_();
745 tv._0 = (FrontFace)fromJSON(Type.FrontFace,obj.get("arg0"));
746 return tv;
747 }
748 case "CullBack": {
749 CullMode.CullBack_ tv = new CullMode().new CullBack_();
750 tv._0 = (FrontFace)fromJSON(Type.FrontFace,obj.get("arg0"));
751 return tv;
752 }
753 default: throw new Exception("unknown constructor: " + tag);
754 }
755 CullMode o = new CullMode();
756 o.tag = tagType;
757 return o;
758 }
759 case ComparisonFunction: {
760 JSONObject obj = (JSONObject)rawObj;
761 String tag = obj.getString("tag");
762 ComparisonFunction.Tag tagType;
763 switch (tag) {
764 case "Never": tagType = ComparisonFunction.Tag.Never; break;
765 case "Less": tagType = ComparisonFunction.Tag.Less; break;
766 case "Equal": tagType = ComparisonFunction.Tag.Equal; break;
767 case "Lequal": tagType = ComparisonFunction.Tag.Lequal; break;
768 case "Greater": tagType = ComparisonFunction.Tag.Greater; break;
769 case "Notequal": tagType = ComparisonFunction.Tag.Notequal; break;
770 case "Gequal": tagType = ComparisonFunction.Tag.Gequal; break;
771 case "Always": tagType = ComparisonFunction.Tag.Always; break;
772 default: throw new Exception("unknown constructor: " + tag);
773 }
774 ComparisonFunction o = new ComparisonFunction();
775 o.tag = tagType;
776 return o;
777 }
778 case StencilOperation: {
779 JSONObject obj = (JSONObject)rawObj;
780 String tag = obj.getString("tag");
781 StencilOperation.Tag tagType;
782 switch (tag) {
783 case "OpZero": tagType = StencilOperation.Tag.OpZero; break;
784 case "OpKeep": tagType = StencilOperation.Tag.OpKeep; break;
785 case "OpReplace": tagType = StencilOperation.Tag.OpReplace; break;
786 case "OpIncr": tagType = StencilOperation.Tag.OpIncr; break;
787 case "OpIncrWrap": tagType = StencilOperation.Tag.OpIncrWrap; break;
788 case "OpDecr": tagType = StencilOperation.Tag.OpDecr; break;
789 case "OpDecrWrap": tagType = StencilOperation.Tag.OpDecrWrap; break;
790 case "OpInvert": tagType = StencilOperation.Tag.OpInvert; break;
791 default: throw new Exception("unknown constructor: " + tag);
792 }
793 StencilOperation o = new StencilOperation();
794 o.tag = tagType;
795 return o;
796 }
797 case BlendEquation: {
798 JSONObject obj = (JSONObject)rawObj;
799 String tag = obj.getString("tag");
800 BlendEquation.Tag tagType;
801 switch (tag) {
802 case "FuncAdd": tagType = BlendEquation.Tag.FuncAdd; break;
803 case "FuncSubtract": tagType = BlendEquation.Tag.FuncSubtract; break;
804 case "FuncReverseSubtract": tagType = BlendEquation.Tag.FuncReverseSubtract; break;
805 case "Min": tagType = BlendEquation.Tag.Min; break;
806 case "Max": tagType = BlendEquation.Tag.Max; break;
807 default: throw new Exception("unknown constructor: " + tag);
808 }
809 BlendEquation o = new BlendEquation();
810 o.tag = tagType;
811 return o;
812 }
813 case BlendingFactor: {
814 JSONObject obj = (JSONObject)rawObj;
815 String tag = obj.getString("tag");
816 BlendingFactor.Tag tagType;
817 switch (tag) {
818 case "Zero": tagType = BlendingFactor.Tag.Zero; break;
819 case "One": tagType = BlendingFactor.Tag.One; break;
820 case "SrcColor": tagType = BlendingFactor.Tag.SrcColor; break;
821 case "OneMinusSrcColor": tagType = BlendingFactor.Tag.OneMinusSrcColor; break;
822 case "DstColor": tagType = BlendingFactor.Tag.DstColor; break;
823 case "OneMinusDstColor": tagType = BlendingFactor.Tag.OneMinusDstColor; break;
824 case "SrcAlpha": tagType = BlendingFactor.Tag.SrcAlpha; break;
825 case "OneMinusSrcAlpha": tagType = BlendingFactor.Tag.OneMinusSrcAlpha; break;
826 case "DstAlpha": tagType = BlendingFactor.Tag.DstAlpha; break;
827 case "OneMinusDstAlpha": tagType = BlendingFactor.Tag.OneMinusDstAlpha; break;
828 case "ConstantColor": tagType = BlendingFactor.Tag.ConstantColor; break;
829 case "OneMinusConstantColor": tagType = BlendingFactor.Tag.OneMinusConstantColor; break;
830 case "ConstantAlpha": tagType = BlendingFactor.Tag.ConstantAlpha; break;
831 case "OneMinusConstantAlpha": tagType = BlendingFactor.Tag.OneMinusConstantAlpha; break;
832 case "SrcAlphaSaturate": tagType = BlendingFactor.Tag.SrcAlphaSaturate; break;
833 default: throw new Exception("unknown constructor: " + tag);
834 }
835 BlendingFactor o = new BlendingFactor();
836 o.tag = tagType;
837 return o;
838 }
839 case LogicOperation: {
840 JSONObject obj = (JSONObject)rawObj;
841 String tag = obj.getString("tag");
842 LogicOperation.Tag tagType;
843 switch (tag) {
844 case "Clear": tagType = LogicOperation.Tag.Clear; break;
845 case "And": tagType = LogicOperation.Tag.And; break;
846 case "AndReverse": tagType = LogicOperation.Tag.AndReverse; break;
847 case "Copy": tagType = LogicOperation.Tag.Copy; break;
848 case "AndInverted": tagType = LogicOperation.Tag.AndInverted; break;
849 case "Noop": tagType = LogicOperation.Tag.Noop; break;
850 case "Xor": tagType = LogicOperation.Tag.Xor; break;
851 case "Or": tagType = LogicOperation.Tag.Or; break;
852 case "Nor": tagType = LogicOperation.Tag.Nor; break;
853 case "Equiv": tagType = LogicOperation.Tag.Equiv; break;
854 case "Invert": tagType = LogicOperation.Tag.Invert; break;
855 case "OrReverse": tagType = LogicOperation.Tag.OrReverse; break;
856 case "CopyInverted": tagType = LogicOperation.Tag.CopyInverted; break;
857 case "OrInverted": tagType = LogicOperation.Tag.OrInverted; break;
858 case "Nand": tagType = LogicOperation.Tag.Nand; break;
859 case "Set": tagType = LogicOperation.Tag.Set; break;
860 default: throw new Exception("unknown constructor: " + tag);
861 }
862 LogicOperation o = new LogicOperation();
863 o.tag = tagType;
864 return o;
865 }
866 case StencilOps: {
867 JSONObject obj = (JSONObject)rawObj;
868 String tag = obj.getString("tag");
869 switch (tag) {
870 case "StencilOps": {
871 StencilOps.StencilOps_ tv = new StencilOps().new StencilOps_();
872 tv.frontStencilOp = (StencilOperation)fromJSON(Type.StencilOperation,obj.get("frontStencilOp"));
873 tv.backStencilOp = (StencilOperation)fromJSON(Type.StencilOperation,obj.get("backStencilOp"));
874 return tv;
875 }
876 default: throw new Exception("unknown constructor: " + tag);
877 }
878 }
879 case StencilTest: {
880 JSONObject obj = (JSONObject)rawObj;
881 String tag = obj.getString("tag");
882 switch (tag) {
883 case "StencilTest": {
884 StencilTest.StencilTest_ tv = new StencilTest().new StencilTest_();
885 tv.stencilComparision = (ComparisonFunction)fromJSON(Type.ComparisonFunction,obj.get("stencilComparision"));
886 tv.stencilReference = (Integer)fromJSON(Type.Int32,obj.get("stencilReference"));
887 tv.stencilMask = (Integer)fromJSON(Type.Word32,obj.get("stencilMask"));
888 return tv;
889 }
890 default: throw new Exception("unknown constructor: " + tag);
891 }
892 }
893 case StencilTests: {
894 JSONObject obj = (JSONObject)rawObj;
895 String tag = obj.getString("tag");
896 switch (tag) {
897 case "StencilTests": {
898 StencilTests.StencilTests_ tv = new StencilTests().new StencilTests_();
899 tv._0 = (StencilTest)fromJSON(Type.StencilTest,obj.get("arg0"));
900 tv._1 = (StencilTest)fromJSON(Type.StencilTest,obj.get("arg1"));
901 return tv;
902 }
903 default: throw new Exception("unknown constructor: " + tag);
904 }
905 }
906 case FetchPrimitive: {
907 JSONObject obj = (JSONObject)rawObj;
908 String tag = obj.getString("tag");
909 FetchPrimitive.Tag tagType;
910 switch (tag) {
911 case "Points": tagType = FetchPrimitive.Tag.Points; break;
912 case "Lines": tagType = FetchPrimitive.Tag.Lines; break;
913 case "Triangles": tagType = FetchPrimitive.Tag.Triangles; break;
914 case "LinesAdjacency": tagType = FetchPrimitive.Tag.LinesAdjacency; break;
915 case "TrianglesAdjacency": tagType = FetchPrimitive.Tag.TrianglesAdjacency; break;
916 default: throw new Exception("unknown constructor: " + tag);
917 }
918 FetchPrimitive o = new FetchPrimitive();
919 o.tag = tagType;
920 return o;
921 }
922 case OutputPrimitive: {
923 JSONObject obj = (JSONObject)rawObj;
924 String tag = obj.getString("tag");
925 OutputPrimitive.Tag tagType;
926 switch (tag) {
927 case "TrianglesOutput": tagType = OutputPrimitive.Tag.TrianglesOutput; break;
928 case "LinesOutput": tagType = OutputPrimitive.Tag.LinesOutput; break;
929 case "PointsOutput": tagType = OutputPrimitive.Tag.PointsOutput; break;
930 default: throw new Exception("unknown constructor: " + tag);
931 }
932 OutputPrimitive o = new OutputPrimitive();
933 o.tag = tagType;
934 return o;
935 }
936 case ColorArity: {
937 JSONObject obj = (JSONObject)rawObj;
938 String tag = obj.getString("tag");
939 ColorArity.Tag tagType;
940 switch (tag) {
941 case "Red": tagType = ColorArity.Tag.Red; break;
942 case "RG": tagType = ColorArity.Tag.RG; break;
943 case "RGB": tagType = ColorArity.Tag.RGB; break;
944 case "RGBA": tagType = ColorArity.Tag.RGBA; break;
945 default: throw new Exception("unknown constructor: " + tag);
946 }
947 ColorArity o = new ColorArity();
948 o.tag = tagType;
949 return o;
950 }
951 case Blending: {
952 JSONObject obj = (JSONObject)rawObj;
953 String tag = obj.getString("tag");
954 Blending.Tag tagType;
955 switch (tag) {
956 case "NoBlending": tagType = Blending.Tag.NoBlending; break;
957 case "BlendLogicOp": {
958 Blending.BlendLogicOp_ tv = new Blending().new BlendLogicOp_();
959 tv._0 = (LogicOperation)fromJSON(Type.LogicOperation,obj.get("arg0"));
960 return tv;
961 }
962 case "Blend": {
963 Blending.Blend_ tv = new Blending().new Blend_();
964 tv.colorEqSrc = (BlendEquation)fromJSON(Type.BlendEquation,obj.get("colorEqSrc"));
965 tv.alphaEqSrc = (BlendEquation)fromJSON(Type.BlendEquation,obj.get("alphaEqSrc"));
966 tv.colorFSrc = (BlendingFactor)fromJSON(Type.BlendingFactor,obj.get("colorFSrc"));
967 tv.colorFDst = (BlendingFactor)fromJSON(Type.BlendingFactor,obj.get("colorFDst"));
968 tv.alphaFSrc = (BlendingFactor)fromJSON(Type.BlendingFactor,obj.get("alphaFSrc"));
969 tv.alphaFDst = (BlendingFactor)fromJSON(Type.BlendingFactor,obj.get("alphaFDst"));
970 tv.color = (V4<Float>)fromJSON(Type.V4_Float,obj.get("color"));
971 return tv;
972 }
973 default: throw new Exception("unknown constructor: " + tag);
974 }
975 Blending o = new Blending();
976 o.tag = tagType;
977 return o;
978 }
979 case RasterContext: {
980 JSONObject obj = (JSONObject)rawObj;
981 String tag = obj.getString("tag");
982 switch (tag) {
983 case "PointCtx": {
984 RasterContext.PointCtx_ tv = new RasterContext().new PointCtx_();
985 tv._0 = (PointSize)fromJSON(Type.PointSize,obj.get("arg0"));
986 tv._1 = (Float)fromJSON(Type.Float,obj.get("arg1"));
987 tv._2 = (PointSpriteCoordOrigin)fromJSON(Type.PointSpriteCoordOrigin,obj.get("arg2"));
988 return tv;
989 }
990 case "LineCtx": {
991 RasterContext.LineCtx_ tv = new RasterContext().new LineCtx_();
992 tv._0 = (Float)fromJSON(Type.Float,obj.get("arg0"));
993 tv._1 = (ProvokingVertex)fromJSON(Type.ProvokingVertex,obj.get("arg1"));
994 return tv;
995 }
996 case "TriangleCtx": {
997 RasterContext.TriangleCtx_ tv = new RasterContext().new TriangleCtx_();
998 tv._0 = (CullMode)fromJSON(Type.CullMode,obj.get("arg0"));
999 tv._1 = (PolygonMode)fromJSON(Type.PolygonMode,obj.get("arg1"));
1000 tv._2 = (PolygonOffset)fromJSON(Type.PolygonOffset,obj.get("arg2"));
1001 tv._3 = (ProvokingVertex)fromJSON(Type.ProvokingVertex,obj.get("arg3"));
1002 return tv;
1003 }
1004 default: throw new Exception("unknown constructor: " + tag);
1005 }
1006 }
1007 case FragmentOperation: {
1008 JSONObject obj = (JSONObject)rawObj;
1009 String tag = obj.getString("tag");
1010 switch (tag) {
1011 case "DepthOp": {
1012 FragmentOperation.DepthOp_ tv = new FragmentOperation().new DepthOp_();
1013 tv._0 = (ComparisonFunction)fromJSON(Type.ComparisonFunction,obj.get("arg0"));
1014 tv._1 = (Boolean)fromJSON(Type.Bool,obj.get("arg1"));
1015 return tv;
1016 }
1017 case "StencilOp": {
1018 FragmentOperation.StencilOp_ tv = new FragmentOperation().new StencilOp_();
1019 tv._0 = (StencilTests)fromJSON(Type.StencilTests,obj.get("arg0"));
1020 tv._1 = (StencilOps)fromJSON(Type.StencilOps,obj.get("arg1"));
1021 tv._2 = (StencilOps)fromJSON(Type.StencilOps,obj.get("arg2"));
1022 return tv;
1023 }
1024 case "ColorOp": {
1025 FragmentOperation.ColorOp_ tv = new FragmentOperation().new ColorOp_();
1026 tv._0 = (Blending)fromJSON(Type.Blending,obj.get("arg0"));
1027 tv._1 = (Value)fromJSON(Type.Value,obj.get("arg1"));
1028 return tv;
1029 }
1030 default: throw new Exception("unknown constructor: " + tag);
1031 }
1032 }
1033 case AccumulationContext: {
1034 JSONObject obj = (JSONObject)rawObj;
1035 String tag = obj.getString("tag");
1036 switch (tag) {
1037 case "AccumulationContext": {
1038 AccumulationContext.AccumulationContext_ tv = new AccumulationContext().new AccumulationContext_();
1039 tv.accViewportName = (Maybe<String>)fromJSON(Type.Maybe_String,obj.get("accViewportName"));
1040 tv.accOperations = (ArrayList<FragmentOperation>)fromJSON(Type.List_FragmentOperation,obj.get("accOperations"));
1041 return tv;
1042 }
1043 default: throw new Exception("unknown constructor: " + tag);
1044 }
1045 }
1046 case TextureDataType: {
1047 JSONObject obj = (JSONObject)rawObj;
1048 String tag = obj.getString("tag");
1049 TextureDataType.Tag tagType;
1050 switch (tag) {
1051 case "FloatT": {
1052 TextureDataType.FloatT_ tv = new TextureDataType().new FloatT_();
1053 tv._0 = (ColorArity)fromJSON(Type.ColorArity,obj.get("arg0"));
1054 return tv;
1055 }
1056 case "IntT": {
1057 TextureDataType.IntT_ tv = new TextureDataType().new IntT_();
1058 tv._0 = (ColorArity)fromJSON(Type.ColorArity,obj.get("arg0"));
1059 return tv;
1060 }
1061 case "WordT": {
1062 TextureDataType.WordT_ tv = new TextureDataType().new WordT_();
1063 tv._0 = (ColorArity)fromJSON(Type.ColorArity,obj.get("arg0"));
1064 return tv;
1065 }
1066 case "ShadowT": tagType = TextureDataType.Tag.ShadowT; break;
1067 default: throw new Exception("unknown constructor: " + tag);
1068 }
1069 TextureDataType o = new TextureDataType();
1070 o.tag = tagType;
1071 return o;
1072 }
1073 case TextureType: {
1074 JSONObject obj = (JSONObject)rawObj;
1075 String tag = obj.getString("tag");
1076 switch (tag) {
1077 case "Texture1D": {
1078 TextureType.Texture1D_ tv = new TextureType().new Texture1D_();
1079 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1080 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1081 return tv;
1082 }
1083 case "Texture2D": {
1084 TextureType.Texture2D_ tv = new TextureType().new Texture2D_();
1085 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1086 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1087 return tv;
1088 }
1089 case "Texture3D": {
1090 TextureType.Texture3D_ tv = new TextureType().new Texture3D_();
1091 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1092 return tv;
1093 }
1094 case "TextureCube": {
1095 TextureType.TextureCube_ tv = new TextureType().new TextureCube_();
1096 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1097 return tv;
1098 }
1099 case "TextureRect": {
1100 TextureType.TextureRect_ tv = new TextureType().new TextureRect_();
1101 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1102 return tv;
1103 }
1104 case "Texture2DMS": {
1105 TextureType.Texture2DMS_ tv = new TextureType().new Texture2DMS_();
1106 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1107 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1108 tv._2 = (Integer)fromJSON(Type.Int,obj.get("arg2"));
1109 tv._3 = (Boolean)fromJSON(Type.Bool,obj.get("arg3"));
1110 return tv;
1111 }
1112 case "TextureBuffer": {
1113 TextureType.TextureBuffer_ tv = new TextureType().new TextureBuffer_();
1114 tv._0 = (TextureDataType)fromJSON(Type.TextureDataType,obj.get("arg0"));
1115 return tv;
1116 }
1117 default: throw new Exception("unknown constructor: " + tag);
1118 }
1119 }
1120 case MipMap: {
1121 JSONObject obj = (JSONObject)rawObj;
1122 String tag = obj.getString("tag");
1123 MipMap.Tag tagType;
1124 switch (tag) {
1125 case "Mip": {
1126 MipMap.Mip_ tv = new MipMap().new Mip_();
1127 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1128 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1129 return tv;
1130 }
1131 case "NoMip": tagType = MipMap.Tag.NoMip; break;
1132 case "AutoMip": {
1133 MipMap.AutoMip_ tv = new MipMap().new AutoMip_();
1134 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1135 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1136 return tv;
1137 }
1138 default: throw new Exception("unknown constructor: " + tag);
1139 }
1140 MipMap o = new MipMap();
1141 o.tag = tagType;
1142 return o;
1143 }
1144 case Filter: {
1145 JSONObject obj = (JSONObject)rawObj;
1146 String tag = obj.getString("tag");
1147 Filter.Tag tagType;
1148 switch (tag) {
1149 case "Nearest": tagType = Filter.Tag.Nearest; break;
1150 case "Linear": tagType = Filter.Tag.Linear; break;
1151 case "NearestMipmapNearest": tagType = Filter.Tag.NearestMipmapNearest; break;
1152 case "NearestMipmapLinear": tagType = Filter.Tag.NearestMipmapLinear; break;
1153 case "LinearMipmapNearest": tagType = Filter.Tag.LinearMipmapNearest; break;
1154 case "LinearMipmapLinear": tagType = Filter.Tag.LinearMipmapLinear; break;
1155 default: throw new Exception("unknown constructor: " + tag);
1156 }
1157 Filter o = new Filter();
1158 o.tag = tagType;
1159 return o;
1160 }
1161 case EdgeMode: {
1162 JSONObject obj = (JSONObject)rawObj;
1163 String tag = obj.getString("tag");
1164 EdgeMode.Tag tagType;
1165 switch (tag) {
1166 case "Repeat": tagType = EdgeMode.Tag.Repeat; break;
1167 case "MirroredRepeat": tagType = EdgeMode.Tag.MirroredRepeat; break;
1168 case "ClampToEdge": tagType = EdgeMode.Tag.ClampToEdge; break;
1169 case "ClampToBorder": tagType = EdgeMode.Tag.ClampToBorder; break;
1170 default: throw new Exception("unknown constructor: " + tag);
1171 }
1172 EdgeMode o = new EdgeMode();
1173 o.tag = tagType;
1174 return o;
1175 }
1176 case ImageSemantic: {
1177 JSONObject obj = (JSONObject)rawObj;
1178 String tag = obj.getString("tag");
1179 ImageSemantic.Tag tagType;
1180 switch (tag) {
1181 case "Depth": tagType = ImageSemantic.Tag.Depth; break;
1182 case "Stencil": tagType = ImageSemantic.Tag.Stencil; break;
1183 case "Color": tagType = ImageSemantic.Tag.Color; break;
1184 default: throw new Exception("unknown constructor: " + tag);
1185 }
1186 ImageSemantic o = new ImageSemantic();
1187 o.tag = tagType;
1188 return o;
1189 }
1190 case ImageRef: {
1191 JSONObject obj = (JSONObject)rawObj;
1192 String tag = obj.getString("tag");
1193 switch (tag) {
1194 case "TextureImage": {
1195 ImageRef.TextureImage_ tv = new ImageRef().new TextureImage_();
1196 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1197 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1198 tv._2 = (Maybe<Integer>)fromJSON(Type.Maybe_Int,obj.get("arg2"));
1199 return tv;
1200 }
1201 case "Framebuffer": {
1202 ImageRef.Framebuffer_ tv = new ImageRef().new Framebuffer_();
1203 tv._0 = (ImageSemantic)fromJSON(Type.ImageSemantic,obj.get("arg0"));
1204 return tv;
1205 }
1206 default: throw new Exception("unknown constructor: " + tag);
1207 }
1208 }
1209 case ClearImage: {
1210 JSONObject obj = (JSONObject)rawObj;
1211 String tag = obj.getString("tag");
1212 switch (tag) {
1213 case "ClearImage": {
1214 ClearImage.ClearImage_ tv = new ClearImage().new ClearImage_();
1215 tv.imageSemantic = (ImageSemantic)fromJSON(Type.ImageSemantic,obj.get("imageSemantic"));
1216 tv.clearValue = (Value)fromJSON(Type.Value,obj.get("clearValue"));
1217 return tv;
1218 }
1219 default: throw new Exception("unknown constructor: " + tag);
1220 }
1221 }
1222 case Command: {
1223 JSONObject obj = (JSONObject)rawObj;
1224 String tag = obj.getString("tag");
1225 switch (tag) {
1226 case "SetRasterContext": {
1227 Command.SetRasterContext_ tv = new Command().new SetRasterContext_();
1228 tv._0 = (RasterContext)fromJSON(Type.RasterContext,obj.get("arg0"));
1229 return tv;
1230 }
1231 case "SetAccumulationContext": {
1232 Command.SetAccumulationContext_ tv = new Command().new SetAccumulationContext_();
1233 tv._0 = (AccumulationContext)fromJSON(Type.AccumulationContext,obj.get("arg0"));
1234 return tv;
1235 }
1236 case "SetRenderTarget": {
1237 Command.SetRenderTarget_ tv = new Command().new SetRenderTarget_();
1238 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1239 return tv;
1240 }
1241 case "SetProgram": {
1242 Command.SetProgram_ tv = new Command().new SetProgram_();
1243 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1244 return tv;
1245 }
1246 case "SetSamplerUniform": {
1247 Command.SetSamplerUniform_ tv = new Command().new SetSamplerUniform_();
1248 tv._0 = (String)fromJSON(Type.String,obj.get("arg0"));
1249 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1250 return tv;
1251 }
1252 case "SetTexture": {
1253 Command.SetTexture_ tv = new Command().new SetTexture_();
1254 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1255 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1256 return tv;
1257 }
1258 case "SetSampler": {
1259 Command.SetSampler_ tv = new Command().new SetSampler_();
1260 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1261 tv._1 = (Maybe<Integer>)fromJSON(Type.Maybe_Int,obj.get("arg1"));
1262 return tv;
1263 }
1264 case "RenderSlot": {
1265 Command.RenderSlot_ tv = new Command().new RenderSlot_();
1266 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1267 return tv;
1268 }
1269 case "RenderStream": {
1270 Command.RenderStream_ tv = new Command().new RenderStream_();
1271 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1272 return tv;
1273 }
1274 case "ClearRenderTarget": {
1275 Command.ClearRenderTarget_ tv = new Command().new ClearRenderTarget_();
1276 tv._0 = (ArrayList<ClearImage>)fromJSON(Type.Array_ClearImage,obj.get("arg0"));
1277 return tv;
1278 }
1279 case "GenerateMipMap": {
1280 Command.GenerateMipMap_ tv = new Command().new GenerateMipMap_();
1281 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1282 return tv;
1283 }
1284 case "SaveImage": {
1285 Command.SaveImage_ tv = new Command().new SaveImage_();
1286 tv._0 = (Integer)fromJSON(Type.Int,obj.get("arg0"));
1287 tv._1 = (ImageRef)fromJSON(Type.ImageRef,obj.get("arg1"));
1288 return tv;
1289 }
1290 case "LoadImage": {
1291 Command.LoadImage_ tv = new Command().new LoadImage_();
1292 tv._0 = (ImageRef)fromJSON(Type.ImageRef,obj.get("arg0"));
1293 tv._1 = (Integer)fromJSON(Type.Int,obj.get("arg1"));
1294 return tv;
1295 }
1296 default: throw new Exception("unknown constructor: " + tag);
1297 }
1298 }
1299 case SamplerDescriptor: {
1300 JSONObject obj = (JSONObject)rawObj;
1301 String tag = obj.getString("tag");
1302 switch (tag) {
1303 case "SamplerDescriptor": {
1304 SamplerDescriptor.SamplerDescriptor_ tv = new SamplerDescriptor().new SamplerDescriptor_();
1305 tv.samplerWrapS = (EdgeMode)fromJSON(Type.EdgeMode,obj.get("samplerWrapS"));
1306 tv.samplerWrapT = (Maybe<EdgeMode>)fromJSON(Type.Maybe_EdgeMode,obj.get("samplerWrapT"));
1307 tv.samplerWrapR = (Maybe<EdgeMode>)fromJSON(Type.Maybe_EdgeMode,obj.get("samplerWrapR"));
1308 tv.samplerMinFilter = (Filter)fromJSON(Type.Filter,obj.get("samplerMinFilter"));
1309 tv.samplerMagFilter = (Filter)fromJSON(Type.Filter,obj.get("samplerMagFilter"));
1310 tv.samplerBorderColor = (Value)fromJSON(Type.Value,obj.get("samplerBorderColor"));
1311 tv.samplerMinLod = (Maybe<Float>)fromJSON(Type.Maybe_Float,obj.get("samplerMinLod"));
1312 tv.samplerMaxLod = (Maybe<Float>)fromJSON(Type.Maybe_Float,obj.get("samplerMaxLod"));
1313 tv.samplerLodBias = (Float)fromJSON(Type.Float,obj.get("samplerLodBias"));
1314 tv.samplerCompareFunc = (Maybe<ComparisonFunction>)fromJSON(Type.Maybe_ComparisonFunction,obj.get("samplerCompareFunc"));
1315 return tv;
1316 }
1317 default: throw new Exception("unknown constructor: " + tag);
1318 }
1319 }
1320 case TextureDescriptor: {
1321 JSONObject obj = (JSONObject)rawObj;
1322 String tag = obj.getString("tag");
1323 switch (tag) {
1324 case "TextureDescriptor": {
1325 TextureDescriptor.TextureDescriptor_ tv = new TextureDescriptor().new TextureDescriptor_();
1326 tv.textureType = (TextureType)fromJSON(Type.TextureType,obj.get("textureType"));
1327 tv.textureSize = (Value)fromJSON(Type.Value,obj.get("textureSize"));
1328 tv.textureSemantic = (ImageSemantic)fromJSON(Type.ImageSemantic,obj.get("textureSemantic"));
1329 tv.textureSampler = (SamplerDescriptor)fromJSON(Type.SamplerDescriptor,obj.get("textureSampler"));
1330 tv.textureBaseLevel = (Integer)fromJSON(Type.Int,obj.get("textureBaseLevel"));
1331 tv.textureMaxLevel = (Integer)fromJSON(Type.Int,obj.get("textureMaxLevel"));
1332 return tv;
1333 }
1334 default: throw new Exception("unknown constructor: " + tag);
1335 }
1336 }
1337 case Parameter: {
1338 JSONObject obj = (JSONObject)rawObj;
1339 String tag = obj.getString("tag");
1340 switch (tag) {
1341 case "Parameter": {
1342 Parameter.Parameter_ tv = new Parameter().new Parameter_();
1343 tv.name = (String)fromJSON(Type.String,obj.get("name"));
1344 tv.ty = (InputType)fromJSON(Type.InputType,obj.get("ty"));
1345 return tv;
1346 }
1347 default: throw new Exception("unknown constructor: " + tag);
1348 }
1349 }
1350 case Program: {
1351 JSONObject obj = (JSONObject)rawObj;
1352 String tag = obj.getString("tag");
1353 switch (tag) {
1354 case "Program": {
1355 Program.Program_ tv = new Program().new Program_();
1356 tv.programUniforms = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("programUniforms"));
1357 tv.programStreams = (HashMap<String, Parameter>)fromJSON(Type.Map_String_Parameter,obj.get("programStreams"));
1358 tv.programInTextures = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("programInTextures"));
1359 tv.programOutput = (ArrayList<Parameter>)fromJSON(Type.Array_Parameter,obj.get("programOutput"));
1360 tv.vertexShader = (String)fromJSON(Type.String,obj.get("vertexShader"));
1361 tv.geometryShader = (Maybe<String>)fromJSON(Type.Maybe_String,obj.get("geometryShader"));
1362 tv.fragmentShader = (String)fromJSON(Type.String,obj.get("fragmentShader"));
1363 return tv;
1364 }
1365 default: throw new Exception("unknown constructor: " + tag);
1366 }
1367 }
1368 case Slot: {
1369 JSONObject obj = (JSONObject)rawObj;
1370 String tag = obj.getString("tag");
1371 switch (tag) {
1372 case "Slot": {
1373 Slot.Slot_ tv = new Slot().new Slot_();
1374 tv.slotName = (String)fromJSON(Type.String,obj.get("slotName"));
1375 tv.slotStreams = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("slotStreams"));
1376 tv.slotUniforms = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("slotUniforms"));
1377 tv.slotPrimitive = (FetchPrimitive)fromJSON(Type.FetchPrimitive,obj.get("slotPrimitive"));
1378 tv.slotPrograms = (ArrayList<Integer>)fromJSON(Type.Array_Int,obj.get("slotPrograms"));
1379 return tv;
1380 }
1381 default: throw new Exception("unknown constructor: " + tag);
1382 }
1383 }
1384 case StreamData: {
1385 JSONObject obj = (JSONObject)rawObj;
1386 String tag = obj.getString("tag");
1387 switch (tag) {
1388 case "StreamData": {
1389 StreamData.StreamData_ tv = new StreamData().new StreamData_();
1390 tv.streamData = (HashMap<String, ArrayValue>)fromJSON(Type.Map_String_ArrayValue,obj.get("streamData"));
1391 tv.streamType = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("streamType"));
1392 tv.streamPrimitive = (FetchPrimitive)fromJSON(Type.FetchPrimitive,obj.get("streamPrimitive"));
1393 tv.streamPrograms = (ArrayList<Integer>)fromJSON(Type.Array_Int,obj.get("streamPrograms"));
1394 return tv;
1395 }
1396 default: throw new Exception("unknown constructor: " + tag);
1397 }
1398 }
1399 case TargetItem: {
1400 JSONObject obj = (JSONObject)rawObj;
1401 String tag = obj.getString("tag");
1402 switch (tag) {
1403 case "TargetItem": {
1404 TargetItem.TargetItem_ tv = new TargetItem().new TargetItem_();
1405 tv.targetSemantic = (ImageSemantic)fromJSON(Type.ImageSemantic,obj.get("targetSemantic"));
1406 tv.targetRef = (Maybe<ImageRef>)fromJSON(Type.Maybe_ImageRef,obj.get("targetRef"));
1407 return tv;
1408 }
1409 default: throw new Exception("unknown constructor: " + tag);
1410 }
1411 }
1412 case RenderTarget: {
1413 JSONObject obj = (JSONObject)rawObj;
1414 String tag = obj.getString("tag");
1415 switch (tag) {
1416 case "RenderTarget": {
1417 RenderTarget.RenderTarget_ tv = new RenderTarget().new RenderTarget_();
1418 tv.renderTargets = (ArrayList<TargetItem>)fromJSON(Type.Array_TargetItem,obj.get("renderTargets"));
1419 return tv;
1420 }
1421 default: throw new Exception("unknown constructor: " + tag);
1422 }
1423 }
1424 case Backend: {
1425 JSONObject obj = (JSONObject)rawObj;
1426 String tag = obj.getString("tag");
1427 Backend.Tag tagType;
1428 switch (tag) {
1429 case "WebGL1": tagType = Backend.Tag.WebGL1; break;
1430 case "OpenGL33": tagType = Backend.Tag.OpenGL33; break;
1431 default: throw new Exception("unknown constructor: " + tag);
1432 }
1433 Backend o = new Backend();
1434 o.tag = tagType;
1435 return o;
1436 }
1437 case Pipeline: {
1438 JSONObject obj = (JSONObject)rawObj;
1439 String tag = obj.getString("tag");
1440 switch (tag) {
1441 case "Pipeline": {
1442 Pipeline.Pipeline_ tv = new Pipeline().new Pipeline_();
1443 tv.info = (String)fromJSON(Type.String,obj.get("info"));
1444 tv.backend = (Backend)fromJSON(Type.Backend,obj.get("backend"));
1445 tv.textures = (ArrayList<TextureDescriptor>)fromJSON(Type.Array_TextureDescriptor,obj.get("textures"));
1446 tv.samplers = (ArrayList<SamplerDescriptor>)fromJSON(Type.Array_SamplerDescriptor,obj.get("samplers"));
1447 tv.targets = (ArrayList<RenderTarget>)fromJSON(Type.Array_RenderTarget,obj.get("targets"));
1448 tv.programs = (ArrayList<Program>)fromJSON(Type.Array_Program,obj.get("programs"));
1449 tv.slots = (ArrayList<Slot>)fromJSON(Type.Array_Slot,obj.get("slots"));
1450 tv.streams = (ArrayList<StreamData>)fromJSON(Type.Array_StreamData,obj.get("streams"));
1451 tv.commands = (ArrayList<Command>)fromJSON(Type.Array_Command,obj.get("commands"));
1452 return tv;
1453 }
1454 default: throw new Exception("unknown constructor: " + tag);
1455 }
1456 }
1457 }
1458 throw new Exception("unknown type");
1459 }
1460} \ No newline at end of file
diff --git a/ddl/out/java/LambdaCube/IR/LogicOperation.java b/ddl/out/java/LambdaCube/IR/LogicOperation.java
new file mode 100644
index 0000000..351bfe5
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/LogicOperation.java
@@ -0,0 +1,33 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class LogicOperation {
12 public enum Tag {
13 Clear,
14 And,
15 AndReverse,
16 Copy,
17 AndInverted,
18 Noop,
19 Xor,
20 Or,
21 Nor,
22 Equiv,
23 Invert,
24 OrReverse,
25 CopyInverted,
26 OrInverted,
27 Nand,
28 Set
29 }
30 public Tag tag;
31
32}
33
diff --git a/ddl/out/java/LambdaCube/IR/MipMap.java b/ddl/out/java/LambdaCube/IR/MipMap.java
new file mode 100644
index 0000000..69c7fb4
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/MipMap.java
@@ -0,0 +1,30 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class MipMap {
12 public enum Tag {
13 Mip,
14 NoMip,
15 AutoMip
16 }
17 public Tag tag;
18
19 public class Mip_ extends MipMap {
20 public Integer _0;
21 public Integer _1;
22 public Mip_() { tag = MipMap.Tag.Mip; }
23 }
24 public class AutoMip_ extends MipMap {
25 public Integer _0;
26 public Integer _1;
27 public AutoMip_() { tag = MipMap.Tag.AutoMip; }
28 }
29}
30
diff --git a/ddl/out/java/LambdaCube/IR/OutputPrimitive.java b/ddl/out/java/LambdaCube/IR/OutputPrimitive.java
new file mode 100644
index 0000000..cda4e7a
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/OutputPrimitive.java
@@ -0,0 +1,20 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class OutputPrimitive {
12 public enum Tag {
13 TrianglesOutput,
14 LinesOutput,
15 PointsOutput
16 }
17 public Tag tag;
18
19}
20
diff --git a/ddl/out/java/LambdaCube/IR/Parameter.java b/ddl/out/java/LambdaCube/IR/Parameter.java
new file mode 100644
index 0000000..11f6778
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Parameter.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Parameter {
12 public enum Tag {
13 Parameter
14 }
15 public Tag tag;
16
17 public class Parameter_ extends Parameter {
18 public String name;
19 public InputType ty;
20 public Parameter_() { tag = Parameter.Tag.Parameter; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/Pipeline.java b/ddl/out/java/LambdaCube/IR/Pipeline.java
new file mode 100644
index 0000000..5a98897
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Pipeline.java
@@ -0,0 +1,30 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Pipeline {
12 public enum Tag {
13 Pipeline
14 }
15 public Tag tag;
16
17 public class Pipeline_ extends Pipeline {
18 public String info;
19 public Backend backend;
20 public ArrayList<TextureDescriptor> textures;
21 public ArrayList<SamplerDescriptor> samplers;
22 public ArrayList<RenderTarget> targets;
23 public ArrayList<Program> programs;
24 public ArrayList<Slot> slots;
25 public ArrayList<StreamData> streams;
26 public ArrayList<Command> commands;
27 public Pipeline_() { tag = Pipeline.Tag.Pipeline; }
28 }
29}
30
diff --git a/ddl/out/java/LambdaCube/IR/PointSize.java b/ddl/out/java/LambdaCube/IR/PointSize.java
new file mode 100644
index 0000000..195cd89
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/PointSize.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class PointSize {
12 public enum Tag {
13 PointSize,
14 ProgramPointSize
15 }
16 public Tag tag;
17
18 public class PointSize_ extends PointSize {
19 public Float _0;
20 public PointSize_() { tag = PointSize.Tag.PointSize; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java b/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java
new file mode 100644
index 0000000..6b705bb
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/PointSpriteCoordOrigin.java
@@ -0,0 +1,19 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class PointSpriteCoordOrigin {
12 public enum Tag {
13 LowerLeft,
14 UpperLeft
15 }
16 public Tag tag;
17
18}
19
diff --git a/ddl/out/java/LambdaCube/IR/PolygonMode.java b/ddl/out/java/LambdaCube/IR/PolygonMode.java
new file mode 100644
index 0000000..a1beedc
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/PolygonMode.java
@@ -0,0 +1,28 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class PolygonMode {
12 public enum Tag {
13 PolygonPoint,
14 PolygonLine,
15 PolygonFill
16 }
17 public Tag tag;
18
19 public class PolygonPoint_ extends PolygonMode {
20 public PointSize _0;
21 public PolygonPoint_() { tag = PolygonMode.Tag.PolygonPoint; }
22 }
23 public class PolygonLine_ extends PolygonMode {
24 public Float _0;
25 public PolygonLine_() { tag = PolygonMode.Tag.PolygonLine; }
26 }
27}
28
diff --git a/ddl/out/java/LambdaCube/IR/PolygonOffset.java b/ddl/out/java/LambdaCube/IR/PolygonOffset.java
new file mode 100644
index 0000000..dea6684
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/PolygonOffset.java
@@ -0,0 +1,24 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class PolygonOffset {
12 public enum Tag {
13 NoOffset,
14 Offset
15 }
16 public Tag tag;
17
18 public class Offset_ extends PolygonOffset {
19 public Float _0;
20 public Float _1;
21 public Offset_() { tag = PolygonOffset.Tag.Offset; }
22 }
23}
24
diff --git a/ddl/out/java/LambdaCube/IR/Program.java b/ddl/out/java/LambdaCube/IR/Program.java
new file mode 100644
index 0000000..4f0e999
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Program.java
@@ -0,0 +1,28 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Program {
12 public enum Tag {
13 Program
14 }
15 public Tag tag;
16
17 public class Program_ extends Program {
18 public HashMap<String, InputType> programUniforms;
19 public HashMap<String, Parameter> programStreams;
20 public HashMap<String, InputType> programInTextures;
21 public ArrayList<Parameter> programOutput;
22 public String vertexShader;
23 public Maybe<String> geometryShader;
24 public String fragmentShader;
25 public Program_() { tag = Program.Tag.Program; }
26 }
27}
28
diff --git a/ddl/out/java/LambdaCube/IR/ProvokingVertex.java b/ddl/out/java/LambdaCube/IR/ProvokingVertex.java
new file mode 100644
index 0000000..30ee0fc
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/ProvokingVertex.java
@@ -0,0 +1,19 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class ProvokingVertex {
12 public enum Tag {
13 FirstVertex,
14 LastVertex
15 }
16 public Tag tag;
17
18}
19
diff --git a/ddl/out/java/LambdaCube/IR/RasterContext.java b/ddl/out/java/LambdaCube/IR/RasterContext.java
new file mode 100644
index 0000000..c246a8a
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/RasterContext.java
@@ -0,0 +1,38 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class RasterContext {
12 public enum Tag {
13 PointCtx,
14 LineCtx,
15 TriangleCtx
16 }
17 public Tag tag;
18
19 public class PointCtx_ extends RasterContext {
20 public PointSize _0;
21 public Float _1;
22 public PointSpriteCoordOrigin _2;
23 public PointCtx_() { tag = RasterContext.Tag.PointCtx; }
24 }
25 public class LineCtx_ extends RasterContext {
26 public Float _0;
27 public ProvokingVertex _1;
28 public LineCtx_() { tag = RasterContext.Tag.LineCtx; }
29 }
30 public class TriangleCtx_ extends RasterContext {
31 public CullMode _0;
32 public PolygonMode _1;
33 public PolygonOffset _2;
34 public ProvokingVertex _3;
35 public TriangleCtx_() { tag = RasterContext.Tag.TriangleCtx; }
36 }
37}
38
diff --git a/ddl/out/java/LambdaCube/IR/RenderTarget.java b/ddl/out/java/LambdaCube/IR/RenderTarget.java
new file mode 100644
index 0000000..816dbc6
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/RenderTarget.java
@@ -0,0 +1,22 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class RenderTarget {
12 public enum Tag {
13 RenderTarget
14 }
15 public Tag tag;
16
17 public class RenderTarget_ extends RenderTarget {
18 public ArrayList<TargetItem> renderTargets;
19 public RenderTarget_() { tag = RenderTarget.Tag.RenderTarget; }
20 }
21}
22
diff --git a/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java b/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java
new file mode 100644
index 0000000..1149bf3
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/SamplerDescriptor.java
@@ -0,0 +1,31 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class SamplerDescriptor {
12 public enum Tag {
13 SamplerDescriptor
14 }
15 public Tag tag;
16
17 public class SamplerDescriptor_ extends SamplerDescriptor {
18 public EdgeMode samplerWrapS;
19 public Maybe<EdgeMode> samplerWrapT;
20 public Maybe<EdgeMode> samplerWrapR;
21 public Filter samplerMinFilter;
22 public Filter samplerMagFilter;
23 public Value samplerBorderColor;
24 public Maybe<Float> samplerMinLod;
25 public Maybe<Float> samplerMaxLod;
26 public Float samplerLodBias;
27 public Maybe<ComparisonFunction> samplerCompareFunc;
28 public SamplerDescriptor_() { tag = SamplerDescriptor.Tag.SamplerDescriptor; }
29 }
30}
31
diff --git a/ddl/out/java/LambdaCube/IR/Slot.java b/ddl/out/java/LambdaCube/IR/Slot.java
new file mode 100644
index 0000000..bd6fac3
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Slot.java
@@ -0,0 +1,26 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Slot {
12 public enum Tag {
13 Slot
14 }
15 public Tag tag;
16
17 public class Slot_ extends Slot {
18 public String slotName;
19 public HashMap<String, InputType> slotStreams;
20 public HashMap<String, InputType> slotUniforms;
21 public FetchPrimitive slotPrimitive;
22 public ArrayList<Integer> slotPrograms;
23 public Slot_() { tag = Slot.Tag.Slot; }
24 }
25}
26
diff --git a/ddl/out/java/LambdaCube/IR/StencilOperation.java b/ddl/out/java/LambdaCube/IR/StencilOperation.java
new file mode 100644
index 0000000..ef3a62f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/StencilOperation.java
@@ -0,0 +1,25 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class StencilOperation {
12 public enum Tag {
13 OpZero,
14 OpKeep,
15 OpReplace,
16 OpIncr,
17 OpIncrWrap,
18 OpDecr,
19 OpDecrWrap,
20 OpInvert
21 }
22 public Tag tag;
23
24}
25
diff --git a/ddl/out/java/LambdaCube/IR/StencilOps.java b/ddl/out/java/LambdaCube/IR/StencilOps.java
new file mode 100644
index 0000000..54f6d95
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/StencilOps.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class StencilOps {
12 public enum Tag {
13 StencilOps
14 }
15 public Tag tag;
16
17 public class StencilOps_ extends StencilOps {
18 public StencilOperation frontStencilOp;
19 public StencilOperation backStencilOp;
20 public StencilOps_() { tag = StencilOps.Tag.StencilOps; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/StencilTest.java b/ddl/out/java/LambdaCube/IR/StencilTest.java
new file mode 100644
index 0000000..ef16647
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/StencilTest.java
@@ -0,0 +1,24 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class StencilTest {
12 public enum Tag {
13 StencilTest
14 }
15 public Tag tag;
16
17 public class StencilTest_ extends StencilTest {
18 public ComparisonFunction stencilComparision;
19 public Integer stencilReference;
20 public Integer stencilMask;
21 public StencilTest_() { tag = StencilTest.Tag.StencilTest; }
22 }
23}
24
diff --git a/ddl/out/java/LambdaCube/IR/StencilTests.java b/ddl/out/java/LambdaCube/IR/StencilTests.java
new file mode 100644
index 0000000..d350f5f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/StencilTests.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class StencilTests {
12 public enum Tag {
13 StencilTests
14 }
15 public Tag tag;
16
17 public class StencilTests_ extends StencilTests {
18 public StencilTest _0;
19 public StencilTest _1;
20 public StencilTests_() { tag = StencilTests.Tag.StencilTests; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/StreamData.java b/ddl/out/java/LambdaCube/IR/StreamData.java
new file mode 100644
index 0000000..81c9d0b
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/StreamData.java
@@ -0,0 +1,25 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class StreamData {
12 public enum Tag {
13 StreamData
14 }
15 public Tag tag;
16
17 public class StreamData_ extends StreamData {
18 public HashMap<String, ArrayValue> streamData;
19 public HashMap<String, InputType> streamType;
20 public FetchPrimitive streamPrimitive;
21 public ArrayList<Integer> streamPrograms;
22 public StreamData_() { tag = StreamData.Tag.StreamData; }
23 }
24}
25
diff --git a/ddl/out/java/LambdaCube/IR/TargetItem.java b/ddl/out/java/LambdaCube/IR/TargetItem.java
new file mode 100644
index 0000000..f6315fc
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/TargetItem.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class TargetItem {
12 public enum Tag {
13 TargetItem
14 }
15 public Tag tag;
16
17 public class TargetItem_ extends TargetItem {
18 public ImageSemantic targetSemantic;
19 public Maybe<ImageRef> targetRef;
20 public TargetItem_() { tag = TargetItem.Tag.TargetItem; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/IR/TextureDataType.java b/ddl/out/java/LambdaCube/IR/TextureDataType.java
new file mode 100644
index 0000000..4725a3f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/TextureDataType.java
@@ -0,0 +1,33 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class TextureDataType {
12 public enum Tag {
13 FloatT,
14 IntT,
15 WordT,
16 ShadowT
17 }
18 public Tag tag;
19
20 public class FloatT_ extends TextureDataType {
21 public ColorArity _0;
22 public FloatT_() { tag = TextureDataType.Tag.FloatT; }
23 }
24 public class IntT_ extends TextureDataType {
25 public ColorArity _0;
26 public IntT_() { tag = TextureDataType.Tag.IntT; }
27 }
28 public class WordT_ extends TextureDataType {
29 public ColorArity _0;
30 public WordT_() { tag = TextureDataType.Tag.WordT; }
31 }
32}
33
diff --git a/ddl/out/java/LambdaCube/IR/TextureDescriptor.java b/ddl/out/java/LambdaCube/IR/TextureDescriptor.java
new file mode 100644
index 0000000..d4d3cdd
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/TextureDescriptor.java
@@ -0,0 +1,27 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class TextureDescriptor {
12 public enum Tag {
13 TextureDescriptor
14 }
15 public Tag tag;
16
17 public class TextureDescriptor_ extends TextureDescriptor {
18 public TextureType textureType;
19 public Value textureSize;
20 public ImageSemantic textureSemantic;
21 public SamplerDescriptor textureSampler;
22 public Integer textureBaseLevel;
23 public Integer textureMaxLevel;
24 public TextureDescriptor_() { tag = TextureDescriptor.Tag.TextureDescriptor; }
25 }
26}
27
diff --git a/ddl/out/java/LambdaCube/IR/TextureType.java b/ddl/out/java/LambdaCube/IR/TextureType.java
new file mode 100644
index 0000000..2425c1f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/TextureType.java
@@ -0,0 +1,57 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class TextureType {
12 public enum Tag {
13 Texture1D,
14 Texture2D,
15 Texture3D,
16 TextureCube,
17 TextureRect,
18 Texture2DMS,
19 TextureBuffer
20 }
21 public Tag tag;
22
23 public class Texture1D_ extends TextureType {
24 public TextureDataType _0;
25 public Integer _1;
26 public Texture1D_() { tag = TextureType.Tag.Texture1D; }
27 }
28 public class Texture2D_ extends TextureType {
29 public TextureDataType _0;
30 public Integer _1;
31 public Texture2D_() { tag = TextureType.Tag.Texture2D; }
32 }
33 public class Texture3D_ extends TextureType {
34 public TextureDataType _0;
35 public Texture3D_() { tag = TextureType.Tag.Texture3D; }
36 }
37 public class TextureCube_ extends TextureType {
38 public TextureDataType _0;
39 public TextureCube_() { tag = TextureType.Tag.TextureCube; }
40 }
41 public class TextureRect_ extends TextureType {
42 public TextureDataType _0;
43 public TextureRect_() { tag = TextureType.Tag.TextureRect; }
44 }
45 public class Texture2DMS_ extends TextureType {
46 public TextureDataType _0;
47 public Integer _1;
48 public Integer _2;
49 public Boolean _3;
50 public Texture2DMS_() { tag = TextureType.Tag.Texture2DMS; }
51 }
52 public class TextureBuffer_ extends TextureType {
53 public TextureDataType _0;
54 public TextureBuffer_() { tag = TextureType.Tag.TextureBuffer; }
55 }
56}
57
diff --git a/ddl/out/java/LambdaCube/IR/Value.java b/ddl/out/java/LambdaCube/IR/Value.java
new file mode 100644
index 0000000..75de175
--- /dev/null
+++ b/ddl/out/java/LambdaCube/IR/Value.java
@@ -0,0 +1,142 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:51.714241000000Z
3
4package LambdaCube.IR;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Value {
12 public enum Tag {
13 VBool,
14 VV2B,
15 VV3B,
16 VV4B,
17 VWord,
18 VV2U,
19 VV3U,
20 VV4U,
21 VInt,
22 VV2I,
23 VV3I,
24 VV4I,
25 VFloat,
26 VV2F,
27 VV3F,
28 VV4F,
29 VM22F,
30 VM23F,
31 VM24F,
32 VM32F,
33 VM33F,
34 VM34F,
35 VM42F,
36 VM43F,
37 VM44F
38 }
39 public Tag tag;
40
41 public class VBool_ extends Value {
42 public Boolean _0;
43 public VBool_() { tag = Value.Tag.VBool; }
44 }
45 public class VV2B_ extends Value {
46 public V2<Boolean> _0;
47 public VV2B_() { tag = Value.Tag.VV2B; }
48 }
49 public class VV3B_ extends Value {
50 public V3<Boolean> _0;
51 public VV3B_() { tag = Value.Tag.VV3B; }
52 }
53 public class VV4B_ extends Value {
54 public V4<Boolean> _0;
55 public VV4B_() { tag = Value.Tag.VV4B; }
56 }
57 public class VWord_ extends Value {
58 public Integer _0;
59 public VWord_() { tag = Value.Tag.VWord; }
60 }
61 public class VV2U_ extends Value {
62 public V2<Integer> _0;
63 public VV2U_() { tag = Value.Tag.VV2U; }
64 }
65 public class VV3U_ extends Value {
66 public V3<Integer> _0;
67 public VV3U_() { tag = Value.Tag.VV3U; }
68 }
69 public class VV4U_ extends Value {
70 public V4<Integer> _0;
71 public VV4U_() { tag = Value.Tag.VV4U; }
72 }
73 public class VInt_ extends Value {
74 public Integer _0;
75 public VInt_() { tag = Value.Tag.VInt; }
76 }
77 public class VV2I_ extends Value {
78 public V2<Integer> _0;
79 public VV2I_() { tag = Value.Tag.VV2I; }
80 }
81 public class VV3I_ extends Value {
82 public V3<Integer> _0;
83 public VV3I_() { tag = Value.Tag.VV3I; }
84 }
85 public class VV4I_ extends Value {
86 public V4<Integer> _0;
87 public VV4I_() { tag = Value.Tag.VV4I; }
88 }
89 public class VFloat_ extends Value {
90 public Float _0;
91 public VFloat_() { tag = Value.Tag.VFloat; }
92 }
93 public class VV2F_ extends Value {
94 public V2<Float> _0;
95 public VV2F_() { tag = Value.Tag.VV2F; }
96 }
97 public class VV3F_ extends Value {
98 public V3<Float> _0;
99 public VV3F_() { tag = Value.Tag.VV3F; }
100 }
101 public class VV4F_ extends Value {
102 public V4<Float> _0;
103 public VV4F_() { tag = Value.Tag.VV4F; }
104 }
105 public class VM22F_ extends Value {
106 public V2<V2<Float>> _0;
107 public VM22F_() { tag = Value.Tag.VM22F; }
108 }
109 public class VM23F_ extends Value {
110 public V3<V2<Float>> _0;
111 public VM23F_() { tag = Value.Tag.VM23F; }
112 }
113 public class VM24F_ extends Value {
114 public V4<V2<Float>> _0;
115 public VM24F_() { tag = Value.Tag.VM24F; }
116 }
117 public class VM32F_ extends Value {
118 public V2<V3<Float>> _0;
119 public VM32F_() { tag = Value.Tag.VM32F; }
120 }
121 public class VM33F_ extends Value {
122 public V3<V3<Float>> _0;
123 public VM33F_() { tag = Value.Tag.VM33F; }
124 }
125 public class VM34F_ extends Value {
126 public V4<V3<Float>> _0;
127 public VM34F_() { tag = Value.Tag.VM34F; }
128 }
129 public class VM42F_ extends Value {
130 public V2<V4<Float>> _0;
131 public VM42F_() { tag = Value.Tag.VM42F; }
132 }
133 public class VM43F_ extends Value {
134 public V3<V4<Float>> _0;
135 public VM43F_() { tag = Value.Tag.VM43F; }
136 }
137 public class VM44F_ extends Value {
138 public V4<V4<Float>> _0;
139 public VM44F_() { tag = Value.Tag.VM44F; }
140 }
141}
142
diff --git a/ddl/out/java/LambdaCube/Mesh/JSON.java b/ddl/out/java/LambdaCube/Mesh/JSON.java
new file mode 100644
index 0000000..db0641e
--- /dev/null
+++ b/ddl/out/java/LambdaCube/Mesh/JSON.java
@@ -0,0 +1,206 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.391032000000Z
3
4package LambdaCube.Mesh;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import org.json.*;
9import RT.*;
10
11
12public class JSON {
13 // JSON deserializer
14 public enum Type {
15 Int32,
16 Word32,
17 Float,
18 String,
19 V2_Float,
20 V2_V2_Float,
21 V3_Float,
22 V3_V3_Float,
23 V4_Float,
24 V4_V4_Float,
25 Array_Int32,
26 Array_Word32,
27 Array_Float,
28 Array_V2_Float,
29 Array_V2_V2_Float,
30 Array_V3_Float,
31 Array_V3_V3_Float,
32 Array_V4_Float,
33 Array_V4_V4_Float,
34 Map_String_MeshAttribute,
35 Mesh,
36 MeshAttribute,
37 MeshPrimitive
38 }
39
40 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
41 switch (type) {
42 case Int32: return (Integer)rawObj;
43 case Word32: return (Integer)rawObj;
44 case Float: return (Float)rawObj;
45 case String: return (String)rawObj;
46 case V2_Float: {
47 JSONObject obj = (JSONObject)rawObj;
48 return new V2<Float>
49 ( (Float)fromJSON(Type.Float,obj.get("x"))
50 , (Float)fromJSON(Type.Float,obj.get("y"))
51 );
52 }
53 case V2_V2_Float: {
54 JSONObject obj = (JSONObject)rawObj;
55 return new V2<V2<Float>>
56 ( (V2<Float>)fromJSON(Type.V2_Float,obj.get("x"))
57 , (V2<Float>)fromJSON(Type.V2_Float,obj.get("y"))
58 );
59 }
60 case V3_Float: {
61 JSONObject obj = (JSONObject)rawObj;
62 return new V3<Float>
63 ( (Float)fromJSON(Type.Float,obj.get("x"))
64 , (Float)fromJSON(Type.Float,obj.get("y"))
65 , (Float)fromJSON(Type.Float,obj.get("z"))
66 );
67 }
68 case V3_V3_Float: {
69 JSONObject obj = (JSONObject)rawObj;
70 return new V3<V3<Float>>
71 ( (V3<Float>)fromJSON(Type.V3_Float,obj.get("x"))
72 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("y"))
73 , (V3<Float>)fromJSON(Type.V3_Float,obj.get("z"))
74 );
75 }
76 case V4_Float: {
77 JSONObject obj = (JSONObject)rawObj;
78 return new V4<Float>
79 ( (Float)fromJSON(Type.Float,obj.get("x"))
80 , (Float)fromJSON(Type.Float,obj.get("y"))
81 , (Float)fromJSON(Type.Float,obj.get("z"))
82 , (Float)fromJSON(Type.Float,obj.get("w"))
83 );
84 }
85 case V4_V4_Float: {
86 JSONObject obj = (JSONObject)rawObj;
87 return new V4<V4<Float>>
88 ( (V4<Float>)fromJSON(Type.V4_Float,obj.get("x"))
89 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("y"))
90 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("z"))
91 , (V4<Float>)fromJSON(Type.V4_Float,obj.get("w"))
92 );
93 }
94// case Array_Int32: return ((JArray)obj).Select(x => fromJSON (Type.Int32, x)).ToList();
95// case Array_Word32: return ((JArray)obj).Select(x => fromJSON (Type.Word32, x)).ToList();
96// case Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
97// case Array_V2_Float: return ((JArray)obj).Select(x => fromJSON (Type.V2_Float, x)).ToList();
98// case Array_V2_V2_Float: return ((JArray)obj).Select(x => fromJSON (Type.V2_V2_Float, x)).ToList();
99// case Array_V3_Float: return ((JArray)obj).Select(x => fromJSON (Type.V3_Float, x)).ToList();
100// case Array_V3_V3_Float: return ((JArray)obj).Select(x => fromJSON (Type.V3_V3_Float, x)).ToList();
101// case Array_V4_Float: return ((JArray)obj).Select(x => fromJSON (Type.V4_Float, x)).ToList();
102// case Array_V4_V4_Float: return ((JArray)obj).Select(x => fromJSON (Type.V4_V4_Float, x)).ToList();
103/*
104 case Map_String_MeshAttribute: {
105 var map = new HashMap<String, MeshAttribute> ();
106 foreach(var i in (JSONObject)rawObj) {
107 map.Add( (String)fromJSON(Type.String,i.Key)
108 , (MeshAttribute)fromJSON(Type.MeshAttribute,i.Value));
109 }
110 return map;
111 }
112*/
113
114 case MeshAttribute: {
115 JSONObject obj = (JSONObject)rawObj;
116 String tag = obj.getString("tag");
117 switch (tag) {
118 case "A_Float": {
119 MeshAttribute.A_Float_ tv = new MeshAttribute().new A_Float_();
120 tv._0 = (ArrayList<Float>)fromJSON(Type.Array_Float,obj.get("arg0"));
121 return tv;
122 }
123 case "A_V2F": {
124 MeshAttribute.A_V2F_ tv = new MeshAttribute().new A_V2F_();
125 tv._0 = (ArrayList<V2<Float>>)fromJSON(Type.Array_V2_Float,obj.get("arg0"));
126 return tv;
127 }
128 case "A_V3F": {
129 MeshAttribute.A_V3F_ tv = new MeshAttribute().new A_V3F_();
130 tv._0 = (ArrayList<V3<Float>>)fromJSON(Type.Array_V3_Float,obj.get("arg0"));
131 return tv;
132 }
133 case "A_V4F": {
134 MeshAttribute.A_V4F_ tv = new MeshAttribute().new A_V4F_();
135 tv._0 = (ArrayList<V4<Float>>)fromJSON(Type.Array_V4_Float,obj.get("arg0"));
136 return tv;
137 }
138 case "A_M22F": {
139 MeshAttribute.A_M22F_ tv = new MeshAttribute().new A_M22F_();
140 tv._0 = (ArrayList<V2<V2<Float>>>)fromJSON(Type.Array_V2_V2_Float,obj.get("arg0"));
141 return tv;
142 }
143 case "A_M33F": {
144 MeshAttribute.A_M33F_ tv = new MeshAttribute().new A_M33F_();
145 tv._0 = (ArrayList<V3<V3<Float>>>)fromJSON(Type.Array_V3_V3_Float,obj.get("arg0"));
146 return tv;
147 }
148 case "A_M44F": {
149 MeshAttribute.A_M44F_ tv = new MeshAttribute().new A_M44F_();
150 tv._0 = (ArrayList<V4<V4<Float>>>)fromJSON(Type.Array_V4_V4_Float,obj.get("arg0"));
151 return tv;
152 }
153 case "A_Int": {
154 MeshAttribute.A_Int_ tv = new MeshAttribute().new A_Int_();
155 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Int32,obj.get("arg0"));
156 return tv;
157 }
158 case "A_Word": {
159 MeshAttribute.A_Word_ tv = new MeshAttribute().new A_Word_();
160 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Word32,obj.get("arg0"));
161 return tv;
162 }
163 default: throw new Exception("unknown constructor: " + tag);
164 }
165 }
166 case MeshPrimitive: {
167 JSONObject obj = (JSONObject)rawObj;
168 String tag = obj.getString("tag");
169 MeshPrimitive.Tag tagType;
170 switch (tag) {
171 case "P_Points": tagType = MeshPrimitive.Tag.P_Points; break;
172 case "P_TriangleStrip": tagType = MeshPrimitive.Tag.P_TriangleStrip; break;
173 case "P_Triangles": tagType = MeshPrimitive.Tag.P_Triangles; break;
174 case "P_TriangleStripI": {
175 MeshPrimitive.P_TriangleStripI_ tv = new MeshPrimitive().new P_TriangleStripI_();
176 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Int32,obj.get("arg0"));
177 return tv;
178 }
179 case "P_TrianglesI": {
180 MeshPrimitive.P_TrianglesI_ tv = new MeshPrimitive().new P_TrianglesI_();
181 tv._0 = (ArrayList<Integer>)fromJSON(Type.Array_Int32,obj.get("arg0"));
182 return tv;
183 }
184 default: throw new Exception("unknown constructor: " + tag);
185 }
186 MeshPrimitive o = new MeshPrimitive();
187 o.tag = tagType;
188 return o;
189 }
190 case Mesh: {
191 JSONObject obj = (JSONObject)rawObj;
192 String tag = obj.getString("tag");
193 switch (tag) {
194 case "Mesh": {
195 Mesh.Mesh_ tv = new Mesh().new Mesh_();
196 tv.mAttributes = (HashMap<String, MeshAttribute>)fromJSON(Type.Map_String_MeshAttribute,obj.get("mAttributes"));
197 tv.mPrimitive = (MeshPrimitive)fromJSON(Type.MeshPrimitive,obj.get("mPrimitive"));
198 return tv;
199 }
200 default: throw new Exception("unknown constructor: " + tag);
201 }
202 }
203 }
204 throw new Exception("unknown type");
205 }
206} \ No newline at end of file
diff --git a/ddl/out/java/LambdaCube/Mesh/Mesh.java b/ddl/out/java/LambdaCube/Mesh/Mesh.java
new file mode 100644
index 0000000..b708db9
--- /dev/null
+++ b/ddl/out/java/LambdaCube/Mesh/Mesh.java
@@ -0,0 +1,23 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.391032000000Z
3
4package LambdaCube.Mesh;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class Mesh {
12 public enum Tag {
13 Mesh
14 }
15 public Tag tag;
16
17 public class Mesh_ extends Mesh {
18 public HashMap<String, MeshAttribute> mAttributes;
19 public MeshPrimitive mPrimitive;
20 public Mesh_() { tag = Mesh.Tag.Mesh; }
21 }
22}
23
diff --git a/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java b/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java
new file mode 100644
index 0000000..585138c
--- /dev/null
+++ b/ddl/out/java/LambdaCube/Mesh/MeshAttribute.java
@@ -0,0 +1,62 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.391032000000Z
3
4package LambdaCube.Mesh;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class MeshAttribute {
12 public enum Tag {
13 A_Float,
14 A_V2F,
15 A_V3F,
16 A_V4F,
17 A_M22F,
18 A_M33F,
19 A_M44F,
20 A_Int,
21 A_Word
22 }
23 public Tag tag;
24
25 public class A_Float_ extends MeshAttribute {
26 public ArrayList<Float> _0;
27 public A_Float_() { tag = MeshAttribute.Tag.A_Float; }
28 }
29 public class A_V2F_ extends MeshAttribute {
30 public ArrayList<V2<Float>> _0;
31 public A_V2F_() { tag = MeshAttribute.Tag.A_V2F; }
32 }
33 public class A_V3F_ extends MeshAttribute {
34 public ArrayList<V3<Float>> _0;
35 public A_V3F_() { tag = MeshAttribute.Tag.A_V3F; }
36 }
37 public class A_V4F_ extends MeshAttribute {
38 public ArrayList<V4<Float>> _0;
39 public A_V4F_() { tag = MeshAttribute.Tag.A_V4F; }
40 }
41 public class A_M22F_ extends MeshAttribute {
42 public ArrayList<V2<V2<Float>>> _0;
43 public A_M22F_() { tag = MeshAttribute.Tag.A_M22F; }
44 }
45 public class A_M33F_ extends MeshAttribute {
46 public ArrayList<V3<V3<Float>>> _0;
47 public A_M33F_() { tag = MeshAttribute.Tag.A_M33F; }
48 }
49 public class A_M44F_ extends MeshAttribute {
50 public ArrayList<V4<V4<Float>>> _0;
51 public A_M44F_() { tag = MeshAttribute.Tag.A_M44F; }
52 }
53 public class A_Int_ extends MeshAttribute {
54 public ArrayList<Integer> _0;
55 public A_Int_() { tag = MeshAttribute.Tag.A_Int; }
56 }
57 public class A_Word_ extends MeshAttribute {
58 public ArrayList<Integer> _0;
59 public A_Word_() { tag = MeshAttribute.Tag.A_Word; }
60 }
61}
62
diff --git a/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java b/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java
new file mode 100644
index 0000000..8fd3b52
--- /dev/null
+++ b/ddl/out/java/LambdaCube/Mesh/MeshPrimitive.java
@@ -0,0 +1,30 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.391032000000Z
3
4package LambdaCube.Mesh;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10
11public class MeshPrimitive {
12 public enum Tag {
13 P_Points,
14 P_TriangleStrip,
15 P_Triangles,
16 P_TriangleStripI,
17 P_TrianglesI
18 }
19 public Tag tag;
20
21 public class P_TriangleStripI_ extends MeshPrimitive {
22 public ArrayList<Integer> _0;
23 public P_TriangleStripI_() { tag = MeshPrimitive.Tag.P_TriangleStripI; }
24 }
25 public class P_TrianglesI_ extends MeshPrimitive {
26 public ArrayList<Integer> _0;
27 public P_TrianglesI_() { tag = MeshPrimitive.Tag.P_TrianglesI; }
28 }
29}
30
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/JSON.java b/ddl/out/java/LambdaCube/PipelineSchema/JSON.java
new file mode 100644
index 0000000..4303a7f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/PipelineSchema/JSON.java
@@ -0,0 +1,122 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4package LambdaCube.PipelineSchema;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import org.json.*;
9import RT.*;
10
11import LambdaCube.IR.*;
12
13public class JSON {
14 // JSON deserializer
15 public enum Type {
16 String,
17 Map_String_InputType,
18 Map_String_ObjectArraySchema,
19 Map_String_StreamType,
20 FetchPrimitive,
21 InputType,
22 ObjectArraySchema,
23 PipelineSchema,
24 StreamType
25 }
26
27 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
28 switch (type) {
29 case String: return (String)rawObj;
30/*
31 case Map_String_InputType: {
32 var map = new HashMap<String, InputType> ();
33 foreach(var i in (JSONObject)rawObj) {
34 map.Add( (String)fromJSON(Type.String,i.Key)
35 , (InputType)fromJSON(Type.InputType,i.Value));
36 }
37 return map;
38 }
39*/
40/*
41 case Map_String_ObjectArraySchema: {
42 var map = new HashMap<String, ObjectArraySchema> ();
43 foreach(var i in (JSONObject)rawObj) {
44 map.Add( (String)fromJSON(Type.String,i.Key)
45 , (ObjectArraySchema)fromJSON(Type.ObjectArraySchema,i.Value));
46 }
47 return map;
48 }
49*/
50/*
51 case Map_String_StreamType: {
52 var map = new HashMap<String, StreamType> ();
53 foreach(var i in (JSONObject)rawObj) {
54 map.Add( (String)fromJSON(Type.String,i.Key)
55 , (StreamType)fromJSON(Type.StreamType,i.Value));
56 }
57 return map;
58 }
59*/
60
61 case StreamType: {
62 JSONObject obj = (JSONObject)rawObj;
63 String tag = obj.getString("tag");
64 StreamType.Tag tagType;
65 switch (tag) {
66 case "Attribute_Word": tagType = StreamType.Tag.Attribute_Word; break;
67 case "Attribute_V2U": tagType = StreamType.Tag.Attribute_V2U; break;
68 case "Attribute_V3U": tagType = StreamType.Tag.Attribute_V3U; break;
69 case "Attribute_V4U": tagType = StreamType.Tag.Attribute_V4U; break;
70 case "Attribute_Int": tagType = StreamType.Tag.Attribute_Int; break;
71 case "Attribute_V2I": tagType = StreamType.Tag.Attribute_V2I; break;
72 case "Attribute_V3I": tagType = StreamType.Tag.Attribute_V3I; break;
73 case "Attribute_V4I": tagType = StreamType.Tag.Attribute_V4I; break;
74 case "Attribute_Float": tagType = StreamType.Tag.Attribute_Float; break;
75 case "Attribute_V2F": tagType = StreamType.Tag.Attribute_V2F; break;
76 case "Attribute_V3F": tagType = StreamType.Tag.Attribute_V3F; break;
77 case "Attribute_V4F": tagType = StreamType.Tag.Attribute_V4F; break;
78 case "Attribute_M22F": tagType = StreamType.Tag.Attribute_M22F; break;
79 case "Attribute_M23F": tagType = StreamType.Tag.Attribute_M23F; break;
80 case "Attribute_M24F": tagType = StreamType.Tag.Attribute_M24F; break;
81 case "Attribute_M32F": tagType = StreamType.Tag.Attribute_M32F; break;
82 case "Attribute_M33F": tagType = StreamType.Tag.Attribute_M33F; break;
83 case "Attribute_M34F": tagType = StreamType.Tag.Attribute_M34F; break;
84 case "Attribute_M42F": tagType = StreamType.Tag.Attribute_M42F; break;
85 case "Attribute_M43F": tagType = StreamType.Tag.Attribute_M43F; break;
86 case "Attribute_M44F": tagType = StreamType.Tag.Attribute_M44F; break;
87 default: throw new Exception("unknown constructor: " + tag);
88 }
89 StreamType o = new StreamType();
90 o.tag = tagType;
91 return o;
92 }
93 case ObjectArraySchema: {
94 JSONObject obj = (JSONObject)rawObj;
95 String tag = obj.getString("tag");
96 switch (tag) {
97 case "ObjectArraySchema": {
98 ObjectArraySchema.ObjectArraySchema_ tv = new ObjectArraySchema().new ObjectArraySchema_();
99 tv.primitive = (FetchPrimitive)fromJSON(Type.FetchPrimitive,obj.get("primitive"));
100 tv.attributes = (HashMap<String, StreamType>)fromJSON(Type.Map_String_StreamType,obj.get("attributes"));
101 return tv;
102 }
103 default: throw new Exception("unknown constructor: " + tag);
104 }
105 }
106 case PipelineSchema: {
107 JSONObject obj = (JSONObject)rawObj;
108 String tag = obj.getString("tag");
109 switch (tag) {
110 case "PipelineSchema": {
111 PipelineSchema.PipelineSchema_ tv = new PipelineSchema().new PipelineSchema_();
112 tv.objectArrays = (HashMap<String, ObjectArraySchema>)fromJSON(Type.Map_String_ObjectArraySchema,obj.get("objectArrays"));
113 tv.uniforms = (HashMap<String, InputType>)fromJSON(Type.Map_String_InputType,obj.get("uniforms"));
114 return tv;
115 }
116 default: throw new Exception("unknown constructor: " + tag);
117 }
118 }
119 }
120 throw new Exception("unknown type");
121 }
122} \ No newline at end of file
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java b/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java
new file mode 100644
index 0000000..ffbcf56
--- /dev/null
+++ b/ddl/out/java/LambdaCube/PipelineSchema/ObjectArraySchema.java
@@ -0,0 +1,24 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4package LambdaCube.PipelineSchema;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class ObjectArraySchema {
13 public enum Tag {
14 ObjectArraySchema
15 }
16 public Tag tag;
17
18 public class ObjectArraySchema_ extends ObjectArraySchema {
19 public FetchPrimitive primitive;
20 public HashMap<String, StreamType> attributes;
21 public ObjectArraySchema_() { tag = ObjectArraySchema.Tag.ObjectArraySchema; }
22 }
23}
24
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java b/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java
new file mode 100644
index 0000000..a2f22ac
--- /dev/null
+++ b/ddl/out/java/LambdaCube/PipelineSchema/PipelineSchema.java
@@ -0,0 +1,24 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4package LambdaCube.PipelineSchema;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class PipelineSchema {
13 public enum Tag {
14 PipelineSchema
15 }
16 public Tag tag;
17
18 public class PipelineSchema_ extends PipelineSchema {
19 public HashMap<String, ObjectArraySchema> objectArrays;
20 public HashMap<String, InputType> uniforms;
21 public PipelineSchema_() { tag = PipelineSchema.Tag.PipelineSchema; }
22 }
23}
24
diff --git a/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java b/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java
new file mode 100644
index 0000000..75af8d5
--- /dev/null
+++ b/ddl/out/java/LambdaCube/PipelineSchema/StreamType.java
@@ -0,0 +1,39 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.343859000000Z
3
4package LambdaCube.PipelineSchema;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class StreamType {
13 public enum Tag {
14 Attribute_Word,
15 Attribute_V2U,
16 Attribute_V3U,
17 Attribute_V4U,
18 Attribute_Int,
19 Attribute_V2I,
20 Attribute_V3I,
21 Attribute_V4I,
22 Attribute_Float,
23 Attribute_V2F,
24 Attribute_V3F,
25 Attribute_V4F,
26 Attribute_M22F,
27 Attribute_M23F,
28 Attribute_M24F,
29 Attribute_M32F,
30 Attribute_M33F,
31 Attribute_M34F,
32 Attribute_M42F,
33 Attribute_M43F,
34 Attribute_M44F
35 }
36 public Tag tag;
37
38}
39
diff --git a/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java b/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java
new file mode 100644
index 0000000..340d92e
--- /dev/null
+++ b/ddl/out/java/LambdaCube/TypeInfo/CompileResult.java
@@ -0,0 +1,32 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.460562000000Z
3
4package LambdaCube.TypeInfo;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class CompileResult {
13 public enum Tag {
14 CompileError,
15 Compiled
16 }
17 public Tag tag;
18
19 public class CompileError_ extends CompileResult {
20 public ArrayList<Range> _0;
21 public String _1;
22 public ArrayList<TypeInfo> _2;
23 public CompileError_() { tag = CompileResult.Tag.CompileError; }
24 }
25 public class Compiled_ extends CompileResult {
26 public String _0;
27 public Pipeline _1;
28 public ArrayList<TypeInfo> _2;
29 public Compiled_() { tag = CompileResult.Tag.Compiled; }
30 }
31}
32
diff --git a/ddl/out/java/LambdaCube/TypeInfo/JSON.java b/ddl/out/java/LambdaCube/TypeInfo/JSON.java
new file mode 100644
index 0000000..410ce3f
--- /dev/null
+++ b/ddl/out/java/LambdaCube/TypeInfo/JSON.java
@@ -0,0 +1,85 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.460562000000Z
3
4package LambdaCube.TypeInfo;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import org.json.*;
9import RT.*;
10
11import LambdaCube.IR.*;
12
13public class JSON {
14 // JSON deserializer
15 public enum Type {
16 Int,
17 String,
18 Array_Range,
19 Array_TypeInfo,
20 CompileResult,
21 Pipeline,
22 Range,
23 TypeInfo
24 }
25
26 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
27 switch (type) {
28 case Int: return (Integer)rawObj;
29 case String: return (String)rawObj;
30// case Array_Range: return ((JArray)obj).Select(x => fromJSON (Type.Range, x)).ToList();
31// case Array_TypeInfo: return ((JArray)obj).Select(x => fromJSON (Type.TypeInfo, x)).ToList();
32
33 case Range: {
34 JSONObject obj = (JSONObject)rawObj;
35 String tag = obj.getString("tag");
36 switch (tag) {
37 case "Range": {
38 Range.Range_ tv = new Range().new Range_();
39 tv.startLine = (Integer)fromJSON(Type.Int,obj.get("startLine"));
40 tv.startColumn = (Integer)fromJSON(Type.Int,obj.get("startColumn"));
41 tv.endLine = (Integer)fromJSON(Type.Int,obj.get("endLine"));
42 tv.endColumn = (Integer)fromJSON(Type.Int,obj.get("endColumn"));
43 return tv;
44 }
45 default: throw new Exception("unknown constructor: " + tag);
46 }
47 }
48 case TypeInfo: {
49 JSONObject obj = (JSONObject)rawObj;
50 String tag = obj.getString("tag");
51 switch (tag) {
52 case "TypeInfo": {
53 TypeInfo.TypeInfo_ tv = new TypeInfo().new TypeInfo_();
54 tv.range = (Range)fromJSON(Type.Range,obj.get("range"));
55 tv.text = (String)fromJSON(Type.String,obj.get("text"));
56 return tv;
57 }
58 default: throw new Exception("unknown constructor: " + tag);
59 }
60 }
61 case CompileResult: {
62 JSONObject obj = (JSONObject)rawObj;
63 String tag = obj.getString("tag");
64 switch (tag) {
65 case "CompileError": {
66 CompileResult.CompileError_ tv = new CompileResult().new CompileError_();
67 tv._0 = (ArrayList<Range>)fromJSON(Type.Array_Range,obj.get("arg0"));
68 tv._1 = (String)fromJSON(Type.String,obj.get("arg1"));
69 tv._2 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg2"));
70 return tv;
71 }
72 case "Compiled": {
73 CompileResult.Compiled_ tv = new CompileResult().new Compiled_();
74 tv._0 = (String)fromJSON(Type.String,obj.get("arg0"));
75 tv._1 = (Pipeline)fromJSON(Type.Pipeline,obj.get("arg1"));
76 tv._2 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg2"));
77 return tv;
78 }
79 default: throw new Exception("unknown constructor: " + tag);
80 }
81 }
82 }
83 throw new Exception("unknown type");
84 }
85} \ No newline at end of file
diff --git a/ddl/out/java/LambdaCube/TypeInfo/Range.java b/ddl/out/java/LambdaCube/TypeInfo/Range.java
new file mode 100644
index 0000000..8bb89d4
--- /dev/null
+++ b/ddl/out/java/LambdaCube/TypeInfo/Range.java
@@ -0,0 +1,26 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.460562000000Z
3
4package LambdaCube.TypeInfo;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class Range {
13 public enum Tag {
14 Range
15 }
16 public Tag tag;
17
18 public class Range_ extends Range {
19 public Integer startLine;
20 public Integer startColumn;
21 public Integer endLine;
22 public Integer endColumn;
23 public Range_() { tag = Range.Tag.Range; }
24 }
25}
26
diff --git a/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java b/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java
new file mode 100644
index 0000000..a134fdb
--- /dev/null
+++ b/ddl/out/java/LambdaCube/TypeInfo/TypeInfo.java
@@ -0,0 +1,24 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.460562000000Z
3
4package LambdaCube.TypeInfo;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11
12public class TypeInfo {
13 public enum Tag {
14 TypeInfo
15 }
16 public Tag tag;
17
18 public class TypeInfo_ extends TypeInfo {
19 public Range range;
20 public String text;
21 public TypeInfo_() { tag = TypeInfo.Tag.TypeInfo; }
22 }
23}
24
diff --git a/ddl/out/java/TestData/ClientInfo.java b/ddl/out/java/TestData/ClientInfo.java
new file mode 100644
index 0000000..667c957
--- /dev/null
+++ b/ddl/out/java/TestData/ClientInfo.java
@@ -0,0 +1,26 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class ClientInfo {
15 public enum Tag {
16 ClientInfo
17 }
18 public Tag tag;
19
20 public class ClientInfo_ extends ClientInfo {
21 public String clientName;
22 public Backend clientBackend;
23 public ClientInfo_() { tag = ClientInfo.Tag.ClientInfo; }
24 }
25}
26
diff --git a/ddl/out/java/TestData/Frame.java b/ddl/out/java/TestData/Frame.java
new file mode 100644
index 0000000..39db4a4
--- /dev/null
+++ b/ddl/out/java/TestData/Frame.java
@@ -0,0 +1,27 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class Frame {
15 public enum Tag {
16 Frame
17 }
18 public Tag tag;
19
20 public class Frame_ extends Frame {
21 public Integer renderCount;
22 public HashMap<String, Value> frameUniforms;
23 public HashMap<String, Integer> frameTextures;
24 public Frame_() { tag = Frame.Tag.Frame; }
25 }
26}
27
diff --git a/ddl/out/java/TestData/FrameResult.java b/ddl/out/java/TestData/FrameResult.java
new file mode 100644
index 0000000..e1e51db
--- /dev/null
+++ b/ddl/out/java/TestData/FrameResult.java
@@ -0,0 +1,27 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class FrameResult {
15 public enum Tag {
16 FrameResult
17 }
18 public Tag tag;
19
20 public class FrameResult_ extends FrameResult {
21 public ArrayList<Float> frRenderTimes;
22 public Integer frImageWidth;
23 public Integer frImageHeight;
24 public FrameResult_() { tag = FrameResult.Tag.FrameResult; }
25 }
26}
27
diff --git a/ddl/out/java/TestData/JSON.java b/ddl/out/java/TestData/JSON.java
new file mode 100644
index 0000000..4fbe47e
--- /dev/null
+++ b/ddl/out/java/TestData/JSON.java
@@ -0,0 +1,193 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import org.json.*;
9import RT.*;
10
11import LambdaCube.IR.*;
12import LambdaCube.Mesh.*;
13import LambdaCube.PipelineSchema.*;
14
15public class JSON {
16 // JSON deserializer
17 public enum Type {
18 Int,
19 Float,
20 String,
21 Array_Int,
22 Array_Float,
23 Array_String,
24 Array_Frame,
25 Array_Mesh,
26 Array_PipelineInfo,
27 Array_Scene,
28 Map_String_Int,
29 Map_String_Array_Int,
30 Map_String_Value,
31 Backend,
32 ClientInfo,
33 Frame,
34 FrameResult,
35 Mesh,
36 Pipeline,
37 PipelineInfo,
38 PipelineSchema,
39 RenderJob,
40 RenderJobResult,
41 Scene,
42 Value
43 }
44
45 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
46 switch (type) {
47 case Int: return (Integer)rawObj;
48 case Float: return (Float)rawObj;
49 case String: return (String)rawObj;
50// case Array_Int: return ((JArray)obj).Select(x => fromJSON (Type.Int, x)).ToList();
51// case Array_Float: return ((JArray)obj).Select(x => fromJSON (Type.Float, x)).ToList();
52// case Array_String: return ((JArray)obj).Select(x => fromJSON (Type.String, x)).ToList();
53// case Array_Frame: return ((JArray)obj).Select(x => fromJSON (Type.Frame, x)).ToList();
54// case Array_Mesh: return ((JArray)obj).Select(x => fromJSON (Type.Mesh, x)).ToList();
55// case Array_PipelineInfo: return ((JArray)obj).Select(x => fromJSON (Type.PipelineInfo, x)).ToList();
56// case Array_Scene: return ((JArray)obj).Select(x => fromJSON (Type.Scene, x)).ToList();
57/*
58 case Map_String_Int: {
59 var map = new HashMap<String, Integer> ();
60 foreach(var i in (JSONObject)rawObj) {
61 map.Add( (String)fromJSON(Type.String,i.Key)
62 , (Integer)fromJSON(Type.Int,i.Value));
63 }
64 return map;
65 }
66*/
67/*
68 case Map_String_Array_Int: {
69 var map = new HashMap<String, ArrayList<Integer>> ();
70 foreach(var i in (JSONObject)rawObj) {
71 map.Add( (String)fromJSON(Type.String,i.Key)
72 , (ArrayList<Integer>)fromJSON(Type.Array_Int,i.Value));
73 }
74 return map;
75 }
76*/
77/*
78 case Map_String_Value: {
79 var map = new HashMap<String, Value> ();
80 foreach(var i in (JSONObject)rawObj) {
81 map.Add( (String)fromJSON(Type.String,i.Key)
82 , (Value)fromJSON(Type.Value,i.Value));
83 }
84 return map;
85 }
86*/
87
88 case ClientInfo: {
89 JSONObject obj = (JSONObject)rawObj;
90 String tag = obj.getString("tag");
91 switch (tag) {
92 case "ClientInfo": {
93 ClientInfo.ClientInfo_ tv = new ClientInfo().new ClientInfo_();
94 tv.clientName = (String)fromJSON(Type.String,obj.get("clientName"));
95 tv.clientBackend = (Backend)fromJSON(Type.Backend,obj.get("clientBackend"));
96 return tv;
97 }
98 default: throw new Exception("unknown constructor: " + tag);
99 }
100 }
101 case Frame: {
102 JSONObject obj = (JSONObject)rawObj;
103 String tag = obj.getString("tag");
104 switch (tag) {
105 case "Frame": {
106 Frame.Frame_ tv = new Frame().new Frame_();
107 tv.renderCount = (Integer)fromJSON(Type.Int,obj.get("renderCount"));
108 tv.frameUniforms = (HashMap<String, Value>)fromJSON(Type.Map_String_Value,obj.get("frameUniforms"));
109 tv.frameTextures = (HashMap<String, Integer>)fromJSON(Type.Map_String_Int,obj.get("frameTextures"));
110 return tv;
111 }
112 default: throw new Exception("unknown constructor: " + tag);
113 }
114 }
115 case Scene: {
116 JSONObject obj = (JSONObject)rawObj;
117 String tag = obj.getString("tag");
118 switch (tag) {
119 case "Scene": {
120 Scene.Scene_ tv = new Scene().new Scene_();
121 tv.objectArrays = (HashMap<String, ArrayList<Integer>>)fromJSON(Type.Map_String_Array_Int,obj.get("objectArrays"));
122 tv.renderTargetWidth = (Integer)fromJSON(Type.Int,obj.get("renderTargetWidth"));
123 tv.renderTargetHeight = (Integer)fromJSON(Type.Int,obj.get("renderTargetHeight"));
124 tv.frames = (ArrayList<Frame>)fromJSON(Type.Array_Frame,obj.get("frames"));
125 return tv;
126 }
127 default: throw new Exception("unknown constructor: " + tag);
128 }
129 }
130 case PipelineInfo: {
131 JSONObject obj = (JSONObject)rawObj;
132 String tag = obj.getString("tag");
133 switch (tag) {
134 case "PipelineInfo": {
135 PipelineInfo.PipelineInfo_ tv = new PipelineInfo().new PipelineInfo_();
136 tv.pipelineName = (String)fromJSON(Type.String,obj.get("pipelineName"));
137 tv.pipeline = (Pipeline)fromJSON(Type.Pipeline,obj.get("pipeline"));
138 return tv;
139 }
140 default: throw new Exception("unknown constructor: " + tag);
141 }
142 }
143 case RenderJob: {
144 JSONObject obj = (JSONObject)rawObj;
145 String tag = obj.getString("tag");
146 switch (tag) {
147 case "RenderJob": {
148 RenderJob.RenderJob_ tv = new RenderJob().new RenderJob_();
149 tv.meshes = (ArrayList<Mesh>)fromJSON(Type.Array_Mesh,obj.get("meshes"));
150 tv.textures = (ArrayList<String>)fromJSON(Type.Array_String,obj.get("textures"));
151 tv.schema = (PipelineSchema)fromJSON(Type.PipelineSchema,obj.get("schema"));
152 tv.scenes = (ArrayList<Scene>)fromJSON(Type.Array_Scene,obj.get("scenes"));
153 tv.pipelines = (ArrayList<PipelineInfo>)fromJSON(Type.Array_PipelineInfo,obj.get("pipelines"));
154 return tv;
155 }
156 default: throw new Exception("unknown constructor: " + tag);
157 }
158 }
159 case FrameResult: {
160 JSONObject obj = (JSONObject)rawObj;
161 String tag = obj.getString("tag");
162 switch (tag) {
163 case "FrameResult": {
164 FrameResult.FrameResult_ tv = new FrameResult().new FrameResult_();
165 tv.frRenderTimes = (ArrayList<Float>)fromJSON(Type.Array_Float,obj.get("frRenderTimes"));
166 tv.frImageWidth = (Integer)fromJSON(Type.Int,obj.get("frImageWidth"));
167 tv.frImageHeight = (Integer)fromJSON(Type.Int,obj.get("frImageHeight"));
168 return tv;
169 }
170 default: throw new Exception("unknown constructor: " + tag);
171 }
172 }
173 case RenderJobResult: {
174 JSONObject obj = (JSONObject)rawObj;
175 String tag = obj.getString("tag");
176 switch (tag) {
177 case "RenderJobResult": {
178 RenderJobResult.RenderJobResult_ tv = new RenderJobResult().new RenderJobResult_();
179 tv._0 = (FrameResult)fromJSON(Type.FrameResult,obj.get("arg0"));
180 return tv;
181 }
182 case "RenderJobError": {
183 RenderJobResult.RenderJobError_ tv = new RenderJobResult().new RenderJobError_();
184 tv._0 = (String)fromJSON(Type.String,obj.get("arg0"));
185 return tv;
186 }
187 default: throw new Exception("unknown constructor: " + tag);
188 }
189 }
190 }
191 throw new Exception("unknown type");
192 }
193} \ No newline at end of file
diff --git a/ddl/out/java/TestData/PipelineInfo.java b/ddl/out/java/TestData/PipelineInfo.java
new file mode 100644
index 0000000..6171080
--- /dev/null
+++ b/ddl/out/java/TestData/PipelineInfo.java
@@ -0,0 +1,26 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class PipelineInfo {
15 public enum Tag {
16 PipelineInfo
17 }
18 public Tag tag;
19
20 public class PipelineInfo_ extends PipelineInfo {
21 public String pipelineName;
22 public Pipeline pipeline;
23 public PipelineInfo_() { tag = PipelineInfo.Tag.PipelineInfo; }
24 }
25}
26
diff --git a/ddl/out/java/TestData/RenderJob.java b/ddl/out/java/TestData/RenderJob.java
new file mode 100644
index 0000000..523cf47
--- /dev/null
+++ b/ddl/out/java/TestData/RenderJob.java
@@ -0,0 +1,29 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class RenderJob {
15 public enum Tag {
16 RenderJob
17 }
18 public Tag tag;
19
20 public class RenderJob_ extends RenderJob {
21 public ArrayList<Mesh> meshes;
22 public ArrayList<String> textures;
23 public PipelineSchema schema;
24 public ArrayList<Scene> scenes;
25 public ArrayList<PipelineInfo> pipelines;
26 public RenderJob_() { tag = RenderJob.Tag.RenderJob; }
27 }
28}
29
diff --git a/ddl/out/java/TestData/RenderJobResult.java b/ddl/out/java/TestData/RenderJobResult.java
new file mode 100644
index 0000000..8a55fca
--- /dev/null
+++ b/ddl/out/java/TestData/RenderJobResult.java
@@ -0,0 +1,30 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class RenderJobResult {
15 public enum Tag {
16 RenderJobResult,
17 RenderJobError
18 }
19 public Tag tag;
20
21 public class RenderJobResult_ extends RenderJobResult {
22 public FrameResult _0;
23 public RenderJobResult_() { tag = RenderJobResult.Tag.RenderJobResult; }
24 }
25 public class RenderJobError_ extends RenderJobResult {
26 public String _0;
27 public RenderJobError_() { tag = RenderJobResult.Tag.RenderJobError; }
28 }
29}
30
diff --git a/ddl/out/java/TestData/Scene.java b/ddl/out/java/TestData/Scene.java
new file mode 100644
index 0000000..ef60dde
--- /dev/null
+++ b/ddl/out/java/TestData/Scene.java
@@ -0,0 +1,28 @@
1// generated file, do not modify!
2// 2016-03-21T11:41:52.508392000000Z
3
4package TestData;
5
6import java.util.ArrayList;
7import java.util.HashMap;
8import RT.*;
9
10import LambdaCube.IR.*;
11import LambdaCube.Mesh.*;
12import LambdaCube.PipelineSchema.*;
13
14public class Scene {
15 public enum Tag {
16 Scene
17 }
18 public Tag tag;
19
20 public class Scene_ extends Scene {
21 public HashMap<String, ArrayList<Integer>> objectArrays;
22 public Integer renderTargetWidth;
23 public Integer renderTargetHeight;
24 public ArrayList<Frame> frames;
25 public Scene_() { tag = Scene.Tag.Scene; }
26 }
27}
28