From 4735792a761d8c352985eb4eb123b100a2da2e2f Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Thu, 20 Sep 2018 22:49:51 +0300 Subject: textureDataTypeToGLType: switch to 8-bit components for integer RGBA textures --- src/LambdaCube/GL/Util.hs | 6 ++++-- 1 file 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 SrcColor -> GL_SRC_COLOR Zero -> GL_ZERO +-- XXX: we need to extend IR.TextureDescriptor to carry component bit depth +-- if we want to avoid making arbitrary decisions here textureDataTypeToGLType :: ImageSemantic -> TextureDataType -> GLenum textureDataTypeToGLType Color a = case a of FloatT Red -> GL_R32F @@ -412,8 +414,8 @@ textureDataTypeToGLType Color a = case a of IntT RG -> GL_RG32I WordT RG -> GL_RG32UI FloatT RGBA -> GL_RGBA32F - IntT RGBA -> GL_RGBA32I - WordT RGBA -> GL_RGBA32UI + IntT RGBA -> GL_RGBA8I + WordT RGBA -> GL_RGBA8UI a -> error $ "FIXME: This texture format is not yet supported" ++ show a textureDataTypeToGLType Depth a = case a of FloatT Red -> GL_DEPTH_COMPONENT32F -- cgit v1.2.3