As g_truc said long ago:
https://twitter.com/g_truc/status/352778836657700866
Currently there is not much use of this as the stock shaders are
compiled one by one (and doing it differently would make things
needlessly overcomplicated), but the users can do parallel compilation
of their own shaders.
Also removed a bunch of now-unneeded TODOs and made the linker/compiler
code nearly similar. Also the whole Shader::compile() call now does two
allocations in total instead of two allocations for each shader.
Also added (currently disabled) ES implementation (provided by
EXT_separate_shader_objects). Unfortunately it's not possible to reduce
the function count, because ARB_separate_shader_objects and
EXT_direct_state_access are completely independent. Also double uniforms
are supported since GL 4.0 and SSO are since 4.1, so we can't omit
old glUniform*() calls for doubles either.
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
There will be many places (e.g. all
Platform::*Application::Configuration classes) where Version will be
used without Context (and all GL stuff brought with it).
Can't test EXT_debug_label, as that is apparently OSX 10.9-only. Added
GL tests for all implemented objects. KHR_debug is selected first, if
that is not available, fall back to EXT_debug_label. If neither is
available, the functions are no-op.
I hope EXT_debug_label gets replaced by KHR_debug later, thus it is now
only "emulated" through KHR_debug enums.
Renamed AbstractShaderProgram::maxSupportedVertexAttributeCount() to
maxVertexAttributes(), the old function is now an alias to retain
source compatibility, will be removed in future release.
Also printing the values in magnum-info.
Passing pointer as function parameter will now mean that it is possible
to pass `nullptr`. Some code examples now look like the parameter is
copied instead of referenced, which is misleading. Updated the
documentation to reflect that more clearly.
Removed unneeded member variables, removed wrong assertions and wrong
documentation (most of the state they were fobidding is actually valid).
Retrieving shader log with full length, properly printing non-error
messages to debug output.
Each shader must now be compiled explicitly using compile(), which is
slightly better for the user as it is possible to check compile status
instead of having it weirdly hidden inside attachShader(). link() now
also returns linking status.
OpenGL includes are ~35k lines together and it is a waste of
compilation time to include them even if they are not needed at all
(e.g. whole SceneGraph and Physics libraries). Saves ~10s of compilation
time (6:46 before, now 6:35).
Remaining unspecified components are set to 0, 0, 1, according to spec.
Also cleaned up and simplified the internals, added debug output
operators for attribute component count and types and tested the whole
thing.
The stride was computed always for resulting GLSL type (e.g. vec4) even
if the data were of anoother type (e.g. std::uint8_t[4]). The code is
exceptionally ugly now, time to wrap it with unit tests.
Also explicitly calling use() on default (non-DSA) setUniform()
implementation. Because of that, it is now possible to conveniently call
use() at the end, instead of at the beginning of uniform setting chain,
for example:
// before
shader->use();
shader->setTransformation(transformation)
->setProjection(projection)
->setColor(color);
// now
shader->setTransformation(transformation)
->setProjection(projection)
->setColor(color)
->use();
Note that you still have to explicitly call use(), because if DSA is
available, no use() is called explicitly on any setUniform(). If DSA is
not available, use() is called on first setUniform() and subsequent
calls have no negative performance impacts.
Magnum.h now doesn't include anything except OpenGL headers, thus
changes in Math library don't trigger recompilation of everything, but
only of things really depending on it.
Math constants moved to separate file for similar reasons, de-inlined
some functions to remove the need for some #includes.
Desktop OpenGL and OpenGL ES 2 support can be switched using CMake
TARGET_GLES option. All functionality not supported in ES is marked in
documentation.
If targetting OpenGL ES, GLES2/gl2.h is included instead of GLEW.
Mesh class now uses VAOs only in desktop OpenGL, in ES the buffers are
bound on each draw call.
Preferred workflow is to specify attribute location explicitly in the
shader. The functions remains here as some old Intel systems don't
support the required extension ARB_explicit_attrib_location (and it's
not in GL 3.0 either). Also updated and fixed the documentation.
Function bindAttribute() was renamed to bindAttributeLocation() to be
consistent with bindFragmentDataLocation().
PhongShader now uses explicit attribute location.