[Mesa-dev] [RFC 05/21] mesa/extensions: Add extension::version

Chad Versace chad.versace at intel.com
Thu Oct 22 11:02:16 PDT 2015


On Mon 19 Oct 2015, Nanley Chery wrote:
> From: Nanley Chery <nanley.g.chery at intel.com>
> 
> Enable limiting advertised extension support by context version with
> finer granularity. GLuint is chosen over smaller datatypes because,
> when this field is eventually used, usage of this datatype provides
> the smallest .text size of the compiled library.
> 
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/mesa/main/extensions.c       |  15 +-
>  src/mesa/main/extensions_table.h | 626 +++++++++++++++++++--------------------
>  2 files changed, 326 insertions(+), 315 deletions(-)


> @@ -83,8 +88,14 @@ struct extension {
>   * \brief Table of supported OpenGL extensions for all API's.
>   */
>  static const struct extension extension_table[] = {
> -#define EXT(name_str, driver_cap, api_flags, yyyy) \
> -        { .name = "GL_" #name_str, .offset = o(driver_cap), .api_set = api_flags, .year = yyyy},
> +#define EXT(name_str, driver_cap, api_flags, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \
> +        { .name = "GL_" #name_str, .offset = o(driver_cap), .api_set = api_flags, \
> +          .version = { \
> +            [API_OPENGL_COMPAT] = gll_ver, \
> +            [API_OPENGL_CORE]   = glc_ver, \
> +            [API_OPENGLES]      = gles_ver, \
> +            [API_OPENGLES2]     = gles2_ver, \
> +           }, .year = yyyy},

Please place '.year' and the final '}' each on its own line. That makes
the macro easier to read.

>  #include "extensions_table.h"
>  #undef EXT
>  };


More information about the mesa-dev mailing list