[Mesa-dev] [PATCH] glsl: fix linker error message context for frag shader output.

Ian Romanick idr at freedesktop.org
Tue Nov 22 12:46:01 PST 2011


On 11/22/2011 11:57 AM, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> A later error prints this properly, fix this case to do the same.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>

Other than the one additional change suggested below,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   src/glsl/linker.cpp |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 3527088..b2068b2 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -1281,9 +1281,11 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
>   	     * attribute overlaps any previously allocated bits.
>   	     */
>   	    if ((~(use_mask<<  attr)&  used_locations) != used_locations) {
> +	       const char *const string = (target_index == MESA_SHADER_VERTEX)
> +		  ? "vertex shader input" : "fragment shader output";
>   	       linker_error(prog,
>   			    "insufficient contiguous attribute locations "
                                                      ^^^^^^^^^
I think this word should be deleted too.  Fragment shader outputs aren't 
called attributes, so saying attribute in that case doesn't make a bit 
of sense.  I don't think we lose anything by removing it in the vertex 
shader input case either.

> -			    "available for vertex shader input `%s'",
> +			    "available for %s `%s'", string,
>   			    var->name);
>   	       return false;
>   	    }



More information about the mesa-dev mailing list