summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Backend.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube/GL/Backend.hs')
-rw-r--r--src/LambdaCube/GL/Backend.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/LambdaCube/GL/Backend.hs b/src/LambdaCube/GL/Backend.hs
index a5507f3..7c2c3fb 100644
--- a/src/LambdaCube/GL/Backend.hs
+++ b/src/LambdaCube/GL/Backend.hs
@@ -267,9 +267,6 @@ compileProgram uniTrie p = do
267 , inputStreams = Map.fromList [(n,(idx, attrName)) | (n,idx) <- Map.toList $ attributes, let Just attrName = Map.lookup n lcStreamName] 267 , inputStreams = Map.fromList [(n,(idx, attrName)) | (n,idx) <- Map.toList $ attributes, let Just attrName = Map.lookup n lcStreamName]
268 } 268 }
269 269
270compileSampler :: SamplerDescriptor -> IO GLSampler
271compileSampler s = return $ GLSampler {} -- TODO
272
273compileRenderTarget :: Vector TextureDescriptor -> Vector GLTexture -> RenderTarget -> IO GLRenderTarget 270compileRenderTarget :: Vector TextureDescriptor -> Vector GLTexture -> RenderTarget -> IO GLRenderTarget
274compileRenderTarget texs glTexs (RenderTarget targets) = do 271compileRenderTarget texs glTexs (RenderTarget targets) = do
275 let isFB (Framebuffer _) = True 272 let isFB (Framebuffer _) = True
@@ -514,6 +511,8 @@ disposeRenderer p = do
514 withArray (map framebufferObject $ V.toList targets) $ (glDeleteFramebuffers $ fromIntegral $ V.length targets) 511 withArray (map framebufferObject $ V.toList targets) $ (glDeleteFramebuffers $ fromIntegral $ V.length targets)
515 let textures = glTextures p 512 let textures = glTextures p
516 withArray (map glTextureObject $ V.toList textures) $ (glDeleteTextures $ fromIntegral $ V.length textures) 513 withArray (map glTextureObject $ V.toList textures) $ (glDeleteTextures $ fromIntegral $ V.length textures)
514 let samplers = glSamplers p
515 withArray (map glSamplerObject $ V.toList samplers) $ (glDeleteSamplers . fromIntegral . V.length $ glSamplers p)
517 with (glVAO p) $ (glDeleteVertexArrays 1) 516 with (glVAO p) $ (glDeleteVertexArrays 1)
518 517
519{- 518{-
@@ -730,6 +729,7 @@ renderFrame glp = do
730 GLSetProgram p -> glUseProgram p 729 GLSetProgram p -> glUseProgram p
731 GLSetSamplerUniform i tu ref -> glUniform1i i tu >> writeIORef ref tu 730 GLSetSamplerUniform i tu ref -> glUniform1i i tu >> writeIORef ref tu
732 GLSetTexture tu target tx -> glActiveTexture tu >> glBindTexture target tx 731 GLSetTexture tu target tx -> glActiveTexture tu >> glBindTexture target tx
732 GLSetSampler tu s -> glBindSampler tu s
733 GLClearRenderTarget vals -> clearRenderTarget vals 733 GLClearRenderTarget vals -> clearRenderTarget vals
734 GLGenerateMipMap tu target -> glActiveTexture tu >> glGenerateMipmap target 734 GLGenerateMipMap tu target -> glActiveTexture tu >> glGenerateMipmap target
735 GLRenderStream streamIdx progIdx -> do 735 GLRenderStream streamIdx progIdx -> do
@@ -790,10 +790,7 @@ compileCommand texUnitMap samplers textures targets programs cmd = case cmd of
790 let tex = textures ! t 790 let tex = textures ! t
791 modify (\s -> s {textureBinding = IM.insert tu tex $ textureBinding s}) 791 modify (\s -> s {textureBinding = IM.insert tu tex $ textureBinding s})
792 return $ GLSetTexture (GL_TEXTURE0 + fromIntegral tu) (glTextureTarget tex) (glTextureObject tex) 792 return $ GLSetTexture (GL_TEXTURE0 + fromIntegral tu) (glTextureTarget tex) (glTextureObject tex)
793{- 793 SetSampler tu s -> return $ GLSetSampler (GL_TEXTURE0 + fromIntegral tu) (maybe 0 (glSamplerObject . (samplers !)) s)
794 SetSampler tu s -> liftIO $ do
795 glBindSampler (fromIntegral tu) (samplerObject $ glSamplers glp ! s)
796-}
797 RenderSlot slot -> do 794 RenderSlot slot -> do
798 smpUnis <- samplerUniforms <$> get 795 smpUnis <- samplerUniforms <$> get
799 p <- currentProgram <$> get 796 p <- currentProgram <$> get