summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2018-09-20 22:49:51 +0300
committerKosyrev Serge <_deepfire@feelingofgreen.ru>2018-09-20 23:03:28 +0300
commit4735792a761d8c352985eb4eb123b100a2da2e2f (patch)
treefe0a9df2a76f4bc09b05c7456aa2709171449013
parent83c56918279a1fa795cc4c8c53af1f6c8c147029 (diff)
textureDataTypeToGLType: switch to 8-bit components for integer RGBA textures
-rw-r--r--src/LambdaCube/GL/Util.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/LambdaCube/GL/Util.hs b/src/LambdaCube/GL/Util.hs
index bba322b..7885860 100644
--- a/src/LambdaCube/GL/Util.hs
+++ b/src/LambdaCube/GL/Util.hs
@@ -403,6 +403,8 @@ blendingFactorToGLType a = case a of
403 SrcColor -> GL_SRC_COLOR 403 SrcColor -> GL_SRC_COLOR
404 Zero -> GL_ZERO 404 Zero -> GL_ZERO
405 405
406-- XXX: we need to extend IR.TextureDescriptor to carry component bit depth
407-- if we want to avoid making arbitrary decisions here
406textureDataTypeToGLType :: ImageSemantic -> TextureDataType -> GLenum 408textureDataTypeToGLType :: ImageSemantic -> TextureDataType -> GLenum
407textureDataTypeToGLType Color a = case a of 409textureDataTypeToGLType Color a = case a of
408 FloatT Red -> GL_R32F 410 FloatT Red -> GL_R32F
@@ -412,8 +414,8 @@ textureDataTypeToGLType Color a = case a of
412 IntT RG -> GL_RG32I 414 IntT RG -> GL_RG32I
413 WordT RG -> GL_RG32UI 415 WordT RG -> GL_RG32UI
414 FloatT RGBA -> GL_RGBA32F 416 FloatT RGBA -> GL_RGBA32F
415 IntT RGBA -> GL_RGBA32I 417 IntT RGBA -> GL_RGBA8I
416 WordT RGBA -> GL_RGBA32UI 418 WordT RGBA -> GL_RGBA8UI
417 a -> error $ "FIXME: This texture format is not yet supported" ++ show a 419 a -> error $ "FIXME: This texture format is not yet supported" ++ show a
418textureDataTypeToGLType Depth a = case a of 420textureDataTypeToGLType Depth a = case a of
419 FloatT Red -> GL_DEPTH_COMPONENT32F 421 FloatT Red -> GL_DEPTH_COMPONENT32F