[Mesa-dev] [v7 9/9] i965: enable image external sampling for imported dma-buffers

Chad Versace chad.versace at linux.intel.com
Fri Jul 19 14:32:35 PDT 2013


On 07/10/2013 01:24 AM, Topi Pohjolainen wrote:
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>   src/mesa/drivers/dri/i965/intel_extensions.c | 1 +
>   src/mesa/drivers/dri/i965/intel_tex_image.c  | 6 ++++++
>   2 files changed, 7 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c
> index 1e762ef..d8d947f 100644
> --- a/src/mesa/drivers/dri/i965/intel_extensions.c
> +++ b/src/mesa/drivers/dri/i965/intel_extensions.c
> @@ -122,6 +122,7 @@ intelInitExtensions(struct gl_context *ctx)
>      ctx->Extensions.OES_EGL_image = true;
>      ctx->Extensions.OES_draw_texture = true;
>      ctx->Extensions.OES_standard_derivatives = true;
> +   ctx->Extensions.OES_EGL_image_external = true;
>
>      if (brw->gen >= 6)
>         ctx->Const.GLSLVersion = 140;
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
> index c2912b6..9ca8666 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
> @@ -376,6 +376,12 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
>         return;
>      }
>
> +   /* Currently external sampling itself is limited to dma-buffers only */
> +   if (target == GL_TEXTURE_EXTERNAL_OES && !image->dma_buf_imported) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION, __func__);
> +      return;
> +   }
> +

_mesa_error() let's us give the user a useful error message, so let's do that here.



More information about the mesa-dev mailing list