summaryrefslogtreecommitdiff
path: root/ddl/out/LambdaCube.PipelineSchema.purs
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/LambdaCube.PipelineSchema.purs')
-rw-r--r--ddl/out/LambdaCube.PipelineSchema.purs152
1 files changed, 152 insertions, 0 deletions
diff --git a/ddl/out/LambdaCube.PipelineSchema.purs b/ddl/out/LambdaCube.PipelineSchema.purs
new file mode 100644
index 0000000..077d1e9
--- /dev/null
+++ b/ddl/out/LambdaCube.PipelineSchema.purs
@@ -0,0 +1,152 @@
1-- generated file, do not modify!
2-- 2016-01-28T13:15:31.196716Z
3
4module LambdaCube.PipelineSchema where
5import Prelude
6import Data.Generic
7import Data.Maybe (Maybe(..))
8import Data.StrMap (StrMap(..))
9import Data.Map (Map(..))
10import Data.List (List(..))
11import Linear
12
13import Data.Argonaut.Combinators ((~>), (:=), (.?))
14import Data.Argonaut.Core (jsonEmptyObject)
15import Data.Argonaut.Printer (printJson)
16import Data.Argonaut.Encode (EncodeJson, encodeJson)
17import Data.Argonaut.Decode (DecodeJson, decodeJson)
18
19import LambdaCube.IR
20
21data StreamType
22 = Attribute_Word
23 | Attribute_V2U
24 | Attribute_V3U
25 | Attribute_V4U
26 | Attribute_Int
27 | Attribute_V2I
28 | Attribute_V3I
29 | Attribute_V4I
30 | Attribute_Float
31 | Attribute_V2F
32 | Attribute_V3F
33 | Attribute_V4F
34 | Attribute_M22F
35 | Attribute_M23F
36 | Attribute_M24F
37 | Attribute_M32F
38 | Attribute_M33F
39 | Attribute_M34F
40 | Attribute_M42F
41 | Attribute_M43F
42 | Attribute_M44F
43
44data ObjectArraySchema
45 = ObjectArraySchema
46 { primitive :: FetchPrimitive
47 , attributes :: StrMap StreamType
48 }
49
50
51data PipelineSchema
52 = PipelineSchema
53 { objectArrays :: StrMap ObjectArraySchema
54 , uniforms :: StrMap InputType
55 }
56
57
58
59
60instance encodeJsonStreamType :: EncodeJson StreamType where
61 encodeJson v = case v of
62 Attribute_Word -> "tag" := "Attribute_Word" ~> jsonEmptyObject
63 Attribute_V2U -> "tag" := "Attribute_V2U" ~> jsonEmptyObject
64 Attribute_V3U -> "tag" := "Attribute_V3U" ~> jsonEmptyObject
65 Attribute_V4U -> "tag" := "Attribute_V4U" ~> jsonEmptyObject
66 Attribute_Int -> "tag" := "Attribute_Int" ~> jsonEmptyObject
67 Attribute_V2I -> "tag" := "Attribute_V2I" ~> jsonEmptyObject
68 Attribute_V3I -> "tag" := "Attribute_V3I" ~> jsonEmptyObject
69 Attribute_V4I -> "tag" := "Attribute_V4I" ~> jsonEmptyObject
70 Attribute_Float -> "tag" := "Attribute_Float" ~> jsonEmptyObject
71 Attribute_V2F -> "tag" := "Attribute_V2F" ~> jsonEmptyObject
72 Attribute_V3F -> "tag" := "Attribute_V3F" ~> jsonEmptyObject
73 Attribute_V4F -> "tag" := "Attribute_V4F" ~> jsonEmptyObject
74 Attribute_M22F -> "tag" := "Attribute_M22F" ~> jsonEmptyObject
75 Attribute_M23F -> "tag" := "Attribute_M23F" ~> jsonEmptyObject
76 Attribute_M24F -> "tag" := "Attribute_M24F" ~> jsonEmptyObject
77 Attribute_M32F -> "tag" := "Attribute_M32F" ~> jsonEmptyObject
78 Attribute_M33F -> "tag" := "Attribute_M33F" ~> jsonEmptyObject
79 Attribute_M34F -> "tag" := "Attribute_M34F" ~> jsonEmptyObject
80 Attribute_M42F -> "tag" := "Attribute_M42F" ~> jsonEmptyObject
81 Attribute_M43F -> "tag" := "Attribute_M43F" ~> jsonEmptyObject
82 Attribute_M44F -> "tag" := "Attribute_M44F" ~> jsonEmptyObject
83
84instance decodeJsonStreamType :: DecodeJson StreamType where
85 decodeJson json = do
86 obj <- decodeJson json
87 tag <- obj .? "tag"
88 case tag of
89 "Attribute_Word" -> pure Attribute_Word
90 "Attribute_V2U" -> pure Attribute_V2U
91 "Attribute_V3U" -> pure Attribute_V3U
92 "Attribute_V4U" -> pure Attribute_V4U
93 "Attribute_Int" -> pure Attribute_Int
94 "Attribute_V2I" -> pure Attribute_V2I
95 "Attribute_V3I" -> pure Attribute_V3I
96 "Attribute_V4I" -> pure Attribute_V4I
97 "Attribute_Float" -> pure Attribute_Float
98 "Attribute_V2F" -> pure Attribute_V2F
99 "Attribute_V3F" -> pure Attribute_V3F
100 "Attribute_V4F" -> pure Attribute_V4F
101 "Attribute_M22F" -> pure Attribute_M22F
102 "Attribute_M23F" -> pure Attribute_M23F
103 "Attribute_M24F" -> pure Attribute_M24F
104 "Attribute_M32F" -> pure Attribute_M32F
105 "Attribute_M33F" -> pure Attribute_M33F
106 "Attribute_M34F" -> pure Attribute_M34F
107 "Attribute_M42F" -> pure Attribute_M42F
108 "Attribute_M43F" -> pure Attribute_M43F
109 "Attribute_M44F" -> pure Attribute_M44F
110
111instance encodeJsonObjectArraySchema :: EncodeJson ObjectArraySchema where
112 encodeJson v = case v of
113 ObjectArraySchema r ->
114 "tag" := "ObjectArraySchema" ~>
115 "primitive" := r.primitive ~>
116 "attributes" := r.attributes ~>
117 jsonEmptyObject
118
119instance decodeJsonObjectArraySchema :: DecodeJson ObjectArraySchema where
120 decodeJson json = do
121 obj <- decodeJson json
122 tag <- obj .? "tag"
123 case tag of
124 "ObjectArraySchema" -> do
125 primitive <- obj .? "primitive"
126 attributes <- obj .? "attributes"
127 pure $ ObjectArraySchema
128 { primitive:primitive
129 , attributes:attributes
130 }
131
132instance encodeJsonPipelineSchema :: EncodeJson PipelineSchema where
133 encodeJson v = case v of
134 PipelineSchema r ->
135 "tag" := "PipelineSchema" ~>
136 "objectArrays" := r.objectArrays ~>
137 "uniforms" := r.uniforms ~>
138 jsonEmptyObject
139
140instance decodeJsonPipelineSchema :: DecodeJson PipelineSchema where
141 decodeJson json = do
142 obj <- decodeJson json
143 tag <- obj .? "tag"
144 case tag of
145 "PipelineSchema" -> do
146 objectArrays <- obj .? "objectArrays"
147 uniforms <- obj .? "uniforms"
148 pure $ PipelineSchema
149 { objectArrays:objectArrays
150 , uniforms:uniforms
151 }
152