diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2018-09-20 22:49:51 +0300 |
---|---|---|
committer | Kosyrev Serge <_deepfire@feelingofgreen.ru> | 2018-09-20 23:03:28 +0300 |
commit | 4735792a761d8c352985eb4eb123b100a2da2e2f (patch) | |
tree | fe0a9df2a76f4bc09b05c7456aa2709171449013 /src | |
parent | 83c56918279a1fa795cc4c8c53af1f6c8c147029 (diff) |
textureDataTypeToGLType: switch to 8-bit components for integer RGBA textures
Diffstat (limited to 'src')
-rw-r--r-- | src/LambdaCube/GL/Util.hs | 6 |
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 | ||
406 | textureDataTypeToGLType :: ImageSemantic -> TextureDataType -> GLenum | 408 | textureDataTypeToGLType :: ImageSemantic -> TextureDataType -> GLenum |
407 | textureDataTypeToGLType Color a = case a of | 409 | textureDataTypeToGLType 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 |
418 | textureDataTypeToGLType Depth a = case a of | 420 | textureDataTypeToGLType Depth a = case a of |
419 | FloatT Red -> GL_DEPTH_COMPONENT32F | 421 | FloatT Red -> GL_DEPTH_COMPONENT32F |