First implementation of SSBO, vertex pulling

This commit is contained in:
2025-11-10 11:58:11 +00:00
parent 187751ec26
commit 5e93c7631d
7 changed files with 201 additions and 131 deletions
+9 -1
View File
@@ -110,6 +110,9 @@ doDrawing' win pdata u = do
]
-- set the coordinate uniform ready for drawing elements using world coordinates
bufferPerspectiveMatrixUBO cfig (w ^. wCam) (pdata ^. matUBO)
glNamedBufferSubData (pdata ^. winSSBO) 0
(fromIntegral $ nWins * sizeOf (0::Float) * 8)
(pdata ^. vboWindows . vboPtr)
setViewport _gr_world_res cfig
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBase . _1 . unFBO)
glDepthMask GL_TRUE
@@ -373,7 +376,12 @@ doDrawing' win pdata u = do
glDepthFunc GL_LEQUAL
glCullFace GL_BACK
glDisable GL_BLEND
drawShader (_windowShader pdata) nWins
glDepthFunc GL_ALWAYS
glDisable GL_CULL_FACE
glUseProgram $ pdata ^. windowPullShader . shaderUINT
glBindVertexArray $ pdata ^. dummyVAO . vaoName
glDrawArrays GL_TRIANGLES 0 (fromIntegral nWins * 6)
--drawShader (_windowShader pdata) nWins
glDisable GL_DEPTH_CLAMP
glDisable GL_CULL_FACE
glInvalidateBufferData (pdata ^. vboShapes . vboName)