summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube/GL/Util.hs')
-rw-r--r--src/LambdaCube/GL/Util.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/LambdaCube/GL/Util.hs b/src/LambdaCube/GL/Util.hs
index bba322b..b267c7f 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
@@ -425,14 +427,14 @@ textureDataTypeToGLType Stencil a = case a of
425textureDataTypeToGLArityType :: ImageSemantic -> TextureDataType -> GLenum 427textureDataTypeToGLArityType :: ImageSemantic -> TextureDataType -> GLenum
426textureDataTypeToGLArityType Color a = case a of 428textureDataTypeToGLArityType Color a = case a of
427 FloatT Red -> GL_RED 429 FloatT Red -> GL_RED
428 IntT Red -> GL_RED 430 IntT Red -> GL_RED_INTEGER
429 WordT Red -> GL_RED 431 WordT Red -> GL_RED_INTEGER
430 FloatT RG -> GL_RG 432 FloatT RG -> GL_RG
431 IntT RG -> GL_RG 433 IntT RG -> GL_RG_INTEGER
432 WordT RG -> GL_RG 434 WordT RG -> GL_RG_INTEGER
433 FloatT RGBA -> GL_RGBA 435 FloatT RGBA -> GL_RGBA
434 IntT RGBA -> GL_RGBA 436 IntT RGBA -> GL_RGBA_INTEGER
435 WordT RGBA -> GL_RGBA 437 WordT RGBA -> GL_RGBA_INTEGER
436 a -> error $ "FIXME: This texture format is not yet supported" ++ show a 438 a -> error $ "FIXME: This texture format is not yet supported" ++ show a
437textureDataTypeToGLArityType Depth a = case a of 439textureDataTypeToGLArityType Depth a = case a of
438 FloatT Red -> GL_DEPTH_COMPONENT 440 FloatT Red -> GL_DEPTH_COMPONENT