summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-01-13 15:18:23 -0800
committerEric Anholt <[email protected]>2014-02-11 14:36:43 -0800
commit6d6a29018119fd414973ad051fc2271c784ef0f1 (patch)
tree5b1ac28f9f5c4712d8a0b1f0cf36677207e6a0fb /src/mesa
parent54b108282836b68b0db7b3c9a9ba096f99d65f16 (diff)
mesa: Fix extension dependency for half-float TexBOs
Half-float TexBOs should require both GL_ARB_half_float_pixel and GL_ARB_texture_float. This doesn't matter much in practice. Every driver that supports GL_ARB_texture_buffer_object already supports GL_ARB_half_float_pixel. We only expose the TexBO extension in core profiles, and those require GL_ARB_texture_float. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/teximage.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4d635fe7f47..07ac1e1cfcd 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4186,7 +4186,18 @@ _mesa_validate_texbuffer_format(const struct gl_context *ctx,
if (datatype == GL_FLOAT && !ctx->Extensions.ARB_texture_float)
return MESA_FORMAT_NONE;
- if (datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel)
+ /* The GL_ARB_texture_buffer_object spec says:
+ *
+ * "If ARB_texture_float is not supported, references to the
+ * floating-point internal formats provided by that extension should be
+ * removed, and such formats may not be passed to TexBufferARB."
+ *
+ * As a result, GL_HALF_FLOAT internal format depends on both
+ * GL_ARB_texture_float and GL_ARB_half_float_pixel.
+ */
+ if (datatype == GL_HALF_FLOAT &&
+ !(ctx->Extensions.ARB_half_float_pixel
+ && ctx->Extensions.ARB_texture_float))
return MESA_FORMAT_NONE;
if (!ctx->Extensions.ARB_texture_rg) {