Improve shader logging
Parse info logs on shader compilation failure in an implementation-dependent way, which poduces an output like this:
136: vec4 color;
137: vec2 texCoord, lmCoord;a
138:
139: VertexFetch( position, LB, color, texCoord, lmCoord );
------ -----------^-------------------------------------------------------
0(139) : error C0000: syntax error, unexpected '(', expecting "::" at token "("
140: color = color * u_ColorModulate + u_Color;
If the exact character is not known, the line will just be like "^^^^^^^^^^".
Also reorganised some code a bit due to changes. Removed BuildGPUShaderText() since it was just unnecesserily fragmenting the code at this point.
I have tested this on Nvidia and Intel (the latter sometimes reports incorrect line numbers though...), so just need someone to test with AMD.
Mesa is probably all the same whatever the hardware (AMD, Nvidia, Intel, etc.), and Mesa is probably different different to Windows/macOS proprietary AMD even on AMD. With some luck AMD OGLP on Linux is same as AMD on Windows and macOS. On Windows and Linux, one may try Mesa llvmpipe as a generic Mesa driver.
Guess I'll wait for this to be rebased on #1242 :)
Rebased. This now uses the functionality added in #1242.
LGTM