[Mesa-dev] [PATCH 34/35] mesa: Fix extension dependency for half-float TexBOs
Ian Romanick
idr at freedesktop.org
Wed Jan 29 13:53:25 PST 2014
From: Ian Romanick <ian.d.romanick at intel.com>
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 <ian.d.romanick at intel.com>
---
src/mesa/main/teximage.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 59a9870..d606ed1 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4196,7 +4196,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) {
--
1.8.1.4
More information about the mesa-dev
mailing list