diff options
Diffstat (limited to 'src/LambdaCube/Compiler/CoreToIR.hs')
-rw-r--r-- | src/LambdaCube/Compiler/CoreToIR.hs | 23 |
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 | ||
309 | compSemantic x = case x of | 309 | compSemantic = \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 | ||
315 | imageInputTypeTextureType :: HasCallStack => IR.InputType -> (IR.ColorArity -> IR.TextureDataType) | 315 | imageInputTypeTextureType :: HasCallStack => IR.InputType -> (IR.ColorArity -> IR.TextureDataType) |
316 | imageInputTypeTextureType IR.Float = IR.FloatT | 316 | imageInputTypeTextureType = \case |
317 | imageInputTypeTextureType IR.Int = IR.IntT | 317 | IR.Float -> IR.FloatT |
318 | imageInputTypeTextureType IR.V2I = IR.IntT | 318 | IR.Int -> IR.IntT |
319 | imageInputTypeTextureType IR.V3I = IR.IntT | 319 | IR.V2I -> IR.IntT |
320 | imageInputTypeTextureType IR.V4I = IR.IntT | 320 | IR.V3I -> IR.IntT |
321 | imageInputTypeTextureType IR.V2F = IR.FloatT | 321 | IR.V4I -> IR.IntT |
322 | imageInputTypeTextureType IR.V3F = IR.FloatT | 322 | IR.V2F -> IR.FloatT |
323 | imageInputTypeTextureType IR.V4F = IR.FloatT | 323 | IR.V3F -> IR.FloatT |
324 | imageInputTypeTextureType 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 |
327 | compImageInputType :: HasCallStack => ExpTV -> IR.InputType | 328 | compImageInputType :: HasCallStack => ExpTV -> IR.InputType |