glsl: Refactor handling of gl_ClipDistance/gl_ClipVertex linkage rules for GS.
authorPaul Berry <stereotype441@gmail.com>
Tue, 11 Jun 2013 21:11:05 +0000 (14:11 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 23 Aug 2013 18:02:15 +0000 (11:02 -0700)
commit44e07de3acb34152f68308f38c80c9885d8b2fcf
tree45f671671d3fb75649ad90fe4bbeb78659e92970
parentf0072e3c6b0bd46d8ebf7ac0a2cf1bf63dc370e8
glsl: Refactor handling of gl_ClipDistance/gl_ClipVertex linkage rules for GS.

This patch extracts the following logic from
validate_vertex_shader_executable():

(a) Generate an error if the shader writes to both gl_ClipDistance and
    gl_ClipVertex.

(b) Record whether the shader writes to gl_ClipDistance in
    gl_shader_program for use by the back-end.

(c) Record the size of gl_ClipDistance in gl_shader_program for use by
    transform feedback logic.

And moves it into a function that is shared between vertex and
geometry shaders.

Strictly speaking we only need to have shared logic for (b) and (c)
right now (since (a) only matters in compatibility contexts, and we're
only implementing geometry shaders in core contexts right now).  But
the three are closely related enough that it seems sensible to keep
them together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/linker.cpp
src/mesa/main/mtypes.h
src/mesa/main/shaderapi.c