Remove Maybe from custom unis

This commit is contained in:
2021-06-10 16:54:21 +02:00
parent 0b76062475
commit 79d2c73dcf
4 changed files with 18 additions and 26 deletions
+2 -3
View File
@@ -26,7 +26,6 @@ import MatrixHelper
import Foreign
import Codec.Picture
import Data.Maybe (fromMaybe)
import qualified Data.ByteString as BS
import qualified Data.Vector.Storable as V
import Control.Monad (unless, forM, zipWithM_, forM_, foldM)
@@ -130,7 +129,7 @@ makeShader s shaderlist alocs pm renStrat = do
, _shaderPokeStrategy = renStrat
, _shaderDrawPrimitive = pm
, _shaderTexture = Nothing
, _shaderCustomUnis = Nothing
, _shaderCustomUnis = []
}
floatSize :: Int
floatSize = sizeOf (0.5 :: GLfloat)
@@ -184,7 +183,7 @@ makeSourcedShader s sts = do
addUniforms :: [String] -> FullShader a -> IO (FullShader a)
addUniforms uniStrings shad = do
uniLocs <- mapM (uniformLocation $ _shaderProgram shad) uniStrings
return $ shad & shaderCustomUnis %~ Just . (++ uniLocs) . fromMaybe []
return $ shad & shaderCustomUnis %~ (++ uniLocs)
shaderTypeExt :: ShaderType -> String