There was a nasty issue when moving the Device -- because the Queue
instances are populated with the Device pointer in the constructor,
moving the Device makes the Queue device pointer invalid and those
instances are useless. Discovered this when using VulkanTester to test
an upcoming Queue::submit() -- until then, the Device pointer in the
Queue wasn't really used for anything and so this wasn't known.
Making the Device immovable is thus the only sane way to keep the
current Queue retrieval workflow, which I'd say is much cleaner than
having to manually query the device for queues later using some
error-prone indices and whatnot. On the other hand, this finally makes
it possible to have a failable device creation, instead of the device
creation failing on an assert (or failing silently when
CORRADE_NO_ASSERT is defined). This is consistent with how the GL
wrapper works.
Also, because all device-dependent objects need to keep a pointer to the
originating Device in order to access Vulkan function pointers, having
it immovable makes it considerably faster. I'll make Instance immovable
with tryCreate() next because it seems like a good thing to do there as
well.
After I implemented the render pass wrapper, seeing how the
RenderPassCreateInfo structure and its dependencies were HUGE compared
to the actual tiny and lean RenderPass, I felt uneasy dragging their
definition along to every place where a RenderPass gets used. It's not
as bad with the others, but as new extensions are implemented I expect
that to get the same.
This change makes it easier for me to accept that Image.h / Buffer.h
depends on Memory.h. There isn't a real measurable difference when
building Magnum itself (50 ms out of 7 seconds for the Vk library
alone), but that's because most of the code (and tests) needs the
CreateInfo structures anyway.
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.
Use Animable<dimensions, T> and AnimableGroup<dimensions, T> like before
and add two kinds of aliases instead of only one:
BasicAnimable[Group]2D<T>/BasicAnimable[Group]3D<T> for abstract type
and Animable[Group]2D/Animable[Group]3D for Float.
Partially reverts commit c32c12b387.
Moved almost everything into one file, instead of compiling ~50k LOC
seven times it is now compiling 56k LOC only once. This saves another ~5
seconds of compilation time (before ~4:11, now ~4:06).
Also explicitly saying that we are instantiating Float version of all
classes. In the future we might have compile switch for building also
Double one, this helps with consistency.
Allows to animate objects, pause, repeat and resume the animations. The
user implements animation step and can perform actions on state changes.
Each Animable is part of some group which is optimized for case when no
animation is running, thus it is possible to create multiple independent
"animation islands" to improve performance.
SizeTraits class provides suitable types for given data size at compile
time, SizeBasedCall can call suitable templated overload based on given
data size at runtime.
Also added meta classes Pow and Log for computing powers and logarithms
at compile time, usable mainly in conjunction with SizeTraits. Their
implementation is checked at compile-time using static_cast().