From 4b51e6a96d528bad7aee1f1e30b1b0a1dc2998f0 Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Tue, 9 Feb 2016 18:46:47 +0100 Subject: cleanup --- src/LambdaCube/GL/Backend.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/LambdaCube') diff --git a/src/LambdaCube/GL/Backend.hs b/src/LambdaCube/GL/Backend.hs index 29acbb8..40abc6d 100644 --- a/src/LambdaCube/GL/Backend.hs +++ b/src/LambdaCube/GL/Backend.hs @@ -196,8 +196,8 @@ clearRenderTarget values = do printGLStatus = checkGL >>= print printFBOStatus = checkFBO >>= print -compileProgram :: Map String InputType -> Program -> IO GLProgram -compileProgram uniTrie p = do +compileProgram :: Program -> IO GLProgram +compileProgram p = do po <- glCreateProgram --putStrLn $ "compile program: " ++ show po let createAndAttach src t = do @@ -245,7 +245,7 @@ compileProgram uniTrie p = do inUniforms = L.filter (\(n,v) -> Map.member n inUniNames) $ Map.toList $ uniforms inTextureNames = programInTextures p inTextures = L.filter (\(n,v) -> Map.member n inTextureNames) $ Map.toList $ uniforms - texUnis = [n | (n,_) <- inTextures, Map.member n uniTrie] + texUnis = [n | (n,_) <- inTextures, Map.member n (programUniforms p)] --putStrLn $ "uniTrie: " ++ show (Map.keys uniTrie) --putStrLn $ "inUniNames: " ++ show inUniNames --putStrLn $ "inUniforms: " ++ show inUniforms @@ -474,11 +474,10 @@ createStreamCommands texUnitMap topUnis attrs primitive prg = streamUniCmds ++ s allocRenderer :: Pipeline -> IO GLRenderer allocRenderer p = do - let uniTrie = uniforms $ schemaFromPipeline p smps <- V.mapM compileSampler $ samplers p texs <- V.mapM compileTexture $ textures p trgs <- V.mapM (compileRenderTarget (textures p) texs) $ targets p - prgs <- V.mapM (compileProgram uniTrie) $ programs p + prgs <- V.mapM compileProgram $ programs p -- texture unit mapping ioref trie -- texUnitMapRefs :: Map UniformName (IORef TextureUnit) texUnitMapRefs <- Map.fromList <$> mapM (\k -> (k,) <$> newIORef 0) (S.toList $ S.fromList $ concat $ V.toList $ V.map (Map.keys . programInTextures) $ programs p) -- cgit v1.2.3