glsl: simplify resource list building code

This greatly simplifies the code to calculate if we should add a
buffer to the resource list. This uses the spec rules and simple
math to decide if we should add the buffer rather than complex
string processing.

This patch refines a patch present in the ARB_gl_spriv merge
request for the NIR linker and applies it to the GLSL IR linker.
This is why we also move the function to the shared linker code,
because we will want to reuse the code for the NIR linker also.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
10 jobs for !762 with simplify_buffer_add_resource_list in 9 minutes and 34 seconds (queued for 1 second)
detached
Status Name Job ID Coverage
  Containers Build
passed debian #313471

00:01:34

 
  Build+Test
passed meson-clang #313473

00:07:56

passed meson-clover #313477

00:07:59

passed meson-main #313476

00:06:13

passed meson-swr-glvnd #313472

00:06:15

passed meson-vulkan #313478

00:02:54

passed scons-llvm #313480

00:03:41

passed scons-nollvm #313479

00:06:20

passed scons-swr #313474

00:05:36

passed scons-win64 #313475

00:05:51