aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_clip_distance.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-12-04 11:11:02 -0800
committerPaul Berry <[email protected]>2012-12-14 10:48:28 -0800
commit18392443d448e083187d085965375e7de910b18a (patch)
tree7d863ce5197c886f294224adb960fdb72561f57f /src/glsl/lower_clip_distance.cpp
parentd249159fe6555d5d0fd44d3b661f796a2eb168d6 (diff)
glsl/lower_clip_distance: Update symbol table.
This patch modifies the clip distance lowering pass so that the new symbol it generates (glClipDistanceMESA) is added to the shader's symbol table. This will allow a later patch to modify the linker so that it finds transform feedback varyings using the symbol table rather than having to iterate through all the declarations in the shader. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/lower_clip_distance.cpp')
-rw-r--r--src/glsl/lower_clip_distance.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glsl/lower_clip_distance.cpp b/src/glsl/lower_clip_distance.cpp
index 0316914714f..09bdc36e169 100644
--- a/src/glsl/lower_clip_distance.cpp
+++ b/src/glsl/lower_clip_distance.cpp
@@ -45,6 +45,7 @@
* LowerClipDistance flag in gl_shader_compiler_options to true.
*/
+#include "glsl_symbol_table.h"
#include "ir_hierarchical_visitor.h"
#include "ir.h"
@@ -334,11 +335,14 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir)
bool
-lower_clip_distance(exec_list *instructions)
+lower_clip_distance(gl_shader *shader)
{
lower_clip_distance_visitor v;
- visit_list_elements(&v, instructions);
+ visit_list_elements(&v, shader->ir);
+
+ if (v.new_clip_distance_var)
+ shader->symbols->add_variable(v.new_clip_distance_var);
return v.progress;
}