[Mesa-dev] [PATCH 1/2] dri_interface.h: define __DRI_ATTRIB_MAX

Tomasz Figa tfiga at chromium.org
Tue May 2 00:25:06 UTC 2017


Hi Emil,

On Tue, May 2, 2017 at 3:43 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Thus we can use the value to explicitly size arrays, insteads of
> __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE.
>
> The latter seems magical and is error prone, as we add more dri
> attributes.
>
> Cc: Tomasz Figa <tfiga at chromium.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  include/GL/internal/dri_interface.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
> index 86efd1bdc98..d450109d60f 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -702,6 +702,7 @@ struct __DRIuseInvalidateExtensionRec {
>  #define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS   46
>  #define __DRI_ATTRIB_YINVERTED                 47
>  #define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE  48
> +#define __DRI_ATTRIB_MAX       __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE

Perhaps (__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE + 1)? This way we don't
have to use (__DRI_ATTRIB_MAX + 1) for array sizes.

Best regards,
Tomasz


More information about the mesa-dev mailing list