freedreno: fragile location packing can break cull/clip distance
As per the discussion here !15731 (comment 1354020)
Slight changes in the order varyings are defined causes shaders to fail. For example with the CTS test KHR-GL33.cull_distance.functional
Changing the order of varyings from:
decl_var shader_out INTERP_MODE_NONE float[1] gl_ClipDistance (VARYING_SLOT_CLIP_DIST0.x, 1, 0) compact
decl_var shader_out INTERP_MODE_NONE float[7] gl_CullDistance (VARYING_SLOT_CLIP_DIST0.y, 1, 0) compact
to
decl_var shader_out INTERP_MODE_NONE float[7] gl_CullDistance (VARYING_SLOT_CLIP_DIST0.y, 1, 0) compact
decl_var shader_out INTERP_MODE_NONE float[1] gl_ClipDistance (VARYING_SLOT_CLIP_DIST0.x, 3, 0) compact
Results in ir3_compiler_nir.c:pack_inlocs()
no longer recognizing that these can be packed together in the same location. Due to cull distance components being recognised as taking up 2 slots clip distance ends up being assigned a location of 3 rather than 1. This causes the test to fail.