[Mesa-dev] [PATCH 05/30] glsl/linker: Refactor in preparation for adding more shader stages.

Paul Berry stereotype441 at gmail.com
Fri Jan 10 06:30:29 PST 2014


On 9 January 2014 22:17, Chris Forbes <chrisf at ijw.co.nz> wrote:

> This is a nice cleanup; I like that this brings both writes to
> prog->LastClipDistanceArraySize together -- but it looks like the
> behavior changes slightly.
>
> Previously, if there was no VS and no GS, then we would never write
> prog->LastClipDistanceArraySize. Now we'll read an old junk value
> (potentially from a previous linking of the same program object with
> different shaders attached) from prog->Vert.ClipDistanceArraySize
> (since we never called validate_vertex_shader_executable) -- but we'll
> never end up actually using it, since it's only used for transform
> feedback of gl_ClipDistance.
>

Yeah, that's a good point.  I agree that it's completely benign, but I
think I could have made things clearer.  I've changed it to this:

   if (num_shaders[MESA_SHADER_GEOMETRY] > 0)
      prog->LastClipDistanceArraySize = prog->Geom.ClipDistanceArraySize;
   else if (num_shaders[MESA_SHADER_VERTEX] > 0)
      prog->LastClipDistanceArraySize = prog->Vert.ClipDistanceArraySize;
   else
      prog->LastClipDistanceArraySize = 0; /* Not used */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140110/1136d747/attachment.html>


More information about the mesa-dev mailing list