glsl: rewrite clip/cull distance lowering pass
The last version of this broke clipping, and I had to spend sometime getting this working properly. I had to introduce a third pass to count the clip/cull totals, all due to one messy corner case. We have a piglit test tes-input-gl_ClipDistance.shader_test that doesn't actually output the clip distances, it just passes them like a varying from TCS->TES, the older lowering pass worked but to lower clip/cull we need to know the total number of clip+culls used to defined the new variable correctly, and to offset culls properly. This adds an extra pass that works out the sizes for clip/cull, then lowers gl_ClipDistance then gl_CullDistance into the new gl_ClipDistanceMESA. The pass checks using the fixed array sizes code if they array has been referenced, or is actually never used, and ignores it in the latter case. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -119,7 +119,7 @@ bool lower_variable_index_to_cond_assign(gl_shader_stage stage,
|
||||
bool lower_temp, bool lower_uniform);
|
||||
bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz);
|
||||
bool lower_const_arrays_to_uniforms(exec_list *instructions);
|
||||
bool lower_clip_distance(gl_shader *shader);
|
||||
bool lower_clip_cull_distance(struct gl_shader_program *prog, gl_shader *shader);
|
||||
void lower_output_reads(unsigned stage, exec_list *instructions);
|
||||
bool lower_packing_builtins(exec_list *instructions, int op_mask);
|
||||
void lower_shared_reference(struct gl_shader *shader, unsigned *shared_size);
|
||||
|
Reference in New Issue
Block a user