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.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs
index 9ceb35f..0471a57 100644
--- a/src/LambdaCube/GL/Input.hs
+++ b/src/LambdaCube/GL/Input.hs
@@ -78,15 +78,15 @@ addObject :: GLStorage -> String -> Primitive -> Maybe (IndexStream Buffer) -> M
78addObject input slotName prim indices attribs uniformNames = do 78addObject input slotName prim indices attribs uniformNames = do
79 let sch = schema input 79 let sch = schema input
80 forM_ uniformNames $ \n -> case Map.lookup n (uniforms sch) of 80 forM_ uniformNames $ \n -> case Map.lookup n (uniforms sch) of
81 Nothing -> throw $ userError $ "Unknown uniform: " ++ show n 81 Nothing -> fail $ "Unknown uniform: " ++ show n
82 _ -> return () 82 _ -> return ()
83 case Map.lookup slotName (objectArrays sch) of 83 case Map.lookup slotName (objectArrays sch) of
84 Nothing -> throw $ userError $ "Unknown slot: " ++ show slotName 84 Nothing -> fail $ "Unknown slot: " ++ show slotName
85 Just (ObjectArraySchema sPrim sAttrs) -> do 85 Just (ObjectArraySchema sPrim sAttrs) -> do
86 when (sPrim /= (primitiveToFetchPrimitive prim)) $ throw $ userError $ 86 when (sPrim /= (primitiveToFetchPrimitive prim)) $ fail $
87 "Primitive mismatch for slot (" ++ show slotName ++ ") expected " ++ show sPrim ++ " but got " ++ show prim 87 "Primitive mismatch for slot (" ++ show slotName ++ ") expected " ++ show sPrim ++ " but got " ++ show prim
88 let sType = fmap streamToStreamType attribs 88 let sType = fmap streamToStreamType attribs
89 when (sType /= sAttrs) $ throw $ userError $ unlines $ 89 when (sType /= sAttrs) $ fail $ unlines $
90 [ "Attribute stream mismatch for slot (" ++ show slotName ++ ") expected " 90 [ "Attribute stream mismatch for slot (" ++ show slotName ++ ") expected "
91 , show sAttrs 91 , show sAttrs
92 , " but got " 92 , " but got "