summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-16 00:35:44 +0100
committerMarek Olšák <[email protected]>2011-04-15 05:08:00 +0200
commit15f99d13626b42f517467fd884a379cc7475e5d1 (patch)
tree0ba0e0860d2ef8b054822a827bbd2ac62d0155a7 /src/mesa/main/fbobject.c
parent0ecbb0ab7472fe5cb33be13a8307e16f875254e5 (diff)
mesa: finish up ARB_texture_float
Squashed commit of the following: Author: Marek Olšák <[email protected]> mesa: handle floating-point formats in _mesa_base_fbo_format mesa: add ARB/ATI_texture_float, remove MESAX_texture_float commit 123bb110852739dffadcc81ad80b005b1c4f586d Author: Luca Barbieri <[email protected]> Date: Wed Aug 25 01:35:42 2010 +0200 mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index eb1fef51427..1edb310ea13 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1145,7 +1145,37 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_INTENSITY16_SNORM:
return ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
- /* XXX add floating point and integer formats eventually */
+ case GL_R16F:
+ case GL_R32F:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.ARB_texture_float ? GL_RED : 0;
+ case GL_RG16F:
+ case GL_RG32F:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.ARB_texture_float ? GL_RG : 0;
+ case GL_RGB16F:
+ case GL_RGB32F:
+ return ctx->Extensions.ARB_texture_float ? GL_RGB : 0;
+ case GL_RGBA16F:
+ case GL_RGBA32F:
+ return ctx->Extensions.ARB_texture_float ? GL_RGBA : 0;
+ case GL_ALPHA16F_ARB:
+ case GL_ALPHA32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+ case GL_LUMINANCE16F_ARB:
+ case GL_LUMINANCE32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+ case GL_INTENSITY16F_ARB:
+ case GL_INTENSITY32F_ARB:
+ return ctx->Extensions.ARB_texture_float &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+ /* XXX add integer formats eventually */
default:
return 0;
}