Move shader compilation over to raw opengl, errors display incorrect

This commit is contained in:
2023-03-07 15:40:29 +00:00
parent e6ec46edce
commit 3e3fd049a9
12 changed files with 338 additions and 121 deletions
+7 -6
View File
@@ -21,19 +21,20 @@ import qualified Data.Vector.Fusion.Stream.Monadic as VFSM
drawCPUShadows :: RenderData -> Shape -> Point3 -> Float -> IO ()
drawCPUShadows pdata s pos rad = do
let theshad = pdata ^. positionalBlankShader
theptr = _vboPtr $ _vaoVBO $ _shadVAO theshad
theptr = _vboPtr $ _vaoVBO $ _shadVAO' theshad
i <- VFSM.foldlM' (pokeShapeShad pos rad theptr) 0 $ VFSM.fromList s
bindBuffer ArrayBuffer $= (theshad ^? shadVAO . vaoVBO . vbo)
bindBuffer ArrayBuffer $= (theshad ^? shadVAO' . vaoVBO . vbo)
bufferSubData
ArrayBuffer
WriteToBuffer
0
(fromIntegral $ floatSize * i)
(theshad ^. shadVAO . vaoVBO . vboPtr)
currentProgram $= theshad ^? shadProg
bindVertexArrayObject $= Just (_vao $ _shadVAO theshad)
(theshad ^. shadVAO' . vaoVBO . vboPtr)
--currentProgram $= theshad ^? shadProg
glUseProgram (theshad ^. shadProg')
bindVertexArrayObject $= Just (_vao $ _shadVAO' theshad)
glDrawArrays
(marshalEPrimitiveMode $ _shadPrim theshad)
(marshalEPrimitiveMode $ _shadPrim' theshad)
0
(fromIntegral i)
return ()