In nearly every case the attributes are bound and uniform locations
queried with constant char arrays:
bindAttributeLocation("position", Position::Location);
colorUniform = uniformLocation("color");
Avoiding conversion to std::string and passing const char(&)[size]
directly will avoid needless allocation (and later deallocation) for
every call.
In most cases the label is set directly from code, e.g.:
texture.setLabel("diffuse-duck");
Avoiding conversion to std::string and passing char(&)[size] directly
will avoid one allocation and deallocation. Better solution would be to
use std::string_view everywhere, but we're not in C++17 yet.
Otherwise my NVidia emits GL_INVALID_VALUE with message "that <object>
is not valid object", which isn't in the specs. I hate this "deferred
everything" approach in GL. Is this even legal optimization?
Convenience overload to attachShader(), allowing the user to specify
more than one shader at once. Just a complement to initializer-list
versions of compile() and link(), but without any performance
difference.
Currently it failed on "error when trying to open configure.h", which is
NOT a helpful message at all. Now we check for existence of the include
dir before trying to open the file, thus failing with proper "Could NOT
find Magnum" message.
Commit mosra/corrade@9485ef7effd6c8241e03982c53e8fabfe260b525 broke
this, apparently the compiler can't decide which overload to select when
a type has implicit conversion to another type which is then supported
by both Debug and std::ostream operator<<. Working around this for now as
it is the only case, hopefully we won't run into something similar later.
WebGL mandates that array subscription is done with constant expression,
ANGLE too (but I think that has also something to do with D3D9
limitations). This is however allowed by OpenGL ES 2.0 specification, so
enabling the workaround only for WebGL and ANGLE (i.e., this won't apply
to Native Client using native GL drivers).
A general way to detect drivers, which can be later used for applying
driver-specific workarounds. Currently used for disabling
ARB_explicit_uniform_location on AMD drivers.