Reduce shape vertex size to 8 floats

It is not at all clear whether this is an improvement or not
This commit is contained in:
2025-11-11 21:12:50 +00:00
parent ce438b7ecd
commit 4121bfb468
6 changed files with 53 additions and 55 deletions
+2 -2
View File
@@ -440,7 +440,7 @@ pokeJustV :: Float -> Point3 -> Point4 -> Ptr Float -> Int -> Point3 -> IO Int
pokeJustV xdata cp col ptr nv sh = do
pokeByteOff ptr (nv * shapeVerxSize) (V4 x y z xdata)
pokeByteOff ptr (nv *shapeVerxSize + 4 * floatSize) (normalToColor8 $ V4 nx ny nz 1)
pokeByteOff ptr (nv *shapeVerxSize + 8 * floatSize) (toColor8 col)
pokeByteOff ptr (nv *shapeVerxSize + 5 * floatSize) (toColor8 col)
return (nv + 1)
where
V3 x y z = sh
@@ -458,7 +458,7 @@ pokeFlatV ::
pokeFlatV xdata pnorm col ptr nv sh = do
pokeByteOff ptr (nv * shapeVerxSize) (V4 x y z xdata)
pokeByteOff ptr (nv *shapeVerxSize + 4 * floatSize) (normalToColor8 $ V4 nx ny nz 1)
pokeByteOff ptr (nv *shapeVerxSize + 8 * floatSize) (toColor8 col)
pokeByteOff ptr (nv *shapeVerxSize + 5 * floatSize) (toColor8 col)
return (nv + 1)
where
V3 x y z = sh
+1 -1
View File
@@ -5,7 +5,7 @@ import Foreign.Storable
shapeVerxSize :: Int
{-# INLINE shapeVerxSize #-}
shapeVerxSize = sizeOf (0 :: Float) * 12
shapeVerxSize = sizeOf (0 :: Float) * 8
--shapeVerxAttributes :: [VertexAttribute]
--shapeVerxAttributes =