aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-11-22 13:27:54 -0800
committerEric Anholt <[email protected]>2011-11-22 13:58:38 -0800
commit6216a5b49566fcd3f4b7ed42838858bccd2f0552 (patch)
tree04cfb2d564dee3d04067bcc522f169c9769dc627 /src/mesa/main/texformat.c
parentbabe26b3efa56f1afd139d5cfecbadb857a43d8f (diff)
mesa: Fall back to float16 if float32 isn't supported in ChooseTexFormat.
Until GL 3.0, there isn't any requirement on the actual sizes of channels chosen. By falling back to 16 here, we can correctly support ARB_texture_float on original i965 hardware, which can't correctly filter 32-bit floats.
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 38571b83760..ee9552bc0d9 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -326,6 +326,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_ALPHA32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_FLOAT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_LUMINANCE16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16);
@@ -335,6 +337,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_LUMINANCE32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_FLOAT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_LUMINANCE_ALPHA16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16);
@@ -344,6 +348,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_LUMINANCE_ALPHA32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_INTENSITY16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16);
@@ -353,6 +359,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_INTENSITY32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_FLOAT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_RGB16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
@@ -363,6 +371,8 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_RGB32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_RGBA16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
@@ -370,6 +380,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
break;
case GL_RGBA32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
default:
; /* fallthrough */