[Mesa-dev] [PATCH 1/9] mesa: Handle common extension checks with more compact code

Ilia Mirkin imirkin at alum.mit.edu
Sat May 20 00:07:50 UTC 2017


On Fri, May 19, 2017 at 7:29 PM, Ian Romanick <idr at freedesktop.org> wrote:
> I missed that glsl_parser_extras.cpp has its own implementation of the
> has_XXX_foo() functions that take the API and version as explicit
> parameters.  Your patch predates that change.  There's room for some
> modest savings there too.

The main thing about those functions is that they have to be
out-of-line, as they're invoked via function pointer. Each one can be
cut down a little using your approach of statically looking at the cap
restrictions, but I don't think inlining can work. [I added that code
to (a) add "permission" checks to enable extensions in glsl and (b)
remove the duplication of adding #defines for all the ext names.]

  -ilia


More information about the mesa-dev mailing list