The crashes are triggered by spirv-opt's MergeReturnPass, so we
just disable it. This pass also caused issues with AMD drivers on macOS.
fixes b/291140208
We were waiting for programs from both queues to be compiled before
calling the callback associated with one queue. In practice this caused
the callback associated with high priority programs to be called only
after low priority programs were ready.
Also cleanup-up "token" so that it doesn't store the priority.
Update the documentation and sample to better reflect what the
implementation does.
This PR sets up the ability for shaders to use `gl_ClipDistance`, which will be needed in the future. Desktop GL supports this natively. OpenGL ES requires the EXT_clip_cull_distance extension.
Unfortunately glslang does not support this extension, so we have to employ a workaround for mobile when going through glslang. We instead write to `filament_gl_ClipDistance`, and then modify the SPIR-V to decorate this as `gl_ClipDistance`. See the comment in SpirvFixup.h.
Note this PR does not actually use `gl_ClipDistance` yet, so there should be no change to shaders.
It supports KHR_parallel_shader_compile as well as a
thread pool of GL contexts.
- we have a new 2-priorities queue for shader compilation
- use this feature in gltfio in the ubershader case
the math needs to be maintained in highp, including during the blur
pass.
we add the ability to specify a "precision" qualifier to the "output"
of a post-process material.
we also remove the mediump clamping we used to do on mobile, it shouldn't
be done automatically behind the scenes, it's up to the shaders to do
it if it makes sense.
this is implemented by here by using the skybox texture and blurring it
with the irradiance filter + mipmapping. This only creates a subtle
anisotropic phase-function effect.
* froxelizer doesn't use textures anymore
All data is stored in UBOs.
Additionally, the buffer size is no longer hardcoded at compile time.
This CL cuts in half the numbers of froxels to accommodate devices
limited to 16KiB,
* Use a specialization constant to adjust the size of froxel UBO
This really only affects OpenGL in practice because metal supports 256MB
minimum and only 3% of android devices support less than 32K, which is
what we need.
This works by making the fog an entity which can be used to create
a TransformManager component an participate to the transform hierarchy.
This feature can be used as more advanced way to set the fog's floor,
which now can have an orientation (essentially be a plane).
This is useful for coordinate systems that are not y-up.
Material::compile() can be used to asynchronously ask the backend to
compile a subset of the variants of a Material and be notified when
done. This can be used during initialization to avoid hiccups later.
This will also force caching of those material programs if the
Platform provides the blob cache API.
This is only the first step where we:
- clean-up some code to prepare for 2nd step
- add support for the linear->srgb in the shaders
The linear->srgb conversion is protected by a
specification constant and will be enabled only
if the corresponding EGL extension in not present.
Then, if enabled, the actual conversion is
controlled by a uniform so that it can be
selectively enabled on swapchains that have it
turned on.
In this change, the emulation logic that sets
these gates is not implemented (that's step 2).
This CL contains two parts:
- changes to matc/filamat
- changes to filament itself
Filamat can now generate ES2 compatible shaders. Only the unlit variant
is supported. Fog and picking are supported as well.
post-processing, skinning, instancing, all lighting and shadowing are not supported.
Filament is updated to not issue commands that are not supported in ES2.
Addtionnally, the hello-triangle sample is updated to work on an ES2 device.
A material global is a variable seen by all materials. There are 4 such
variable which are all vec4 and they can be set on a per-view basis.
All materials used during Renderer::render() will see the same value.
These variable can be accessed in the materials by using
getMaterialGloabal{0|1|2|3}.
* vulkan: Fix Adreno issue with optimized material
Turning off the simplification pass seems to remove all of the
artifacts associated with Adreno GPUs.
They're not hardcoded in a database inside MaterialBuilder and are
generated. This will be needed later for ES2 support.
We could actually imagine something more dynamic in the future too.
- refactor the code so that all defines are generated in the same place
- generate common_type after all defines are generated
- protect (with defines) structures and UBOs that are not needed, based
on the variant