Tweak picture shader verxs

This commit is contained in:
2025-11-20 17:02:05 +00:00
parent cb64be4eeb
commit d0aef5cf39
7 changed files with 72 additions and 83 deletions
+11 -10
View File
@@ -43,7 +43,7 @@ pokeVerx vbos offsets Verx{_vxPos = thePos, _vxCol = theCol, _vxExt = ext, _vxSh
basePtr <- _vboPtr . snd <$> MV.unsafeRead vbos sn
let thePtr = plusPtr basePtr (typeOff * pokeStride shadnum * floatSize)
poke34 thePtr thePos theCol
pokeArrayOff thePtr 7 ext
pokeArrayOff thePtr 8 ext
UMV.unsafeModify offsets (+ 1) sn
where
sn = fromEnum shadnum
@@ -485,7 +485,7 @@ pokeLayVerx vbos counts vx = do
basePtr <- _vboPtr . snd <$> MV.unsafeRead vbos sn
let thePtr = plusPtr basePtr ((theOff + layOff) * theStride * floatSize)
poke34 thePtr thePos theCol
pokeArrayOff thePtr 7 (_vxExt vx)
pokeArrayOff thePtr 8 (_vxExt vx)
UMV.unsafeModify counts (+ 1) vecPos
where
sn = fromEnum shadnum
@@ -499,11 +499,11 @@ pokeLayVerx vbos counts vx = do
pokeStride :: ShadNum -> Int
{-# INLINE pokeStride #-}
pokeStride PolyShad = 7
pokeStride PolyShad = 7 + 1
--pokeStride TextShad = 11
pokeStride TextShad = 10
pokeStride ArcShad = 10
pokeStride EllShad = 7
pokeStride TextShad = 10 + 1
pokeStride ArcShad = 10 + 1
pokeStride EllShad = 7 + 1
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
{-# INLINE poke34 #-}
@@ -511,10 +511,11 @@ poke34 ptr (V3 a b c) (V4 d e f g) = do
pokeElemOff ptr 0 a
pokeElemOff ptr 1 b
pokeElemOff ptr 2 c
pokeElemOff ptr 3 d
pokeElemOff ptr 4 e
pokeElemOff ptr 5 f
pokeElemOff ptr 6 g
pokeElemOff ptr 3 1
pokeElemOff ptr 4 d
pokeElemOff ptr 5 e
pokeElemOff ptr 6 f
pokeElemOff ptr 7 g
pokeArrayOff :: Ptr Float -> Int -> [Float] -> IO ()
{-# INLINE pokeArrayOff #-}