[Mesa-dev] [PATCH 3/4] linker: Use app-specified fragment data location during linking

Paul Berry stereotype441 at gmail.com
Mon Nov 7 10:48:08 PST 2011


On 4 November 2011 16:40, Ian Romanick <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Fixes piglit's bindfragdata-link-error.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/glsl/linker.cpp |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 915d5bb..3492045 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -1381,6 +1381,13 @@
> assign_attribute_or_color_locations(gl_shader_program *prog,
>            assert(binding >= VERT_ATTRIB_GENERIC0);
>            var->location = binding;
>         }
> +      } else if (target_index == MESA_SHADER_FRAGMENT) {
> +        unsigned binding;
> +
> +        if (prog->FragDataBindings->get(binding, var->name)) {
> +           assert(binding >= FRAG_RESULT_DATA0);
> +           var->location = binding;
> +        }
>       }
>
>       /* If the variable is not a built-in and has a location statically
> --
> 1.7.6.4
>
>
There are a few comments in this function that could use updating:



More information about the mesa-dev mailing list