summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-02-26 21:09:03 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-02-26 21:09:03 +0100
commit41f46b0d7ad4ceecef798e7e62d96522a7e29449 (patch)
tree7dd051f6f0c962749af45652100a2b0d4bb54005 /src
parent3d2f2fba9af44efa5ee729eab59c9968114745fa (diff)
bugfixes
Diffstat (limited to 'src')
-rw-r--r--src/LambdaCube/Compiler/CoreToIR.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/LambdaCube/Compiler/CoreToIR.hs b/src/LambdaCube/Compiler/CoreToIR.hs
index 62d6ba5c..097aad62 100644
--- a/src/LambdaCube/Compiler/CoreToIR.hs
+++ b/src/LambdaCube/Compiler/CoreToIR.hs
@@ -597,6 +597,19 @@ genGLSLs backend
597 <> ["precision highp float;" | backend == WebGL1] 597 <> ["precision highp float;" | backend == WebGL1]
598 <> ["precision highp int;" | backend == WebGL1] 598 <> ["precision highp int;" | backend == WebGL1]
599 <> [shaderFunc "vec4" "texture2D" ["sampler2D s", "vec2 uv"] [shaderReturn "texture(s,uv)"] | backend == OpenGL33] 599 <> [shaderFunc "vec4" "texture2D" ["sampler2D s", "vec2 uv"] [shaderReturn "texture(s,uv)"] | backend == OpenGL33]
600 <> [shaderFunc "mat4" "transpose" ["mat4 m"] -- todo: not just for 4 dimension
601 [ shaderLet "vec4 i0" "m[0]"
602 , shaderLet "vec4 i1" "m[1]"
603 , shaderLet "vec4 i2" "m[2]"
604 , shaderLet "vec4 i3" "m[3]"
605 , shaderReturn "mat4(\
606 \vec4(i0.x, i1.x, i2.x, i3.x),\
607 \vec4(i0.y, i1.y, i2.y, i3.y),\
608 \vec4(i0.z, i1.z, i2.z, i3.z),\
609 \vec4(i0.w, i1.w, i2.w, i3.w)\
610 \)"
611 ]
612 | backend == WebGL1 ]
600 <> xs 613 <> xs
601 614
602 shaderFunc outtype name pars body = nest 4 (outtype <+> name <> tupled pars <+> "{" <$$> vcat body) <$$> "}" 615 shaderFunc outtype name pars body = nest 4 (outtype <+> name <> tupled pars <+> "{" <$$> vcat body) <$$> "}"