bool lower_variable_index_to_cond_assign(exec_list *instructions,
bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform);
bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
-bool lower_clip_distance(exec_list *instructions);
+bool lower_clip_distance(gl_shader *shader);
void lower_output_reads(exec_list *instructions);
void lower_ubo_reference(struct gl_shader *shader, exec_list *instructions);
bool optimize_redundant_jumps(exec_list *instructions);
if (!prog->LinkStatus)
goto done;
- if (ctx->ShaderCompilerOptions[i].LowerClipDistance)
- lower_clip_distance(prog->_LinkedShaders[i]->ir);
+ if (ctx->ShaderCompilerOptions[i].LowerClipDistance) {
+ lower_clip_distance(prog->_LinkedShaders[i]);
+ }
unsigned max_unroll = ctx->ShaderCompilerOptions[i].MaxUnrollIterations;
* LowerClipDistance flag in gl_shader_compiler_options to true.
*/
+#include "glsl_symbol_table.h"
#include "ir_hierarchical_visitor.h"
#include "ir.h"
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;
}