From 4286f0e3180b7f4b9bbf8263cbfa39c687f37d32 Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Mon, 1 Jun 2015 17:25:20 +0200 Subject: improve error message --- Backend/GL/Backend.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Backend/GL') diff --git a/Backend/GL/Backend.hs b/Backend/GL/Backend.hs index 9adff30..decf93c 100644 --- a/Backend/GL/Backend.hs +++ b/Backend/GL/Backend.hs @@ -225,7 +225,10 @@ compileProgram uniTrie p = do (attributes,attributesType) <- queryStreams po print uniforms print attributes - when (uniformsType /= (toTrie $ programUniforms p) `unionL` (toTrie $ programInTextures p)) $ fail "shader program uniform input mismatch!" + when (uniformsType /= (toTrie $ programUniforms p) `unionL` (toTrie $ programInTextures p)) $ do + putStrLn $ "expected: " ++ show ((toTrie $ programUniforms p) `unionL` (toTrie $ programInTextures p)) + putStrLn $ "actual: " ++ show uniformsType + fail "shader program uniform input mismatch!" when (attributesType /= fmap snd (toTrie $ programStreams p)) $ fail $ "shader program stream input mismatch! " ++ show (attributesType,fmap snd (toTrie $ programStreams p)) -- the public (user) pipeline and program input is encoded by the slots, therefore the programs does not distinct the render and slot textures input let inUniNames = toTrie $ programUniforms p -- cgit v1.2.3