glsl- Parser and optimizer for a small subset of GLSL
Safe HaskellNone




data Config Source #




  • maxLookahead :: Int

    Maximum number of statements to look ahead for equality.

    Increasing this potentially finds more de-inlining opportunities but also drastically increases the cost of not finding any. This number does not matter if we always find an opportunity quickly.

  • minRepeats :: Int

    Minimum number of times a piece of code needs to appear for it to be worth extracting into a function.

  • maxRepeats :: Int

    Maximum number of initial repeats to use for maximization. If we find enough, we're happy and stop looking. Most of the time we'll find fewer than 10, but sometimes a bit of code is repeated a lot which would slow down the algorithm significantly.

  • windowSize :: Int

    Number of statements in the sliding window.

pass :: Annot a => Config -> GLSL a -> GLSL a Source #

deleteBody :: Maybe ConstExprs -> [StmtAnnot a] -> [StmtAnnot a] -> [StmtAnnot a] Source #

Remove all occurrences of body from ss.

transpose :: [[a]] -> [[a]] Source #

allEqual :: Maybe ConstExprs -> [StmtAnnot a] -> Bool Source #

Check for each statement whether it's structurally equal to the first one.