Commit Graph

5 Commits

Author SHA1 Message Date
Arseny Kapoulkine eafd83ddc8 Remove clusters from vcacheoptimizer
There are several issues with passing cluster data around from algorithm
to algorithm:

- It complicates the interface, making overdraw optimization slightly
harder to use. There is also some asymmetry in the interface and the
user has to deal with one extra dynamically allocated array if they want
to optimize for overdraw.

- It ties the vertex cache and overdraw optimization algorithms together
- we can't really swap out one algorithm for another easily.

- It uses a specific cluster selection that can in some cases
significantly penalize the post-overdraw ACMR even with threshold=1 -
this is contrary to what Tipsify whitepaper claims.

To solve all these issues, we now generate the cluster information in
the overdraw algorithm. We follow a similar structure where we generate
hard boundaries and then generate soft boundaries based on that; instead
of using vertex cache algorithm flow to generate hard boundaries, we
treat any triangle that has all its three vertices miss the vertex cache
as the hard boundary.

The motivation behind this choice is simple - most vertex cache algorithms
will try to use greedy choices for the next triangle, and will only fall
back to a triangle that's out of the cache as some sort of fallback,
which means that it's likely that a triangle like this starts a
cache-disjoint patch of triangles and as such the penalty for reordering
at this boundary is going to be low.

In practice, while this choice does not mean that we perfectly preserve
ACMR when reordering along hard boundaries, it does result in a closer
match between expected ACMR and real ACMR after overdraw optimization.
2017-07-10 21:14:27 -07:00
Arseny Kapoulkine 94337f8988 Update README.md
Clean up the wording and don't mention Tipsify; instead move the
references to the Tipsify to the source code (one day we might switch to
a different algorithm).
2017-07-09 20:54:33 -07:00
Arseny Kapoulkine 0262c99b06 Implement in-place optimization support
For all optimization algorithms we now support in-place optimization.
This currently requires extra data copies but it makes sense to support
this at the interface level since with other algorithms a copy might be
unavoidable and as such in-place optimization might become free.
2017-07-09 20:49:05 -07:00
Arseny Kapoulkine bec59756d4 Refactor vertex fetch optimizer and add more assertions
We now range check indices in most algorithms and do some other sanity
checks. Also analyzers now correctly handle empty meshes.
2017-07-09 20:15:03 -07:00
Arseny Kapoulkine 9cbef2c1da Change the terminology once more, hopefully this time it's final.
We now refer to pre-transform cache optimization as "vertex fetch
optimization".
We now refer to post-transform cache optimization as "vertex cache
optimization".

This seems to be a bit more modern and easier to explain.
2017-07-09 18:50:33 -07:00