DSA gl texture naming and storage

This commit is contained in:
2023-03-08 13:35:25 +00:00
parent 7f0c7ad159
commit 2279af5510
3 changed files with 50 additions and 39 deletions
+9 -6
View File
@@ -20,7 +20,7 @@ import qualified Data.Vector.Mutable as MV
import Control.Monad.Primitive
import Foreign
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
import Graphics.GL.Core43
import Graphics.GL.Core45
drawShaderLay :: Int -> UMV.MVector (PrimState IO) Int -> Int -> FullShader' -> IO ()
{-# INLINE drawShaderLay #-}
@@ -30,8 +30,10 @@ drawShaderLay l countsVector shadIn fs = do
glUseProgram (_shadProg' fs)
bindVertexArrayObject $= Just (_vao $ _shadVAO' fs)
case _shadTex' fs of
Just ShaderTexture{_textureObject = txo}
-> textureBinding Texture2D $= Just txo
Just ShaderTexture{_textureObject = txo} --, _textureTarget = tt}
-- -> textureBinding Texture2D $= Just txo
-- -> glBindTexture tt txo
-> glBindTextureUnit 0 txo
_ -> return ()
glDrawArrays
(marshalEPrimitiveMode $ _shadPrim' fs)
@@ -45,9 +47,10 @@ drawShader fs i = do
glUseProgram (_shadProg' fs)
bindVertexArrayObject $= Just (_vao $ _shadVAO' fs)
case _shadTex' fs of
Just ShaderTexture{_textureObject = TextureObject txo
, _textureTarget = tt }
-> glBindTexture tt txo
Just ShaderTexture{_textureObject = txo
} --, _textureTarget = tt }
-- -> glBindTexture tt txo
-> glBindTextureUnit 0 txo
_ -> return ()
glDrawArrays
(marshalEPrimitiveMode $ _shadPrim' fs)