summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKosyrev Serge <_deepfire@feelingofgreen.ru>2018-09-22 00:24:47 +0300
committerKosyrev Serge <_deepfire@feelingofgreen.ru>2018-09-22 00:24:47 +0300
commit00c6507a9ee28713e9dbd2315bcce303e50cddbc (patch)
tree2be7d22ef43f77a8d166e48c11b6fd7b49d73077
parent5b7d666edcc0269cef05c62db97d902c9fe723ce (diff)
CoreToIR: address review comments
-rw-r--r--src/LambdaCube/Compiler/CoreToIR.hs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/LambdaCube/Compiler/CoreToIR.hs b/src/LambdaCube/Compiler/CoreToIR.hs
index 30d05916..feb1d6e2 100644
--- a/src/LambdaCube/Compiler/CoreToIR.hs
+++ b/src/LambdaCube/Compiler/CoreToIR.hs
@@ -104,7 +104,7 @@ getCommands backend e = case e of
104 104
105 A3 "foldr" (A0 "++") (A0 "Nil") (A2 "map" (EtaPrim3 "rasterizePrimitive" ints rctx) (getVertexShader -> (vert, input_))) -> mdo 105 A3 "foldr" (A0 "++") (A0 "Nil") (A2 "map" (EtaPrim3 "rasterizePrimitive" ints rctx) (getVertexShader -> (vert, input_))) -> mdo
106 106
107 let 107 let
108 (vertexInput, pUniforms, vertSrc, fragSrc) = case backend of 108 (vertexInput, pUniforms, vertSrc, fragSrc) = case backend of
109 -- disabled DX11 codegen, due to it's incomplete 109 -- disabled DX11 codegen, due to it's incomplete
110 --IR.DirectX11 -> genHLSLs backend (compRC' rctx) ints vert frag ffilter 110 --IR.DirectX11 -> genHLSLs backend (compRC' rctx) ints vert frag ffilter
@@ -306,22 +306,23 @@ compEdgeMode = \case
306 A0 "ClampToEdge" -> IR.ClampToEdge 306 A0 "ClampToEdge" -> IR.ClampToEdge
307 x -> error $ "compEdgeMode: " ++ ppShow x 307 x -> error $ "compEdgeMode: " ++ ppShow x
308 308
309compSemantic x = case x of 309compSemantic = \case
310 A0 "Depth" -> IR.Depth 310 A0 "Depth" -> IR.Depth
311 A0 "Stencil" -> IR.Stencil 311 A0 "Stencil" -> IR.Stencil
312 A1 "Color" _ -> IR.Color 312 A1 "Color" _ -> IR.Color
313 x -> error $ "compSemantic: " ++ ppShow x 313 x -> error $ "compSemantic: " ++ ppShow x
314 314
315imageInputTypeTextureType :: HasCallStack => IR.InputType -> (IR.ColorArity -> IR.TextureDataType) 315imageInputTypeTextureType :: HasCallStack => IR.InputType -> (IR.ColorArity -> IR.TextureDataType)
316imageInputTypeTextureType IR.Float = IR.FloatT 316imageInputTypeTextureType = \case
317imageInputTypeTextureType IR.Int = IR.IntT 317 IR.Float -> IR.FloatT
318imageInputTypeTextureType IR.V2I = IR.IntT 318 IR.Int -> IR.IntT
319imageInputTypeTextureType IR.V3I = IR.IntT 319 IR.V2I -> IR.IntT
320imageInputTypeTextureType IR.V4I = IR.IntT 320 IR.V3I -> IR.IntT
321imageInputTypeTextureType IR.V2F = IR.FloatT 321 IR.V4I -> IR.IntT
322imageInputTypeTextureType IR.V3F = IR.FloatT 322 IR.V2F -> IR.FloatT
323imageInputTypeTextureType IR.V4F = IR.FloatT 323 IR.V3F -> IR.FloatT
324imageInputTypeTextureType x = error $ "Unsupported input type: " <> show x 324 IR.V4F -> IR.FloatT
325 x -> error $ "Unsupported input type: " <> show x
325 326
326-- mirrors Builtins.lc:imageType 327-- mirrors Builtins.lc:imageType
327compImageInputType :: HasCallStack => ExpTV -> IR.InputType 328compImageInputType :: HasCallStack => ExpTV -> IR.InputType