Use new GPU_legacy_support() function.
Determine GLSL version once instead of per shader.
For Texture Buffers, allow ARB or EXT version of the extension. Either
one will do.
Input array length is implicitly set at link time, based on the geometry
shader's layout. Specifying the wrong value here is an error; specifying
no value is the same as getting it right. (inspired by a recent codegen
change)
GLSL 130, 140, 150 with extensions as needed.
Similar logic to my recent gpu_extensions changes.
Partially fixes T46706. Matcaps now work with OpenSubdiv, as do basic
materials. Anything with UV coordinates is still broken.
Uniform block data layout was different on CPU and GPU which caused wrong
data being used from shader.
In theory using layout(std140) is what we need to do, but for some reason
such layout specifier is being ignored. This is probably caused by the way
how we exploit extensions from older version of glsl.
For until we've upgraded our glsl pipeline used different approach which
is basically about removing unused fields form the struct manual in hope
that it'll keep memory layout consistent for both CPU and GPU.
This seems to work so far for both NVidia GTX580 and AMD FirePro W8000
here in the studio.
In fact exit was getting called because we
had an error in shader compilation:
Uniform buffer objects are in fact required.
Since it looks like original intent was to
write the shader against older GLSL version,
I will be adding an extension here instead
of a version.
Thanks to Anshu Arya for letting me borrow his machine through
VPN to do the debugging :)
The idea is to cut as much code as possible and use compile-time
ifdefs rather than runtime if() statements.
Gives about 2x speedup on catmark_car model from OpenSubdiv repository
making our FPS much closer to what glViewer is capable of.
This includes C-API bindings in intern/opensubdiv and CMAke module
which finds the OpenSubdiv library. This filea are not in use so
far, making it a separate commit to make actual integration commit
more clear.