Functionality provided by GL 3.3 and ARB_instanced_arrays, on ES2 this
is again implemented in three different extensions --
{ANGLE,EXT,NV}_instanced_arrays. They are disabled until Magnum has
proper extension loading on ES.
On desktop GL this is provided by ARB_draw_instanced (GL 3.1). Base
instance is available only on desktop GL (4.2, ARB_base_instance). In
ES2 the instanced functionality is provided by three (!) different
extensions (ANGLE_instanced_arrays, EXT_draw_instanced,
NV_draw_instanced), the proper implementation is chosen on context
creation based on what extension is available. Though we don't have
extension loader for ES yet, thus all these extensions are disabled and
the implementation has assertion in it.
Added blind test which tests only that something has been drawn and no
errors were emitted, but not whether the right command is used. I'll
probably need to check this later, because the Mesh::draw() behemoth is
going slightly out of hand :)
I didn't yet have time to add more complete support for ES 3.1, but the
engine should at least work on it. If the driver reports ES 3.0 or 3.1
it is taken as valid value in both ES2 and ES3 builds (i.e. the engine
can work in ES2 mode also on ES3 driver).
Returns list of _all_ extensions reported by the driver, even those that
are not supported in Magnum and also those that are marked as disabled
due to driver bugs. Usable mostly when doing fresh port to new platform
to discover possible new features.
The actual implementation was part of Context constructor (and now this
function is called instead). It is rather ugly because we need to take
care of both GL 2.1 and GL 3.0 (and also ES2 and ES3).
Make it less annoying to debug things on platforms which send all
standard output to /dev/hell without any easy way to override that. Yes,
I'm looking at you, Android.
There is no ES 2.5 or 3.01 and this way we can properly check for
garbage returned by `glGet(GL_VERSION_M*OR)` (e.g. version 2674.-2O8539
would pass here).
Previously the extensions were either disabled altogether (e.g. because
we don't have yet extension wrangler on ES) or had manually adjusted
minimal required versions to avoid issues on older versions (e.g.
ARB_explicit_attrib_location is known to give compiler errors when used
with GLSL < 1.50 on some drivers), both done basically at compile time
unrelated to actual hardware/driver used.
Now all the extensions are enabled exactly as the driver advertises them
(or when their core version is not larger than the context version) and
have minimal required versions as per specification. Given extension is
supported in given version when it is marked as such and its minimal
required version is not larger than the requested one. The extension
disabling is thus done by simply increasing the minimal required version
to larger value (or Version::None for disabling it for all versions).
Currently no such disabling is put into place, but the existing
workarounds scattered all over the place will be gradually converted to
this.
Simplified the code and tests by marking all extensions from previous
versions as supported instead of additional "shorthand" checking whether
extension's core version is supported. The check wasn't probably much of
a speedup, as it was just another branch. This was also buggy
previously, because when the extension would be reported as not being
supported in older versions, which is not what we want. Hopefully this
won't reintroduce the numerous issues with Mesa and OSX I had in the
past :-)
Also removed duplicate implementation of
Context::isExtensionSupported(), one overload is now calling the other.
Both don't have GL_{MAJOR,MINOR}_VERSION enums so we must decide whether
the version is older than OpenGL 3.0 / ES 3.0 either using
MAGNUM_TARGET_GLES2 preprocessor definition or checking for invalid enum
error and then we have to parse version string to ensure that the
version is not too old. On ES2 the version check wasn't present at all
(only optimistic hope), this makes it more hardened.
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.
They provide the same or slightly different functionality as is present
in ES3 itself, causing confusion. Fortunately this change required only
one modification in Context test and nowhere else.
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).
We don't have extension loader for ES yet, thus we need to abort on
these to avoid undefined behavior. The only exception is NaCl, which
provides _some_ extensions without the need for extension loader. These
extensions are implemented in particular:
CHROMIUM_map_sub
EXT_occlusion_query_boolean
Previously this was done in DebugMarker only via GREMEDY_string_marker
on desktop and EXT_debug_marker on ES, now supporting both three on
desktop and KHR/EXT version on ES. The old DebugMarker is now only a
thin wrapper around DebugMessage, is marked as deprecated and will be
removed in future release.
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.