fix to stack overflow on certain systems by reserving memory for shaders locations on heap rather than stack