Fixes so the recent scalar changes compile on OpenGL2

Change-Id: I6ae5a71af6c924b491021daca2029c736010df5e
Merge topic 'scalar_compile' into master

6aa60b92 Fixes so the recent scalar changes compile on OpenGL2