Move shader compilation over to raw opengl, errors display incorrect
This commit is contained in:
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user