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:
+2
-2
@@ -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
|
||||
|
||||
@@ -5,7 +5,7 @@ import Foreign.Storable
|
||||
|
||||
shapeVerxSize :: Int
|
||||
{-# INLINE shapeVerxSize #-}
|
||||
shapeVerxSize = sizeOf (0 :: Float) * 12
|
||||
shapeVerxSize = sizeOf (0 :: Float) * 8
|
||||
|
||||
--shapeVerxAttributes :: [VertexAttribute]
|
||||
--shapeVerxAttributes =
|
||||
|
||||
Reference in New Issue
Block a user