nir, spirv: Remove more dead variables
SPIR-V modules can have multiple shaders (including of the same stage), but the global variables are all declared for the whole module. This can result in variables with same Binding but incompatible types, so those need to be removed before we use.
To make this work correctly, the dead variable removal needs to take into account pointer initializers, so there's a patch for that.
This MR fixes #3686 (closed).