- decouple the depth and ssao passes, so that the depth
pass could be used by another client, down the framegraph
- set uniforms/samplers from the execute closure of the color pass,
instead of using a separate pass. This is more correct and it
potentially reduces calls to commitUniforms.
- make setSampler check that the value set is different,
the idea here is that it's much more costly to have to commit the
samplers rather than having to compare them. Also realistically we
don't have a lot of samplers in a frame, so that's not a lot of
compares.
- one downside of this change is that commands for the SSAO pass are
always generated, we will fix that in an upcoming change.
Imported render targets are only partially implemented, which
caused a discard flags bug. It would happen when an imported
render target is used more than once like when using SSrefr
without tone mapping. In that case, the 2nd pass would use the same
discard flags as the first pass.
We make sure to only (and always) clear newly allocated buffers,
but only clear existing buffers based on the user request. This
should allow to share the depth buffer between drawing two
Views (if post-process is disabled). This should also fix
a bug where the intermediate buffer wasn't cleared when blending
a view on to of another.
This should fix#2138
This change adds new commands to matinfo to print dictionaries.
This feature is useful to debug dictionaries, and I just used
it to identify that using a shared dictionary would save ~12 KiB
in the Android build. The macOS build (GLSL + Metal) would go
down to 71 KiB from 136 KiB.
The SPIRV to Metal conversion leaves leading spaces and some
comments. This change also runs the shrinker on optimized Metal
shaders to further reduce the size of shaders.
We were not using the correct offsets, however because everything
was so blurry, it wasn't obvious that something was wrong.
This should result in a bit smoother bloom effect.
It controls the quality of the upsampling filter. This can help a lot
if heavy scaling is needed to maintain performance, it also helps if
MSAA is not enabled.
There are 3 quality levels, low, medium and high. 1, 4 and 9 bilinear
taps are used for each level respectively. The high quality setting
employs a tent filter.
we've had issues with some devices running in arm mode, where they
would throw spurious SIGILL on the WFE instruction used in spin locks.
Since on Android Mutexes are very efficient, we just use that instead.
This might fix#2197
libmath itself doesn't expose any stream operators anymore. However,
libutils is able to automatically print libmath types into its
io::ostream -- however matrices are not formatted nicely.
Added a new optional library, libmathio, that provides std::ostream
operators for all libmath types. libmathio does a better job at
formating matrices.
Also removed apply() and map() from libmath because there were not used
anywhere and they forced us to depend on <functional> in public headers.
The scissor is now always ignored -- i.e. when we clear, the whole
surface is cleared, which echoes how discard flags work.
Geometry must be used to clear only a sub-region of the screen.
This simplifies a lot of things because we had workaround for Adreno
GPUs, which were slow when clearing with the scissor enabled.
Major changes are:
- RenderTarget are now real resources as opposed to ad-hoc objects.
This allows to remove a lot of code and simply a lot of things.
- ResouceNode now have a level of indirection (i.e. we store a pointer
to them), which allow fast and more correct implementation of
moveResource().
A new unit test checks that all scenarios of moveResource with a
generic resource are working.
- We have a special version of moveResource that moves a RenderTarget
resource into a TextureResource -- this shouldn't be allowed, but
this helps make the API better. What it means is that
"all rendertargets that use the specified texture as attachment
are replaced with the given rendertarget".
- In this version there are a lot of limitations when moving
a rendertarget into a texture resource; be we cover the case that
is useful to us.