Basically using the same idea as with the discrete version -- having the
second dimension dynamic, together with restricting the implementation to
just Float and Double.
According to the SubdivideRemoveDuplicatesBenchmark, this makes the
implementation slightly slower. I presume this is due to how minmax and
offsets are calculated which is quite cache-inefficient as it goes over
the same memory block multiple times. Added a TODO for later.
I spotted a potential bug -- and it clearly *is* a bug. The test doesn't
reduce the data size in the last dimension, leaving a duplicate (and
unused) item at the end.
I need a variant of removeDuplicatesFuzzyInPlace() that doesn't allocate
the output array but instead puts the data into a pre-existing location.
The discrete / non-fuzzy variant had this already, but this one not.
Magnum/MeshTools/RemoveDuplicates.h:373:30: Requested here: Implicit
conversion from 'std::size_t' (aka 'unsigned long') to 'float' changes
value from 18446744073709551615 to 18446744073709551616
[-Wimplicit-int-float-conversion].
Not that it would really matter at this scale, but thanks anyway.
A breaking change, sorry, but I don't want to add yet another layer of
backwards compatibility on APIs that are in master for just a month or
so. This is a test for how many people actually use these APIs -- if
nobody complains, great!
Conflating the fuzzy operation with the discrete one wasn't a good idea,
as people could be unintentionally using the (slower) fuzzy variant on
data that could be easily deduplicated using the discrete variant. One
such case is in the icosphere primitive, and I'm going to look at that
right now.
While 27f6cc309d made it easier to create
references to attribute-less meshes by avoiding a branch on
attributeCount() (and then using a constructor with explicit vertex
count), code still had to branch on isIndexed() because indices() could
be called only on indexed meshes. This change allows code like
Trade::MeshData reference{data.primitive(),
{}, data.indexData(), Trade::MeshIndexData{data.indices()},
{}, data.vertexData(), Trade::meshAttributeDataNonOwningArray(data.attributeData()),
data.vertexCount()};
which works correctly for all cases and doesn't introduce extra branches
and code paths that would need to be tested. While definitely better, I
might still give up at some point and introduce some
Trade::MeshData::nonOwningImmutableReference() helper for this.
Like with WITH_GL_INFO, it should be a top-level option and WITH_AUDIO
should depend on it, not the other way around. So removing the second
occurence, which is a cmake_dependent_option().
Caused an error when creating a WindowlessGlxApplication on a Mesa with
just llvmpipe. Note to self: never again try to fix anything related to
Xlib that's not broken.
This reverts commit 511d0c1b27.
So it can make use of all the APIs in here. Having the utility part of
Trade would make the cyclic dependency a bit weird. Not adding MeshTools
as a dependency just yet, will do that once it's actually needed.