diff options
Diffstat (limited to 'src/LambdaCube/GL/Type.hs')
-rw-r--r-- | src/LambdaCube/GL/Type.hs | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/src/LambdaCube/GL/Type.hs b/src/LambdaCube/GL/Type.hs index 8f4bdd7..376fdf1 100644 --- a/src/LambdaCube/GL/Type.hs +++ b/src/LambdaCube/GL/Type.hs | |||
@@ -14,8 +14,9 @@ import Data.ByteString | |||
14 | 14 | ||
15 | import Graphics.GL.Core33 | 15 | import Graphics.GL.Core33 |
16 | 16 | ||
17 | import Linear | 17 | import LambdaCube.Linear |
18 | import IR | 18 | import LambdaCube.IR |
19 | import LambdaCube.PipelineSchema | ||
19 | 20 | ||
20 | type GLUniformName = ByteString | 21 | type GLUniformName = ByteString |
21 | 22 | ||
@@ -66,21 +67,6 @@ data ArrayDesc | |||
66 | - independent from pipeline | 67 | - independent from pipeline |
67 | - per object features: enable/disable visibility, set render ordering | 68 | - per object features: enable/disable visibility, set render ordering |
68 | -} | 69 | -} |
69 | |||
70 | data ObjectArraySchema | ||
71 | = ObjectArraySchema | ||
72 | { primitive :: FetchPrimitive | ||
73 | , attributes :: Map String StreamType | ||
74 | } | ||
75 | deriving Show | ||
76 | |||
77 | data PipelineSchema | ||
78 | = PipelineSchema | ||
79 | { objectArrays :: Map String ObjectArraySchema | ||
80 | , uniforms :: Map String InputType | ||
81 | } | ||
82 | deriving Show | ||
83 | |||
84 | data GLUniform = forall a. Storable a => GLUniform !InputType !(IORef a) | 70 | data GLUniform = forall a. Storable a => GLUniform !InputType !(IORef a) |
85 | 71 | ||
86 | instance Show GLUniform where | 72 | instance Show GLUniform where |
@@ -322,33 +308,6 @@ sizeOfArrayType ArrHalf = 2 | |||
322 | data Array -- array type, element count (NOT byte size!), setter | 308 | data Array -- array type, element count (NOT byte size!), setter |
323 | = Array ArrayType Int BufferSetter | 309 | = Array ArrayType Int BufferSetter |
324 | 310 | ||
325 | -- dev hint: this should be InputType | ||
326 | -- we restrict StreamType using type class | ||
327 | -- subset of InputType, describes a stream type (in GPU side) | ||
328 | data StreamType | ||
329 | = Attribute_Word | ||
330 | | Attribute_V2U | ||
331 | | Attribute_V3U | ||
332 | | Attribute_V4U | ||
333 | | Attribute_Int | ||
334 | | Attribute_V2I | ||
335 | | Attribute_V3I | ||
336 | | Attribute_V4I | ||
337 | | Attribute_Float | ||
338 | | Attribute_V2F | ||
339 | | Attribute_V3F | ||
340 | | Attribute_V4F | ||
341 | | Attribute_M22F | ||
342 | | Attribute_M23F | ||
343 | | Attribute_M24F | ||
344 | | Attribute_M32F | ||
345 | | Attribute_M33F | ||
346 | | Attribute_M34F | ||
347 | | Attribute_M42F | ||
348 | | Attribute_M43F | ||
349 | | Attribute_M44F | ||
350 | deriving (Show,Eq,Ord) | ||
351 | |||
352 | toStreamType :: InputType -> Maybe StreamType | 311 | toStreamType :: InputType -> Maybe StreamType |
353 | toStreamType Word = Just Attribute_Word | 312 | toStreamType Word = Just Attribute_Word |
354 | toStreamType V2U = Just Attribute_V2U | 313 | toStreamType V2U = Just Attribute_V2U |