packages feed

GPipe 1.1.0 → 1.1.1

raw patch · 4 files changed

+4/−3 lines, 4 files

Files

GPipe.cabal view
@@ -1,5 +1,5 @@ name: GPipe-version: 1.1.0+version: 1.1.1 cabal-version: >= 1.2.3 build-type: Simple license: BSD3
src/Formats.hs view
@@ -127,7 +127,7 @@     toGLDataType :: a -> GL.DataType
 
 formatRowByteSize :: StorableCPUFormat a => a -> Int -> Int
-formatRowByteSize f x = ((x*sizeOfFormat f-1) `div` 8 + 1)
+formatRowByteSize f x = (x*sizeOfFormat f-1) `div` 8 + 1
  instance StorableCPUFormat CPUFormat4Comp where
     sizeOfFormat (PerComp4 a) = 4 * sizeOfFormat a 
src/Resources.hs view
@@ -365,6 +365,7 @@     cache <- getCurrentOrSetHiddenContext
     [tex] <- genObjectNames 1
     -- putStrLn $ "Created texture " ++ show tex
+    rowAlignment Unpack $= 1 -- Set to no padding
     ionew tex cache     ref <- newIORef $ Map.singleton (contextWindow cache) tex     mkWeakIORef ref $ do m <- readIORef ref
src/Textures.hs view
@@ -102,7 +102,7 @@     type TextureFragmentCoord t
     mkTexture :: CPUFormat (TextureFormat t) -> GL.PixelInternalFormat -> TextureSize t -> [Ptr a] -> IO t
     -- | Calculates the byte size of all mipmaps for a specific format and size, which eases the useage of-    -- 'newTexture' and 'newDepthTexture'.
+    -- 'newTexture' and 'newDepthTexture'. This adds padding for the row alignment of 4 bytes, even on the last row.
     textureCPUFormatByteSize :: CPUFormat (TextureFormat t) -> TextureSize t -> [Int]     -- | Samples the texture using mipmaps in a 'Fragment'. 
     sample :: Sampler -> t -> TextureFragmentCoord t -> Color (TextureFormat t) (Fragment Float)