Reduce the amount of arithmetic in the BlurEffect shader a bit.
We did additions and subtractions with zero, which is sort of a waste
on scalar architectures. Helps ever so slightly on the demo app on my NVidia
card (3–4%).
Seemingly creating and deleting them is crazy expensive on NVidia
(~3 ms for a create/delete pair), so 6dea8d2 caused a performance
regression at high frame rates. Now we instead keep one around per
context (they cannot be shared), which brings us basically back
to where we were performance-wise.
Make Phase take other Phases as inputs, not Nodes.
This was a refactoring I wanted to do for a while, but actually finding
the right structure was a bit tricky. In the process, the entire phase
generation logic was rewritten, but the separation between compilation
and Phase construction is much cleaner now, and the logic in general
is easier to follow with more use of explicit recursion.
I'm still not 100% happy about what might be overuse of output_node;
we still need to link Phase and Node (the link just goes the other way
now), but I'm not sure we need to use it in all the cases we currently do.
A lot of the later commits have been leading up to this, and I finally
got to the point where all the unit tests check out, everything seems
to work (modulo maybe some overflow issues) and we have a model that
matches what people actually expects from convolutions.
Note that this adds a dependency on FFTW3; we could probably have added
our own routines for such small needs, but like with Eigen, calling out to a
library is fine as long as it's of good quality (which FFTW certainly is) and
is widely available.
Revert "Support pad/crop from bottom, not just from the top."
This turned out not to be so useful after all, as we'd like a more
consistent top-left coordinate system, and changes to do that will
obsolete this patch.
Fix a bug where repeated vertical FFTs would reverse the output.
Unfortunately, the tests didn't catch this, as the Repeat test used
an even number of passes (being of size 64), which reversed things
back into place. It now tries a wider range of sizes to make sure
everything is okay.
This tests a few edge cases that are not adequately covered by the
random fp32 tests; in particular, the round-to-even logic had
no test coverage, which is bad.
Formalize the notion of messing with sampler state.
This kills a lot of the assumptions that have been going around,
and should allow us to deal much better with the situation when
we have two or more inputs to an effect (where you basically can't
predict the sampler number used reliably); there's still an edge
case that's documented with a TODO, but this is generally much better.
This allows us to ignore the texture bounce flag when reading from a
FlatInput, and also handles better the case where an YCbCrInput is read
from multiple times (it's now bounced, which should be better for speed,
I think).
The main motivation, however, is to be able to control sampler state
a bit less hackish in the future.
This allows us to ignore the texture bounce flag when reading from a
FlatInput, and also handles better the case where an YCbCrInput is read
from multiple times (it's now bounced, which should be better for speed,
I think).
The main motivation, however, is to be able to control sampler state
a bit less hackish in the future.
This not only fixes issues with poor downconversion on ATI, but also
allows us to normalize while being aware of fp16 roundoff issues.
Seems to about cut the error in half in the HeavyResampleGetsSumRight
test, which as far as I can see would take us up to 10-bit accuracy.
This not only fixes issues with poor downconversion on ATI, but also
allows us to normalize while being aware of fp16 roundoff issues.
Seems to about cut the error in half in the HeavyResampleGetsSumRight
test, which as far as I can see would take us up to 10-bit accuracy.
The primary motivation for this is that SDL2 supports core contexts
and GLES (although it doesn't seem to work well with Mesa on my machine
yet). We support SDL1 for the time being too, though, which causes a
small bit of spaghetti.
Check for core OpenGL versions, not just extensions.
Several extensions have been accepted over the years into the core OpenGL
spec, and occasionally, we might see a situation where something implements
the core spec but _not_ the extension. In particular, some extensions seem
to disappear when we ask Mesa for an OpenGL 3.1 forward-compatible context.
Use the GL_RED texture format instead of GL_LUMINANCE.
Seemingly GL_LUMINANCE is also deprecated; this actually decreases
support for GLES2 somewhat, but we need GLES3 anyway, so the net
loss shouldn't be too bad.