Fix error display when compiling/linking shaders
This commit is contained in:
@@ -3,7 +3,6 @@ layout (points) in;
|
||||
layout (triangle_strip, max_vertices = 8) out;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
uniform vec3 lightPos;
|
||||
|
||||
vec4 shift (vec4 p)
|
||||
{ return vec4 (p.xy + (200 * (p.xy-lightPos.xy)), 0 , 1);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import Shader.Data
|
||||
import Shader.Parameters
|
||||
|
||||
import Foreign
|
||||
import Foreign.C.String
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.ByteString.Unsafe as BU
|
||||
import Control.Monad
|
||||
@@ -345,10 +346,10 @@ makeShaderProgram' str srcs = do
|
||||
mapM_ glDeleteShader shaders
|
||||
return theprog
|
||||
|
||||
glCheckError :: (Storable t1, Storable a1, Show a1) =>
|
||||
glCheckError :: (Storable t1) =>
|
||||
[Char]
|
||||
-> (t2 -> GLenum -> Ptr t1 -> IO ())
|
||||
-> (t2 -> t1 -> Ptr a3 -> Ptr a1 -> IO ())
|
||||
-> (t2 -> t1 -> Ptr a3 -> CString -> IO ())
|
||||
-> t2
|
||||
-> GLenum
|
||||
-> IO ()
|
||||
@@ -363,7 +364,7 @@ glCheckError str f g x statustype =
|
||||
len <- peek ptr -- we may have to use this length more intelligently
|
||||
alloca $ \charPtr -> do
|
||||
g x len nullPtr charPtr
|
||||
char <- peek charPtr
|
||||
char <- peekCString charPtr
|
||||
error $ str ++ show char
|
||||
else return ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user