[Mesa-dev] [PATCH] shaderapi: Fix AttachShader error

Matt Turner mattst88 at gmail.com
Mon Feb 11 08:44:49 PST 2013


On Mon, Feb 11, 2013 at 12:03 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> From: bma <Bo.Ma at windriver.com>
>
> Detect a duplicate Shader type as and error instead of silently allowing
> it, restrict to ES2 API.
>
> v2: Tapani Pälli <tapani.palli at intel.com>
>     - make the check run time instead of compile time
>
> Signed-off-by: bma <Bo.Ma at windriver.com>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/main/shaderapi.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 2590abe..39f557a 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -207,6 +207,9 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
>     struct gl_shader *sh;
>     GLuint i, n;
>
> +   const bool same_type_disallowed =
> +       _mesa_is_gles(ctx) || _mesa_is_gles3(ctx);
> +


Should just be
    const bool same_type_disallowed = ctx->API == API_OPENGLES2
since _mesa_is_gles3 is a subset of _mesa_is_gles, and ES1 doesn't have shaders.


More information about the mesa-dev mailing list