On 4 November 2011 16:40, Ian Romanick <i...@freedesktop.org> wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > Fixes piglit's bindfragdata-link-error. > > Signed-off-by: Ian Romanick <ian.d.roman...@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:
>From the doxygen block above the function, this should be deleted: * \bug * Locations set via \c glBindFragDataLocation are not currently supported. * Only locations assigned automatically by the linker, explicitly set by a * layout qualifier, or explicitly set by a built-in variable (e.g., \c * gl_FragColor) are supported for fragment shaders. And from the "Operate in a total of four passes" comment, step 2: * 2. Assign locations for inputs that have user-defined (via * glBindVertexAttribLocation) locations. should be updated to mention glBindFragDataLocation. Other than those nit-picks, this series is: Reviewed-by: Paul Berry <stereotype...@gmail.com>
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev