renderer2: refactoring the c++ shader code