glsl: Refactor get_num_operands.