* Support the external image on macOS
Implement CocoaExternalImage.
* Fix to take an onwership of the external image
* Correct incorrect comments
* Rename a function explicitly
Make a function name to know copying RECTANGLE to TEXTURE2D.
* Do lazy initialization
Create CocoaExternalImage::SharedGl when it's needed.
* Fix a crash when engine is terminated
Destroy the external image shared gl before gl context is destroyed.
* Remove an useless variable
* Improve size optimizations when compiling material
This changes the behavior of the size optimizer in matc (-S), but
only for GLSL and MSL. With this change we gain a ~65% size reduction
on a lit material compiled for OpenGL. To get those gains we generate
extra SPIRV debug information to preserve variable names and better
utilize the line dictionary. Unfortunately this break the SPIRV
optimizer so we skip it and instead rely on a simple DCE pass provided
by glslang. We also enhance the whitespace removal pass of the GLSL
minifier to move lone { and } to the previous line, which avoids
generating an extra index in each shader variant. Each index being
at least as big as the character itself, this is quite wasteful.
When generating SPIRV for Vulkan, we rely on spirv-opt for size
optimizations as before.
Some shaders can be shared across all materials (e.g. the depth
shaders). We use the filament default material as the "source" of
the cache, but until now we relied on an a priori knowledge of which
variants were present in the default material.
With this change, we now query once the list of variants (of interest)
in the default material and reuse that list for caching these variants
later.
This is better because the cached variants are now entirely driven by
the default material (which they depend on anyways). This is also faster
because we don't need to query which variant we need each time we create
a material.
- Depth attachment layout has generated a lot of error due to
it being read-only. But the store-ops for the attachment during
the renderpass are all write ops. We set the depth attachment
layout as VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
- Enable extra blitting step for SSAO because of the above layout
conundrum.
- Index buffers did not have a pipeline barriers after loading
them.
- Remove `assert_invariant(utils::popcount(sampleCount) == 1);`
from `reduceSampleCount`. This assert fails when enabling the
duplicate pass for SSAO.
The VSM variant is never needed for unlit materials, it was filtered
out correctly for color shaders but not for the depth shaders.
This removes 4 variants from all unlit materials.
Also improve matinfo variants output.
* Suppress numerous libz warnings
zlib will fix this issue later (see https://github.com/madler/zlib/issues/633).
For now we will just turn off the warning.
* Fix Windows build
The feature-level option sets the maximum feature level allowed for
the material. matc will fail if the specified material has a higher
feature level than the value set with the feature-level option. The
default is 3 (max).
This can be used to ensure that materials don't use features above
a specified level.
... which is needed to avoid compilation error with recent LLVM libc++ (after https://reviews.llvm.org/D146097). Previously, symbols like std::terminate() were available through other headers (e.g. <functional>, <vector>, etc.).
- FogOption::color is now correctly multiplied by the exposure and
environment intensity.
- New option to exclude the skybox from the fog
- better documentation and naming
In device vertex domain it is easy to specify infinite world-space
coordinated (e.g. with the skybox), this results in complications
everywhere. We were mitigating this by essentially moving these
coordinates to around 16000 (give or take depending on the near plane),
but that was way too small.
Now we move them around 1e19, which seems to work. It's important with
applications rendering very large scenes to not use too small of a value.
This happened because the code iterated over the keys of a hashmap,
which obviously were not guaranteed to be in the same order as those
entries where added to the hashmap.
We fix this by adding a "visitor" to the materialchunk, so we can
iterate through it in order and retried the info we need.
When we call TextureProvider::cancelDecoding, we should make sure
that textures that have been decoded, but not yet used (popped)
should be released (i.e. memory freed and the meta data marked
appropriately.)