Skip to content

Commit 00c6507

Browse files
committed
CoreToIR: address review comments
1 parent 5b7d666 commit 00c6507

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/LambdaCube/Compiler/CoreToIR.hs

+12-11
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ getCommands backend e = case e of
104104

105105
A3 "foldr" (A0 "++") (A0 "Nil") (A2 "map" (EtaPrim3 "rasterizePrimitive" ints rctx) (getVertexShader -> (vert, input_))) -> mdo
106106

107-
let
107+
let
108108
(vertexInput, pUniforms, vertSrc, fragSrc) = case backend of
109109
-- disabled DX11 codegen, due to it's incomplete
110110
--IR.DirectX11 -> genHLSLs backend (compRC' rctx) ints vert frag ffilter
@@ -306,22 +306,23 @@ compEdgeMode = \case
306306
A0 "ClampToEdge" -> IR.ClampToEdge
307307
x -> error $ "compEdgeMode: " ++ ppShow x
308308

309-
compSemantic x = case x of
309+
compSemantic = \case
310310
A0 "Depth" -> IR.Depth
311311
A0 "Stencil" -> IR.Stencil
312312
A1 "Color" _ -> IR.Color
313313
x -> error $ "compSemantic: " ++ ppShow x
314314

315315
imageInputTypeTextureType :: HasCallStack => IR.InputType -> (IR.ColorArity -> IR.TextureDataType)
316-
imageInputTypeTextureType IR.Float = IR.FloatT
317-
imageInputTypeTextureType IR.Int = IR.IntT
318-
imageInputTypeTextureType IR.V2I = IR.IntT
319-
imageInputTypeTextureType IR.V3I = IR.IntT
320-
imageInputTypeTextureType IR.V4I = IR.IntT
321-
imageInputTypeTextureType IR.V2F = IR.FloatT
322-
imageInputTypeTextureType IR.V3F = IR.FloatT
323-
imageInputTypeTextureType IR.V4F = IR.FloatT
324-
imageInputTypeTextureType x = error $ "Unsupported input type: " <> show x
316+
imageInputTypeTextureType = \case
317+
IR.Float -> IR.FloatT
318+
IR.Int -> IR.IntT
319+
IR.V2I -> IR.IntT
320+
IR.V3I -> IR.IntT
321+
IR.V4I -> IR.IntT
322+
IR.V2F -> IR.FloatT
323+
IR.V3F -> IR.FloatT
324+
IR.V4F -> IR.FloatT
325+
x -> error $ "Unsupported input type: " <> show x
325326

326327
-- mirrors Builtins.lc:imageType
327328
compImageInputType :: HasCallStack => ExpTV -> IR.InputType

0 commit comments

Comments
 (0)