Remove VAOs

This commit is contained in:
2025-11-20 22:33:23 +00:00
parent 86794d1da9
commit f63b47d6c4
7 changed files with 11 additions and 22 deletions
+2 -7
View File
@@ -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