summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-05-09 00:42:04 +0200
committerCsaba Hruska <csaba.hruska@gmail.com>2016-05-09 00:42:04 +0200
commit159fdbcbdb8fa14f6e0577fa339fc7d22a6e50ce (patch)
tree1b1766e25db607aa19aeeebe31363aa3546b7f07 /src/LambdaCube/GL
parentf2389270cf83d1e5fcd9c3f1c23e26d00fb51183 (diff)
add check for texture uniforms
Diffstat (limited to 'src/LambdaCube/GL')
-rw-r--r--src/LambdaCube/GL/Backend.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/LambdaCube/GL/Backend.hs b/src/LambdaCube/GL/Backend.hs
index 282c281..f14d105 100644
--- a/src/LambdaCube/GL/Backend.hs
+++ b/src/LambdaCube/GL/Backend.hs
@@ -247,6 +247,19 @@ compileProgram p = do
247 inTextureNames = programInTextures p 247 inTextureNames = programInTextures p
248 inTextures = L.filter (\(n,v) -> Map.member n inTextureNames) $ Map.toList $ uniforms 248 inTextures = L.filter (\(n,v) -> Map.member n inTextureNames) $ Map.toList $ uniforms
249 texUnis = [n | (n,_) <- inTextures, Map.member n (programUniforms p)] 249 texUnis = [n | (n,_) <- inTextures, Map.member n (programUniforms p)]
250 let prgInTextures = Map.keys inTextureNames
251 uniInTextures = map fst inTextures
252 unless (S.fromList prgInTextures == S.fromList uniInTextures) $ fail $ unlines
253 [ "shader program uniform texture input mismatch!"
254 , "expected: " ++ show prgInTextures
255 , "actual: " ++ show uniInTextures
256 , "vertex shader:"
257 , vertexShader p
258 , "geometry shader:"
259 , fromMaybe "" (geometryShader p)
260 , "fragment shader:"
261 , fragmentShader p
262 ]
250 --putStrLn $ "uniTrie: " ++ show (Map.keys uniTrie) 263 --putStrLn $ "uniTrie: " ++ show (Map.keys uniTrie)
251 --putStrLn $ "inUniNames: " ++ show inUniNames 264 --putStrLn $ "inUniNames: " ++ show inUniNames
252 --putStrLn $ "inUniforms: " ++ show inUniforms 265 --putStrLn $ "inUniforms: " ++ show inUniforms