With multithreaded variant compilation, compiled materials differ based on which variants finish first. This change ensures that compiled materials are always bit-for-bit identical.
This is helpful when comparing two compiled materials. Hashing the material files can be used to check for equality. It's also convenient for variants to occupy the same index when using matinfo's --print-glsl flag, for example.
This adds a WebSockets server to filament-utils-android.
Unlike my first attempt (#3599), this does not use a piping server and
is therefore much faster to use over a LAN. It also has lower user
friction because there is no need to touch a button in the app or
scan a QR code.
The main goal of this rewrite was to make the code
simpler and easier to maintain.
The API is mostly unchanged, however there are some differences.
- we now have the concept of subresources, e.g. for Textures, as
subresource is a mip level or layer.
- RenderTargets are no longer resources, instead they are transiant
objects associated to a pass and are now called RenderPasses.
- RenderPasses take subresources for attachments.
- We have better validation of graph building.
We should also compute discard flags more accurately.
This adds libs/viewer to filament-utils-android and provides JNI
bindings for AutomationEngine.
This commit also changes the AutomationEngine to use PPM for screenshots
rather than PNG. The reasoning is that it is wasteful to include stb and
our two image-related libraries just to dump screenshots, especially for
a feature we might not use on Android.
Mathias noticed that the `setAcquiredImage` method was not well
documented on the C++ side. While fixing this I figured I'd try to write
up a docstring for the class itself.
assert() is now replaced by assert_invariant() which has the same
prototype and (currently) behaves the same than assert().
<assert.h> should not be used anymore, and is replaced by
<utils/debug.h>, which is where assert_invariant() is found.
The main motivation for this is to be able to set a breakpoint on the
assertion as lldb doesn't handle abort() very well, and doesn't
permit to inspect the stack trace.
A secondary motivation is to be able (at some point) to enable
assertions without necessarily doing a debug build.
Since we cannot upload a depth buffer, this test works by first drawing
a triangle into COLOR + DEPTH, copying them both to a new render target,
then drawing a slightly larger triangle just underneath the first one.
One of Filament's Linux clients at Google wishes to specify a special
path to the SwiftShader library that proffers Vulkan entry points, and
this path can only be determined at run time.
An environment variable seems like the easiest way to support this
functionality. To prevent a security hazard, the env var is checked only
if a special build-time flag is enabled.
According to the portability spec: "If this extension is supported by
the Vulkan implementation, the application must enable this extension."
On my 2019 MacBook, enabling this extension triggers errors relating to
depth comparison samplers which I believe to be bogus, so I filed a
LunarG bug. For now we silence this specific error message.