summaryrefslogtreecommitdiff
path: root/Backend/GL/Input.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend/GL/Input.hs')
-rw-r--r--Backend/GL/Input.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Backend/GL/Input.hs b/Backend/GL/Input.hs
index 2b7c3d3..e1d06b7 100644
--- a/Backend/GL/Input.hs
+++ b/Backend/GL/Input.hs
@@ -85,7 +85,7 @@ addObject input slotName prim indices attribs uniformNames = do
85 ] 85 ]
86 86
87 let slotIdx = case slotName `T.lookup` slotMap input of 87 let slotIdx = case slotName `T.lookup` slotMap input of
88 Nothing -> error "internal error (slot index)" 88 Nothing -> error $ "internal error (slot index): " ++ show slotName
89 Just i -> i 89 Just i -> i
90 seed = objSeed input 90 seed = objSeed input
91 order <- newIORef 0 91 order <- newIORef 0
@@ -194,13 +194,13 @@ createObjectCommands texUnitMap topUnis obj prg = objUniCmds ++ objStreamCmds ++
194 where 194 where
195 uniCmds = [GLSetUniform i u | (n,i) <- uniMap, let u = T.lookupWithDefault (topUni n) n objUnis] 195 uniCmds = [GLSetUniform i u | (n,i) <- uniMap, let u = T.lookupWithDefault (topUni n) n objUnis]
196 uniMap = T.toList $ inputUniforms prg 196 uniMap = T.toList $ inputUniforms prg
197 topUni n = T.lookupWithDefault (error "internal error (createObjectCommands)!") n topUnis 197 topUni n = T.lookupWithDefault (error $ "internal error (createObjectCommands): " ++ show n) n topUnis
198 objUnis = objUniSetup obj 198 objUnis = objUniSetup obj
199 texUnis = S.toList $ inputTextureUniforms prg 199 texUnis = S.toList $ inputTextureUniforms prg
200 texCmds = [ GLBindTexture (inputTypeToTextureTarget $ uniInputType u) texUnit u 200 texCmds = [ GLBindTexture (inputTypeToTextureTarget $ uniInputType u) texUnit u
201 | n <- texUnis 201 | n <- texUnis
202 , let u = T.lookupWithDefault (topUni n) n objUnis 202 , let u = T.lookupWithDefault (topUni n) n objUnis
203 , let texUnit = T.lookupWithDefault (error "internal error (createObjectCommands - Texture Unit)") n texUnitMap 203 , let texUnit = T.lookupWithDefault (error $ "internal error (createObjectCommands - Texture Unit): " ++ show n) n texUnitMap
204 ] 204 ]
205 uniInputType (GLUniform ty _) = ty 205 uniInputType (GLUniform ty _) = ty
206 206
@@ -243,7 +243,8 @@ createObjectCommands texUnitMap topUnis obj prg = objUniCmds ++ objStreamCmds ++
243 constAttr -> GLSetVertexAttrib i constAttr 243 constAttr -> GLSetVertexAttrib i constAttr
244 244
245nullSetter :: ByteString -> String -> a -> IO () 245nullSetter :: ByteString -> String -> a -> IO ()
246nullSetter n t _ = return () -- Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t 246--nullSetter n t _ = return () -- Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t
247nullSetter n t _ = Prelude.putStrLn $ "WARNING: unknown uniform: " ++ SB.unpack n ++ " :: " ++ t
247 248
248uniformBool :: ByteString -> Trie InputSetter -> SetterFun Bool 249uniformBool :: ByteString -> Trie InputSetter -> SetterFun Bool
249uniformV2B :: ByteString -> Trie InputSetter -> SetterFun V2B 250uniformV2B :: ByteString -> Trie InputSetter -> SetterFun V2B