[Mesa-dev] [PATCH v2 04/29] mesa/main: clean up OES_texture_float_linear check

Erik Faye-Lund erik.faye-lund at collabora.com
Fri Nov 23 10:54:00 UTC 2018


Using the _mesa_has_FOO_bar helpers is generally more safe and should
generally be prefered over checking driver-caps like this code did,
because the _mesa_has_FOO_bar helpers also verify the API type and
version.

This shouldn't have any practical effect here, as this function only
gets called for OpenGL ES 3.x right now. But if this was to change in
the future, this makes the function behave a lot more predictable.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
 src/mesa/main/glformats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index b2c18aa6d94..a47263a6525 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3853,7 +3853,7 @@ _mesa_is_es3_texture_filterable(const struct gl_context *ctx,
        *     internal formats to base internal formats ... and use cases ...'')
        *     for the R32F, RG32F, RGB32F, and RGBA32F formats."
        */
-      return ctx->Extensions.OES_texture_float_linear;
+      return _mesa_has_OES_texture_float_linear(ctx);
    default:
       return false;
    }
-- 
2.19.1



More information about the mesa-dev mailing list