[PATCH 2/3] Float fbconfigs exchange patch [2/3] Extension string enabling.

Ian Romanick idr at freedesktop.org
Thu Oct 3 09:11:28 PDT 2013


On 07/15/2013 08:06 AM, Tomasz Lis wrote:
> From: Tomasz Lis <tomasz.lis at intel.com>
> 
> Enables the fbconfig_float extension in list of supported extensions,
> and adds it to known extensions table.

I'd rephrase the commit message as:

Add GLX_ARB_fbconfig_float extension string

Always enable the extension.  If a driver does not support float
rendering, it can just not advertise any float configs.

> Signed-off-by: Tomasz Lis <listom at gmail.com>
> ---
>  composite/compalloc.c  |    3 +++
>  glx/extension_string.c |    5 +++++
>  glx/extension_string.h |    1 +
>  glx/glxdri2.c          |   10 ++++++++++
>  4 files changed, 19 insertions(+)
> 
> diff --git a/composite/compalloc.c b/composite/compalloc.c
> index cc69c68..46e14bf 100644
> --- a/composite/compalloc.c
> +++ b/composite/compalloc.c
> @@ -565,6 +565,9 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
>          XID inferiors = IncludeInferiors;
>          int error;
>  
> +        if (!pSrcFormat || !pDstFormat) /* Might happen if the format is not supported by server */
> +            return 0;
> +

This doesn't seem to have anything to do with enabling
GLX_ARB_fbconfig_float and friends.  At the very least it should be a
separate patch.  Why is it necessary?

>          PicturePtr pSrcPicture = CreatePicture(None,
>                                                 &pParent->drawable,
>                                                 pSrcFormat,
> diff --git a/glx/extension_string.c b/glx/extension_string.c
> index 58f930f..fad5c84 100644
> --- a/glx/extension_string.c
> +++ b/glx/extension_string.c
> @@ -65,6 +65,10 @@ struct extension_info {
>      unsigned char driver_support;
>  };
>  
> +/**
> + * List of known GLX Extensions.
> + * The last Y/N switch informs whether the support of this extension is always enabled.
> + */
>  static const struct extension_info known_glx_extensions[] = {
>  /*   GLX_ARB_get_proc_address is implemented on the client. */
>      /* *INDENT-OFF* */
> @@ -74,6 +78,7 @@ static const struct extension_info known_glx_extensions[] = {
>      { GLX(ARB_framebuffer_sRGB),        VER(0,0), N, },
>      { GLX(ARB_multisample),             VER(1,4), Y, },
>  
> +    { GLX(ARB_fbconfig_float),          VER(1,3), N, },

The VER(1,3) means this extension must be supported to enable able GLX
1.3.  This should be VER(0,0).

>      { GLX(EXT_create_context_es2_profile), VER(0,0), N, },
>      { GLX(EXT_framebuffer_sRGB),        VER(0,0), N, },
>      { GLX(EXT_import_context),          VER(0,0), Y, },
> diff --git a/glx/extension_string.h b/glx/extension_string.h
> index 81b7de3..3bec1b1 100644
> --- a/glx/extension_string.h
> +++ b/glx/extension_string.h
> @@ -41,6 +41,7 @@ enum {
>      ARB_create_context_robustness_bit,
>      ARB_framebuffer_sRGB_bit,
>      ARB_multisample_bit,
> +    ARB_fbconfig_float_bit,
>      EXT_create_context_es2_profile_bit,
>      EXT_import_context_bit,
>      EXT_texture_from_pixmap_bit,
> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index 8a1fa41..2315761 100644
> --- a/glx/glxdri2.c
> +++ b/glx/glxdri2.c
> @@ -634,6 +634,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
>      return &context->base;
>  }
>  
> +/**
> + * Initializes extensions flags in glx_enable_bits when a new screen is created.
> + * @param screen The screen where glx_enable_bits are to be set.
> + */
>  static void
>  __glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
>  {
> @@ -889,6 +893,12 @@ initializeExtensions(__GLXDRIscreen * screen)
>          LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n");
>      }
>  
> +    /* enable ARB_fbconfig_float extension (even if there are no float fbconfigs) */
> +    {
> +        __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float");
> +        LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n");
> +    }
> +
>      for (i = 0; extensions[i]; i++) {
>  #ifdef __DRI_READ_DRAWABLE
>          if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
> 



More information about the xorg-devel mailing list