summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Input.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube/GL/Input.hs')
-rw-r--r--src/LambdaCube/GL/Input.hs164
1 files changed, 81 insertions, 83 deletions
diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs
index aabf0e6..88b2654 100644
--- a/src/LambdaCube/GL/Input.hs
+++ b/src/LambdaCube/GL/Input.hs
@@ -5,9 +5,8 @@ import Control.Exception
5import Control.Monad 5import Control.Monad
6import Data.ByteString.Char8 (ByteString,pack) 6import Data.ByteString.Char8 (ByteString,pack)
7import Data.IORef 7import Data.IORef
8import Data.Map (Map)
8import Data.IntMap (IntMap) 9import Data.IntMap (IntMap)
9import Data.Trie (Trie)
10import Data.Trie.Convenience as T
11import Data.Vector (Vector,(//),(!)) 10import Data.Vector (Vector,(//),(!))
12import Data.Word 11import Data.Word
13import Foreign 12import Foreign
@@ -15,7 +14,6 @@ import qualified Data.ByteString.Char8 as SB
15import qualified Data.IntMap as IM 14import qualified Data.IntMap as IM
16import qualified Data.Set as S 15import qualified Data.Set as S
17import qualified Data.Map as Map 16import qualified Data.Map as Map
18import qualified Data.Trie as T
19import qualified Data.Vector as V 17import qualified Data.Vector as V
20import qualified Data.Vector.Algorithms.Intro as I 18import qualified Data.Vector.Algorithms.Intro as I
21 19
@@ -29,9 +27,9 @@ import LambdaCube.GL.Util
29import qualified IR as IR 27import qualified IR as IR
30 28
31schemaFromPipeline :: IR.Pipeline -> PipelineSchema 29schemaFromPipeline :: IR.Pipeline -> PipelineSchema
32schemaFromPipeline a = PipelineSchema (T.fromList sl) (foldl T.unionL T.empty ul) 30schemaFromPipeline a = PipelineSchema (Map.fromList sl) (foldl Map.union Map.empty ul)
33 where 31 where
34 (sl,ul) = unzip [( (pack sName,SlotSchema sPrimitive (fmap cvt (toTrie sStreams))) 32 (sl,ul) = unzip [( (pack sName,ObjectArraySchema sPrimitive (fmap cvt (toTrie sStreams)))
35 , toTrie sUniforms 33 , toTrie sUniforms
36 ) 34 )
37 | IR.Slot sName sStreams sUniforms sPrimitive _ <- V.toList $ IR.slots a 35 | IR.Slot sName sStreams sUniforms sPrimitive _ <- V.toList $ IR.slots a
@@ -40,19 +38,19 @@ schemaFromPipeline a = PipelineSchema (T.fromList sl) (foldl T.unionL T.empty ul
40 Just v -> v 38 Just v -> v
41 Nothing -> error "internal error (schemaFromPipeline)" 39 Nothing -> error "internal error (schemaFromPipeline)"
42 40
43mkUniform :: [(ByteString,InputType)] -> IO (Trie InputSetter, Trie GLUniform) 41mkUniform :: [(ByteString,InputType)] -> IO (Map ByteString InputSetter, Map ByteString GLUniform)
44mkUniform l = do 42mkUniform l = do
45 unisAndSetters <- forM l $ \(n,t) -> do 43 unisAndSetters <- forM l $ \(n,t) -> do
46 (uni, setter) <- mkUniformSetter t 44 (uni, setter) <- mkUniformSetter t
47 return ((n,uni),(n,setter)) 45 return ((n,uni),(n,setter))
48 let (unis,setters) = unzip unisAndSetters 46 let (unis,setters) = unzip unisAndSetters
49 return (T.fromList setters, T.fromList unis) 47 return (Map.fromList setters, Map.fromList unis)
50 48
51allocStorage :: PipelineSchema -> IO GLStorage 49allocStorage :: PipelineSchema -> IO GLStorage
52allocStorage sch = do 50allocStorage sch = do
53 let sm = T.fromList $ zip (T.keys $ T.slots sch) [0..] 51 let sm = Map.fromList $ zip (Map.keys $ objectArrays sch) [0..]
54 len = T.size sm 52 len = Map.size sm
55 (setters,unis) <- mkUniform $ T.toList $ uniforms sch 53 (setters,unis) <- mkUniform $ Map.toList $ uniforms sch
56 seed <- newIORef 0 54 seed <- newIORef 0
57 slotV <- V.replicateM len $ newIORef (GLSlot IM.empty V.empty Ordered) 55 slotV <- V.replicateM len $ newIORef (GLSlot IM.empty V.empty Ordered)
58 size <- newIORef (0,0) 56 size <- newIORef (0,0)
@@ -72,15 +70,15 @@ disposeStorage :: GLStorage -> IO ()
72disposeStorage = error "not implemented: disposeStorage" 70disposeStorage = error "not implemented: disposeStorage"
73 71
74-- object 72-- object
75addObject :: GLStorage -> ByteString -> Primitive -> Maybe (IndexStream Buffer) -> Trie (Stream Buffer) -> [ByteString] -> IO Object 73addObject :: GLStorage -> ByteString -> Primitive -> Maybe (IndexStream Buffer) -> Map ByteString (Stream Buffer) -> [ByteString] -> IO Object
76addObject input slotName prim indices attribs uniformNames = do 74addObject input slotName prim indices attribs uniformNames = do
77 let sch = schema input 75 let sch = schema input
78 forM_ uniformNames $ \n -> case T.lookup n (uniforms sch) of 76 forM_ uniformNames $ \n -> case Map.lookup n (uniforms sch) of
79 Nothing -> throw $ userError $ "Unknown uniform: " ++ show n 77 Nothing -> throw $ userError $ "Unknown uniform: " ++ show n
80 _ -> return () 78 _ -> return ()
81 case T.lookup slotName (T.slots sch) of 79 case Map.lookup slotName (objectArrays sch) of
82 Nothing -> throw $ userError $ "Unknown slot: " ++ show slotName 80 Nothing -> throw $ userError $ "Unknown slot: " ++ show slotName
83 Just (SlotSchema sPrim sAttrs) -> do 81 Just (ObjectArraySchema sPrim sAttrs) -> do
84 when (sPrim /= (primitiveToFetchPrimitive prim)) $ throw $ userError $ 82 when (sPrim /= (primitiveToFetchPrimitive prim)) $ throw $ userError $
85 "Primitive mismatch for slot (" ++ show slotName ++ ") expected " ++ show sPrim ++ " but got " ++ show prim 83 "Primitive mismatch for slot (" ++ show slotName ++ ") expected " ++ show sPrim ++ " but got " ++ show prim
86 let sType = fmap streamToStreamType attribs 84 let sType = fmap streamToStreamType attribs
@@ -91,7 +89,7 @@ addObject input slotName prim indices attribs uniformNames = do
91 , show sType 89 , show sType
92 ] 90 ]
93 91
94 let slotIdx = case slotName `T.lookup` slotMap input of 92 let slotIdx = case slotName `Map.lookup` slotMap input of
95 Nothing -> error $ "internal error (slot index): " ++ show slotName 93 Nothing -> error $ "internal error (slot index): " ++ show slotName
96 Just i -> i 94 Just i -> i
97 seed = objSeed input 95 seed = objSeed input
@@ -99,7 +97,7 @@ addObject input slotName prim indices attribs uniformNames = do
99 enabled <- newIORef True 97 enabled <- newIORef True
100 index <- readIORef seed 98 index <- readIORef seed
101 modifyIORef seed (1+) 99 modifyIORef seed (1+)
102 (setters,unis) <- mkUniform [(n,t) | n <- uniformNames, let Just t = T.lookup n (uniforms sch)] 100 (setters,unis) <- mkUniform [(n,t) | n <- uniformNames, let Just t = Map.lookup n (uniforms sch)]
103 cmdsRef <- newIORef (V.singleton V.empty) 101 cmdsRef <- newIORef (V.singleton V.empty)
104 let obj = Object 102 let obj = Object
105 { objSlot = slotIdx 103 { objSlot = slotIdx
@@ -151,7 +149,7 @@ setObjectOrder p obj i = do
151 writeIORef (objOrder obj) i 149 writeIORef (objOrder obj) i
152 modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs sorted _) -> GLSlot objs sorted Reorder 150 modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs sorted _) -> GLSlot objs sorted Reorder
153 151
154objectUniformSetter :: Object -> Trie InputSetter 152objectUniformSetter :: Object -> Map ByteString InputSetter
155objectUniformSetter = objUniSetter 153objectUniformSetter = objUniSetter
156 154
157setScreenSize :: GLStorage -> Word -> Word -> IO () 155setScreenSize :: GLStorage -> Word -> Word -> IO ()
@@ -179,7 +177,7 @@ sortSlotObjects p = V.forM_ (slotVector p) $ \slotRef -> do
179 return (ord,obj) 177 return (ord,obj)
180 doSort objs 178 doSort objs
181 179
182createObjectCommands :: Trie (IORef GLint) -> Trie GLUniform -> Object -> GLProgram -> [GLObjectCommand] 180createObjectCommands :: Map ByteString (IORef GLint) -> Map ByteString GLUniform -> Object -> GLProgram -> [GLObjectCommand]
183createObjectCommands texUnitMap topUnis obj prg = objUniCmds ++ objStreamCmds ++ [objDrawCmd] 181createObjectCommands texUnitMap topUnis obj prg = objUniCmds ++ objStreamCmds ++ [objDrawCmd]
184 where 182 where
185 -- object draw command 183 -- object draw command
@@ -193,26 +191,26 @@ createObjectCommands texUnitMap topUnis obj prg = objUniCmds ++ objStreamCmds ++
193 where 191 where
194 objAttrs = objAttributes obj 192 objAttrs = objAttributes obj
195 prim = primitiveToGLType $ objPrimitive obj 193 prim = primitiveToGLType $ objPrimitive obj
196 count = head [c | Stream _ _ _ _ c <- T.elems objAttrs] 194 count = head [c | Stream _ _ _ _ c <- Map.elems objAttrs]
197 195
198 -- object uniform commands 196 -- object uniform commands
199 -- texture slot setup commands 197 -- texture slot setup commands
200 objUniCmds = uniCmds ++ texCmds 198 objUniCmds = uniCmds ++ texCmds
201 where 199 where
202 uniCmds = [GLSetUniform i u | (n,i) <- uniMap, let u = T.lookupWithDefault (topUni n) n objUnis] 200 uniCmds = [GLSetUniform i u | (n,i) <- uniMap, let u = Map.findWithDefault (topUni n) n objUnis]
203 uniMap = T.toList $ inputUniforms prg 201 uniMap = Map.toList $ inputUniforms prg
204 topUni n = T.lookupWithDefault (error $ "internal error (createObjectCommands): " ++ show n) n topUnis 202 topUni n = Map.findWithDefault (error $ "internal error (createObjectCommands): " ++ show n) n topUnis
205 objUnis = objUniSetup obj 203 objUnis = objUniSetup obj
206 texUnis = S.toList $ inputTextureUniforms prg 204 texUnis = S.toList $ inputTextureUniforms prg
207 texCmds = [ GLBindTexture (inputTypeToTextureTarget $ uniInputType u) texUnit u 205 texCmds = [ GLBindTexture (inputTypeToTextureTarget $ uniInputType u) texUnit u
208 | n <- texUnis 206 | n <- texUnis
209 , let u = T.lookupWithDefault (topUni n) n objUnis 207 , let u = Map.findWithDefault (topUni n) n objUnis
210 , let texUnit = T.lookupWithDefault (error $ "internal error (createObjectCommands - Texture Unit): " ++ show n) n texUnitMap 208 , let texUnit = Map.findWithDefault (error $ "internal error (createObjectCommands - Texture Unit): " ++ show n) n texUnitMap
211 ] 209 ]
212 uniInputType (GLUniform ty _) = ty 210 uniInputType (GLUniform ty _) = ty
213 211
214 -- object attribute stream commands 212 -- object attribute stream commands
215 objStreamCmds = [attrCmd i s | (i,name) <- T.elems attrMap, let Just s = T.lookup name objAttrs] 213 objStreamCmds = [attrCmd i s | (i,name) <- Map.elems attrMap, let Just s = Map.lookup name objAttrs]
216 where 214 where
217 attrMap = inputStreams prg 215 attrMap = inputStreams prg
218 objAttrs = objAttributes obj 216 objAttrs = objAttributes obj
@@ -253,138 +251,138 @@ nullSetter :: ByteString -> String -> a -> IO ()
253--nullSetter n t _ = return () -- Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t 251--nullSetter n t _ = return () -- Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t
254nullSetter n t _ = Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t 252nullSetter n t _ = Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t
255 253
256uniformBool :: ByteString -> Trie InputSetter -> SetterFun Bool 254uniformBool :: ByteString -> Map ByteString InputSetter -> SetterFun Bool
257uniformV2B :: ByteString -> Trie InputSetter -> SetterFun V2B 255uniformV2B :: ByteString -> Map ByteString InputSetter -> SetterFun V2B
258uniformV3B :: ByteString -> Trie InputSetter -> SetterFun V3B 256uniformV3B :: ByteString -> Map ByteString InputSetter -> SetterFun V3B
259uniformV4B :: ByteString -> Trie InputSetter -> SetterFun V4B 257uniformV4B :: ByteString -> Map ByteString InputSetter -> SetterFun V4B
260 258
261uniformWord :: ByteString -> Trie InputSetter -> SetterFun Word32 259uniformWord :: ByteString -> Map ByteString InputSetter -> SetterFun Word32
262uniformV2U :: ByteString -> Trie InputSetter -> SetterFun V2U 260uniformV2U :: ByteString -> Map ByteString InputSetter -> SetterFun V2U
263uniformV3U :: ByteString -> Trie InputSetter -> SetterFun V3U 261uniformV3U :: ByteString -> Map ByteString InputSetter -> SetterFun V3U
264uniformV4U :: ByteString -> Trie InputSetter -> SetterFun V4U 262uniformV4U :: ByteString -> Map ByteString InputSetter -> SetterFun V4U
265 263
266uniformInt :: ByteString -> Trie InputSetter -> SetterFun Int32 264uniformInt :: ByteString -> Map ByteString InputSetter -> SetterFun Int32
267uniformV2I :: ByteString -> Trie InputSetter -> SetterFun V2I 265uniformV2I :: ByteString -> Map ByteString InputSetter -> SetterFun V2I
268uniformV3I :: ByteString -> Trie InputSetter -> SetterFun V3I 266uniformV3I :: ByteString -> Map ByteString InputSetter -> SetterFun V3I
269uniformV4I :: ByteString -> Trie InputSetter -> SetterFun V4I 267uniformV4I :: ByteString -> Map ByteString InputSetter -> SetterFun V4I
270 268
271uniformFloat :: ByteString -> Trie InputSetter -> SetterFun Float 269uniformFloat :: ByteString -> Map ByteString InputSetter -> SetterFun Float
272uniformV2F :: ByteString -> Trie InputSetter -> SetterFun V2F 270uniformV2F :: ByteString -> Map ByteString InputSetter -> SetterFun V2F
273uniformV3F :: ByteString -> Trie InputSetter -> SetterFun V3F 271uniformV3F :: ByteString -> Map ByteString InputSetter -> SetterFun V3F
274uniformV4F :: ByteString -> Trie InputSetter -> SetterFun V4F 272uniformV4F :: ByteString -> Map ByteString InputSetter -> SetterFun V4F
275 273
276uniformM22F :: ByteString -> Trie InputSetter -> SetterFun M22F 274uniformM22F :: ByteString -> Map ByteString InputSetter -> SetterFun M22F
277uniformM23F :: ByteString -> Trie InputSetter -> SetterFun M23F 275uniformM23F :: ByteString -> Map ByteString InputSetter -> SetterFun M23F
278uniformM24F :: ByteString -> Trie InputSetter -> SetterFun M24F 276uniformM24F :: ByteString -> Map ByteString InputSetter -> SetterFun M24F
279uniformM32F :: ByteString -> Trie InputSetter -> SetterFun M32F 277uniformM32F :: ByteString -> Map ByteString InputSetter -> SetterFun M32F
280uniformM33F :: ByteString -> Trie InputSetter -> SetterFun M33F 278uniformM33F :: ByteString -> Map ByteString InputSetter -> SetterFun M33F
281uniformM34F :: ByteString -> Trie InputSetter -> SetterFun M34F 279uniformM34F :: ByteString -> Map ByteString InputSetter -> SetterFun M34F
282uniformM42F :: ByteString -> Trie InputSetter -> SetterFun M42F 280uniformM42F :: ByteString -> Map ByteString InputSetter -> SetterFun M42F
283uniformM43F :: ByteString -> Trie InputSetter -> SetterFun M43F 281uniformM43F :: ByteString -> Map ByteString InputSetter -> SetterFun M43F
284uniformM44F :: ByteString -> Trie InputSetter -> SetterFun M44F 282uniformM44F :: ByteString -> Map ByteString InputSetter -> SetterFun M44F
285 283
286uniformFTexture2D :: ByteString -> Trie InputSetter -> SetterFun TextureData 284uniformFTexture2D :: ByteString -> Map ByteString InputSetter -> SetterFun TextureData
287 285
288uniformBool n is = case T.lookup n is of 286uniformBool n is = case Map.lookup n is of
289 Just (SBool fun) -> fun 287 Just (SBool fun) -> fun
290 _ -> nullSetter n "Bool" 288 _ -> nullSetter n "Bool"
291 289
292uniformV2B n is = case T.lookup n is of 290uniformV2B n is = case Map.lookup n is of
293 Just (SV2B fun) -> fun 291 Just (SV2B fun) -> fun
294 _ -> nullSetter n "V2B" 292 _ -> nullSetter n "V2B"
295 293
296uniformV3B n is = case T.lookup n is of 294uniformV3B n is = case Map.lookup n is of
297 Just (SV3B fun) -> fun 295 Just (SV3B fun) -> fun
298 _ -> nullSetter n "V3B" 296 _ -> nullSetter n "V3B"
299 297
300uniformV4B n is = case T.lookup n is of 298uniformV4B n is = case Map.lookup n is of
301 Just (SV4B fun) -> fun 299 Just (SV4B fun) -> fun
302 _ -> nullSetter n "V4B" 300 _ -> nullSetter n "V4B"
303 301
304uniformWord n is = case T.lookup n is of 302uniformWord n is = case Map.lookup n is of
305 Just (SWord fun) -> fun 303 Just (SWord fun) -> fun
306 _ -> nullSetter n "Word" 304 _ -> nullSetter n "Word"
307 305
308uniformV2U n is = case T.lookup n is of 306uniformV2U n is = case Map.lookup n is of
309 Just (SV2U fun) -> fun 307 Just (SV2U fun) -> fun
310 _ -> nullSetter n "V2U" 308 _ -> nullSetter n "V2U"
311 309
312uniformV3U n is = case T.lookup n is of 310uniformV3U n is = case Map.lookup n is of
313 Just (SV3U fun) -> fun 311 Just (SV3U fun) -> fun
314 _ -> nullSetter n "V3U" 312 _ -> nullSetter n "V3U"
315 313
316uniformV4U n is = case T.lookup n is of 314uniformV4U n is = case Map.lookup n is of
317 Just (SV4U fun) -> fun 315 Just (SV4U fun) -> fun
318 _ -> nullSetter n "V4U" 316 _ -> nullSetter n "V4U"
319 317
320uniformInt n is = case T.lookup n is of 318uniformInt n is = case Map.lookup n is of
321 Just (SInt fun) -> fun 319 Just (SInt fun) -> fun
322 _ -> nullSetter n "Int" 320 _ -> nullSetter n "Int"
323 321
324uniformV2I n is = case T.lookup n is of 322uniformV2I n is = case Map.lookup n is of
325 Just (SV2I fun) -> fun 323 Just (SV2I fun) -> fun
326 _ -> nullSetter n "V2I" 324 _ -> nullSetter n "V2I"
327 325
328uniformV3I n is = case T.lookup n is of 326uniformV3I n is = case Map.lookup n is of
329 Just (SV3I fun) -> fun 327 Just (SV3I fun) -> fun
330 _ -> nullSetter n "V3I" 328 _ -> nullSetter n "V3I"
331 329
332uniformV4I n is = case T.lookup n is of 330uniformV4I n is = case Map.lookup n is of
333 Just (SV4I fun) -> fun 331 Just (SV4I fun) -> fun
334 _ -> nullSetter n "V4I" 332 _ -> nullSetter n "V4I"
335 333
336uniformFloat n is = case T.lookup n is of 334uniformFloat n is = case Map.lookup n is of
337 Just (SFloat fun) -> fun 335 Just (SFloat fun) -> fun
338 _ -> nullSetter n "Float" 336 _ -> nullSetter n "Float"
339 337
340uniformV2F n is = case T.lookup n is of 338uniformV2F n is = case Map.lookup n is of
341 Just (SV2F fun) -> fun 339 Just (SV2F fun) -> fun
342 _ -> nullSetter n "V2F" 340 _ -> nullSetter n "V2F"
343 341
344uniformV3F n is = case T.lookup n is of 342uniformV3F n is = case Map.lookup n is of
345 Just (SV3F fun) -> fun 343 Just (SV3F fun) -> fun
346 _ -> nullSetter n "V3F" 344 _ -> nullSetter n "V3F"
347 345
348uniformV4F n is = case T.lookup n is of 346uniformV4F n is = case Map.lookup n is of
349 Just (SV4F fun) -> fun 347 Just (SV4F fun) -> fun
350 _ -> nullSetter n "V4F" 348 _ -> nullSetter n "V4F"
351 349
352uniformM22F n is = case T.lookup n is of 350uniformM22F n is = case Map.lookup n is of
353 Just (SM22F fun) -> fun 351 Just (SM22F fun) -> fun
354 _ -> nullSetter n "M22F" 352 _ -> nullSetter n "M22F"
355 353
356uniformM23F n is = case T.lookup n is of 354uniformM23F n is = case Map.lookup n is of
357 Just (SM23F fun) -> fun 355 Just (SM23F fun) -> fun
358 _ -> nullSetter n "M23F" 356 _ -> nullSetter n "M23F"
359 357
360uniformM24F n is = case T.lookup n is of 358uniformM24F n is = case Map.lookup n is of
361 Just (SM24F fun) -> fun 359 Just (SM24F fun) -> fun
362 _ -> nullSetter n "M24F" 360 _ -> nullSetter n "M24F"
363 361
364uniformM32F n is = case T.lookup n is of 362uniformM32F n is = case Map.lookup n is of
365 Just (SM32F fun) -> fun 363 Just (SM32F fun) -> fun
366 _ -> nullSetter n "M32F" 364 _ -> nullSetter n "M32F"
367 365
368uniformM33F n is = case T.lookup n is of 366uniformM33F n is = case Map.lookup n is of
369 Just (SM33F fun) -> fun 367 Just (SM33F fun) -> fun
370 _ -> nullSetter n "M33F" 368 _ -> nullSetter n "M33F"
371 369
372uniformM34F n is = case T.lookup n is of 370uniformM34F n is = case Map.lookup n is of
373 Just (SM34F fun) -> fun 371 Just (SM34F fun) -> fun
374 _ -> nullSetter n "M34F" 372 _ -> nullSetter n "M34F"
375 373
376uniformM42F n is = case T.lookup n is of 374uniformM42F n is = case Map.lookup n is of
377 Just (SM42F fun) -> fun 375 Just (SM42F fun) -> fun
378 _ -> nullSetter n "M42F" 376 _ -> nullSetter n "M42F"
379 377
380uniformM43F n is = case T.lookup n is of 378uniformM43F n is = case Map.lookup n is of
381 Just (SM43F fun) -> fun 379 Just (SM43F fun) -> fun
382 _ -> nullSetter n "M43F" 380 _ -> nullSetter n "M43F"
383 381
384uniformM44F n is = case T.lookup n is of 382uniformM44F n is = case Map.lookup n is of
385 Just (SM44F fun) -> fun 383 Just (SM44F fun) -> fun
386 _ -> nullSetter n "M44F" 384 _ -> nullSetter n "M44F"
387 385
388uniformFTexture2D n is = case T.lookup n is of 386uniformFTexture2D n is = case Map.lookup n is of
389 Just (SFTexture2D fun) -> fun 387 Just (SFTexture2D fun) -> fun
390 _ -> nullSetter n "FTexture2D" 388 _ -> nullSetter n "FTexture2D"