Remove VAOs
This commit is contained in:
+2
-7
@@ -1,28 +1,23 @@
|
||||
module Shader (drawShaderLay) where
|
||||
|
||||
import Control.Lens
|
||||
import Control.Monad.Primitive
|
||||
import qualified Data.Vector.Unboxed.Mutable as UMV
|
||||
import Graphics.GL.Core45
|
||||
import Shader.Data
|
||||
import Shader.Parameters
|
||||
|
||||
drawShaderLay :: Int -> UMV.MVector (PrimState IO) Int -> Int -> (Shader, VBO) -> IO ()
|
||||
drawShaderLay :: Int -> UMV.MVector (PrimState IO) Int -> Int -> (GLuint, VBO) -> IO ()
|
||||
{-# INLINE drawShaderLay #-}
|
||||
drawShaderLay l countsVector shadIn fs = do
|
||||
i <- UMV.read countsVector shadIn
|
||||
glUseProgram (_shaderUINT $ fst fs)
|
||||
glBindVertexArray $ fs ^. _1 . shaderVAO . unVAO
|
||||
glUseProgram (fst fs)
|
||||
glUniform1i 0 . fromIntegral $ (l * numSubElements)
|
||||
glDrawArrays
|
||||
GL_TRIANGLES
|
||||
(fromIntegral $ l * numSubElements)
|
||||
--(drawCountMod shadIn i)
|
||||
(drawCountMod shadIn i)
|
||||
--(fromIntegral i)
|
||||
|
||||
drawCountMod :: Int -> Int -> GLsizei
|
||||
drawCountMod i n
|
||||
-- | i == 3 = fromIntegral $ 2 * n -- modifies ellipse draw count
|
||||
| i == 3 = fromIntegral $ 2 * n -- modifies ellipse draw count
|
||||
| otherwise = fromIntegral n
|
||||
|
||||
Reference in New Issue
Block a user