[Mesa-dev] [PATCH] glsl: disable resource checking in the linker until it's done right

Ian Romanick idr at freedesktop.org
Mon Nov 21 10:54:28 PST 2011


NAK with extreme prejudice.  Technically speaking, these are app bugs. 
I absolutely will not disable all correct behavior to work around broken 
apps.  The problem is the following shaders will correctly link, but 
completely explode:

uniform float array[1234];
uniform int i;
void main() {
     gl_FragColor = vec4(array[769] + array[i]);
}

There's over a month before what is currently master will be released. 
People that don't like this bug can use a stable release.

On 11/20/2011 01:15 PM, Marek Olšák wrote:
> ---
>   src/glsl/linker.cpp |   20 ++++++++++++++++++++
>   1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 3527088..8089255 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -2230,8 +2230,28 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
>      link_assign_uniform_locations(prog);
>      store_fragdepth_layout(prog);
>
> +   /* This is disabled for now because the checks are breaking a lot of apps.
> +    * The two shaders below should be linked without errors. There are
> +    * backends which can run these shaders just fine.
> +    *
> +    * This shader uses 2 uniform components:
> +    *      uniform float array[1234];
> +    *      void main() {
> +    *         gl_FragColor = vec4(array[769] + array[342]);
> +    *      }
> +    *
> +    * And this shader uses 2 varying components:
> +    *      varying float array[64];
> +    *      void main() {
> +    *         gl_FragColor = vec4(array[28] + array[49]);
> +    *      }
> +    */
> +#if 0
>      if (!check_resources(ctx, prog))
>         goto done;
> +#else
> +   (void) check_resources;
> +#endif
>
>      /* OpenGL ES requires that a vertex shader and a fragment shader both be
>       * present in a linked program.  By checking for use of shading language


More information about the mesa-dev mailing list