Only fetch clip control states when available, else use default vals
Fix enum typo in GL render state
Fetch number of active subroutine uniform locations from right place
Bugfixes for wchar_t handling
Move CalcNumMips to common header so GL code can access it
Don't use MAX_LEVEL to calc mips for non-immutable textures

* GL_TEXTURE_MAX_LEVEL acts as a bound on the number of mips for either
  immutable or non-immutable textures. Instead for non-immutable textures
  we do the standard mip calculation and that's what's necessary for a
  "complete" texture.