[Mesa-dev] [PATCH 04/38] drivers/dri: set the implemented version of __DRItexBufferExtension
Ilia Mirkin
imirkin at alum.mit.edu
Wed Feb 12 18:34:40 PST 2014
On Wed, Feb 12, 2014 at 8:17 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> ... over the version number provided by the headers.
> Explicitly set extension members to improve clarity.
So... the current value is 2, but I see code that does
src/egl/drivers/dri2/egl_dri2.c:#if __DRI_TEX_BUFFER_VERSION >= 3
src/glx/dri2_glx.c:#if __DRI_TEX_BUFFER_VERSION >= 3
src/glx/drisw_glx.c:#if __DRI_TEX_BUFFER_VERSION >= 3
What's that all about?
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
> src/mesa/drivers/dri/i915/intel_screen.c | 2 +-
> src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
> src/mesa/drivers/dri/nouveau/nouveau_screen.c | 8 +++++---
> src/mesa/drivers/dri/radeon/radeon_screen.c | 16 ++++++++++------
> src/mesa/drivers/dri/swrast/swrast.c | 8 +++++---
> 5 files changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
> index 296df16..68ad2b7 100644
> --- a/src/mesa/drivers/dri/i915/intel_screen.c
> +++ b/src/mesa/drivers/dri/i915/intel_screen.c
> @@ -146,7 +146,7 @@ aub_dump_bmp(struct gl_context *ctx)
> }
>
> static const __DRItexBufferExtension intelTexBufferExtension = {
> - .base = { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> + .base = { __DRI_TEX_BUFFER, 2 },
>
> .setTexBuffer = intelSetTexBuffer,
> .setTexBuffer2 = intelSetTexBuffer2,
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index acdb5f3..c7b6c92 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -157,7 +157,7 @@ aub_dump_bmp(struct gl_context *ctx)
> }
>
> static const __DRItexBufferExtension intelTexBufferExtension = {
> - .base = { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> + .base = { __DRI_TEX_BUFFER, 2 },
>
> .setTexBuffer = intelSetTexBuffer,
> .setTexBuffer2 = intelSetTexBuffer2,
> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
> index a381064..3c85918 100644
> --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
> +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
> @@ -233,9 +233,11 @@ static const struct __DRI2flushExtensionRec nouveau_flush_extension = {
> };
>
> static const struct __DRItexBufferExtensionRec nouveau_texbuffer_extension = {
> - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> - NULL,
> - nouveau_set_texbuffer,
> + .base = { __DRI_TEX_BUFFER, 2 },
> +
> + .setTexBuffer = NULL,
> + .setTexBuffer2 = nouveau_set_texbuffer,
> + .releaseTexBuffer = NULL,
> };
>
> static const __DRIextension *nouveau_screen_extensions[] = {
> diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
> index 57e866e..8d6840f 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_screen.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
> @@ -170,15 +170,19 @@ radeonGetParam(__DRIscreen *sPriv, int param, void *value)
>
> #if defined(RADEON_R100)
> static const __DRItexBufferExtension radeonTexBufferExtension = {
> - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> - radeonSetTexBuffer,
> - radeonSetTexBuffer2,
> + .base = { __DRI_TEX_BUFFER, 2 },
> +
> + .setTexBuffer = radeonSetTexBuffer,
> + .setTexBuffer2 = radeonSetTexBuffer2,
> + .releaseTexBuffer = NULL,
> };
> #elif defined(RADEON_R200)
> static const __DRItexBufferExtension r200TexBufferExtension = {
> - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> - r200SetTexBuffer,
> - r200SetTexBuffer2,
> + .base = { __DRI_TEX_BUFFER, 2 },
> +
> + .setTexBuffer = r200SetTexBuffer,
> + .setTexBuffer2 = r200SetTexBuffer2,
> + .releaseTexBuffer = NULL,
> };
> #endif
>
> diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
> index 071192c..826ee92 100644
> --- a/src/mesa/drivers/dri/swrast/swrast.c
> +++ b/src/mesa/drivers/dri/swrast/swrast.c
> @@ -110,9 +110,11 @@ static void swrastSetTexBuffer(__DRIcontext *pDRICtx, GLint target,
> }
>
> static const __DRItexBufferExtension swrastTexBufferExtension = {
> - { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
> - swrastSetTexBuffer,
> - swrastSetTexBuffer2,
> + .base = { __DRI_TEX_BUFFER, 2 },
> +
> + .setTexBuffer = swrastSetTexBuffer,
> + .setTexBuffer2 = swrastSetTexBuffer2,
> + .releaseTexBuffer = NULL,
> };
>
> static const __DRIextension *dri_screen_extensions[] = {
> --
> 1.8.5.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list