This is always true in the single-draw case, since setDrawOffset()
asserts on this. In the multi-draw case this optimization doesn't make
sense, because it doesn't make sense to create a multidraw shader with
just one draw.
On an Intel 630 GPU this resulted in single-draw single-material Phong
to go from 550 ms to 440, which is roughly a 20% improvement. For the
simpler shaders the difference is even higher. The multidraw numbers
stayed the same as before, obviously.
It was just RGB before. In order to avoid breaking current code, the
attribute now requires explicit specification of number of components.
If building with deprecated APIs enabled, there is an additional
deprecated constructor that defaults to RGB so the current code should
keep working as-is.
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.
Originally it was for more convenient usage of homogeneous coordinates
in shaders themselves, but it is actually not needed:
* When passing three-component vector (3D position) to `vec4`, the last
coordinate is implicitly set to `1`, thus there is no need to pass it
explicitly in each attribute.
* On the other hand, when passing three-component vector (2D position
in homogeneous coordinates) to `vec3` with Z explicitly set to `1`,
it still needs some swizzle magic to extend it to `vec4` gl_Position.
Passing it as two-component vector results in nearly the same magic
while saving precious memory.
* In shader uniforms (projectionMatrix makes more sense than projection
alone)
* For underlying types for SceneGraph transformation. It is already
used in Drawable::clean() as transformationMatrix, so why not use it
also in AbstractFeature::clean(). Moreover, clean() could be in
future also done using something else, this helps to distinguish the
type just from parameter name.
* In Physics shapes - applyTransformationMatrix() (as it could be in
future also done using something else).